Add support for X_strict types in argspec
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.
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
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 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.
A potential fix for https://github.com/ansible/ansible/issues/84113 can be adding a new permission_strict type in argspec
Duration type - https://github.com/ansible/ansible/pull/36878
@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 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.
IP address and MAC as valid input
Timestamp would be great as well. (Something relative or absolute that results in a datetime.datetime object, preferably with a timezone set.)