ansible icon indicating copy to clipboard operation
ansible copied to clipboard

Add support for X_strict types in argspec

Open sivel opened this issue 2 years ago • 4 comments

SUMMARY

Add support for X_strict types in argspec

Specifically via type of:

  • str_strict
  • list_strict
  • dict_strict
  • bool_strict
  • int_strict
  • float_strict

or by specifying a simple type like str and in the argspec declaring strict=True.

ISSUE TYPE
  • Feature Pull Request
ADDITIONAL INFORMATION

No thought has been put into docs rendering for strict types.

sivel avatar Aug 24 '23 17:08 sivel

Team,

any news on this PR. I will very interesed to it and this allow us to use argsspec for validating role in more precise way for type itself.

Thanks

tanganellilore avatar Nov 13 '23 15:11 tanganellilore

It is on hold, until after the "data tagging" work that has been going on for a few releases is merged. The intent is that this would, or some derivative form would be included in 2.17.

sivel avatar Nov 13 '23 15:11 sivel

@sivel any updates on this PR and when it will be released? The lack of strict validation makes argument_specs not particularly useful in a lot of cases, even if it's working as designed currently.

jwcorell avatar Sep 18 '24 03:09 jwcorell

A potential fix for https://github.com/ansible/ansible/issues/84113 can be adding a new permission_strict type in argspec

Akasurde avatar Oct 15 '24 15:10 Akasurde

Duration type - https://github.com/ansible/ansible/pull/36878

Akasurde avatar Oct 24 '24 17:10 Akasurde

@sivel by "data tagging" I assume you mean https://github.com/ansible/ansible/issues/84340? If so, the linked MRs there are merged, and this MR should be converted from draft to ready to review.

Or were you referring to all the issues in https://github.com/ansible/ansible/issues?q=is%3Aissue+is%3Aopen+label%3Adata_tagging+ ?

kominoshja avatar Dec 29 '24 21:12 kominoshja

@kominoshja Data tagging is a new feature slated for the upcoming release of Ansible. This issue is tagged as data-tagging since the feature should be included in that release.

Akasurde avatar Dec 30 '24 19:12 Akasurde

IP address and MAC as valid input

Akasurde avatar Apr 11 '25 18:04 Akasurde

Timestamp would be great as well. (Something relative or absolute that results in a datetime.datetime object, preferably with a timezone set.)

felixfontein avatar Apr 12 '25 20:04 felixfontein