New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a rule to validate module options #2749
Conversation
d954d14
to
f6f1ec1
Compare
1c61dde
to
4f15413
Compare
@ganeshrn How far are you from making it ready for review? |
@ganeshrn I will get the PR ready for review soon most likely by end of this week. |
The PR is ready for review. |
09ae5aa
to
475d501
Compare
475d501
to
5a9509a
Compare
This should make it easier to reuse these utility functions. Related: ansible#2749
This should make it easier to reuse these utility functions. Related: #2749
5a9509a
to
5767473
Compare
The new rule will validate the correctness of module options for tasks. The validation will check if the option name is valid and has correct value along with conditionals like * mutually_exclusive * required_together * required_one_of * required_if Note: * For template values for options the data type validation will be ignored * For modules that are implemented as action plugins the check includes if the option is correct and passes the data type check or not.
5767473
to
1987698
Compare
This new rule is not such friendly, which forcing me to disable it with ansible-lint 6.10.0 :-( My problematic code (https://github.com/alvistack/ansible-role-ansible/blob/272ce69153b7ddda0a36f8e05e026feaba2cf86e/tasks/debian.yml#L17-L25):
For multiple OS support,
With ansible-lint 6.10.0 now it generate follow
May I have more information why |
See this bug report as well: #3200 |
The new rule will validate the correctness
of module options for tasks. The validation
will check if the option name is valid and
has correct value along with conditionals like
Note:
if the option is correct and passes the data type check or not.