We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
ansible-lint type checks don't account for jinja2 expressions that change data type
ansible-lint --version ansible-lint 24.2.0 using ansible-core:2.15.5 ansible-compat:4.1.11 ruamel-yaml:0.18.6 ruamel-yaml-clib:0.2.8
Create a role with the following files:
defaults/main.yml --- mydict: a: a b: b meta/argument_specs.yml --- argument_specs: main: options: myvar: type: str required: true choices: "{{ mydict.keys() | list }}"
ansible-lint should understand that jinja2 expression that is used in choices actually yields an array
choices
schema[role-arg-spec]: $.argument_specs.main.options.myvar.choices '{{ mydict.keys() | list }}' is not of type 'array'.
The text was updated successfully, but these errors were encountered:
That seems like another schema error, as the schema should allow jinja templates for this field too. Please make a PR to fix it.
Sorry, something went wrong.
Allow jinja2 expressions for choices field (ansible#4043)
e2c0fab
Allow jinja2 expression for choices field (ansible#4043)
9383cf7
3457651
Allow jinja2 expression for choices field (#4043) (#4117)
17194e6
Successfully merging a pull request may close this issue.
Summary
ansible-lint type checks don't account for jinja2 expressions that change data type
Issue Type
OS / ENVIRONMENT
STEPS TO REPRODUCE
Create a role with the following files:
Desired Behavior
ansible-lint should understand that jinja2 expression that is used in
choices
actually yields an arrayActual Behavior
schema[role-arg-spec]: $.argument_specs.main.options.myvar.choices '{{ mydict.keys() | list }}' is not of type 'array'.
The text was updated successfully, but these errors were encountered: