You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ansible-lint reports a syntax error for the skipped test when used in task specific vars
Issue Type
Bug Report
OS / ENVIRONMENT
ansible-lint 24.9.1.dev0 using ansible-core:2.17.4 ansible-compat:24.9.0 ruamel-yaml:0.18.6 ruamel-yaml-clib:0.2.8
STEPS TO REPRODUCE
---- name: Test play hosts: localhost tasks: - name: Test task ansible.builtin.debug: msg: "Hello, world!" when: false register: result - name: Test task 2 vars: counter: "{{ result is skipped | ternary(1, 2) }}" ansible.builtin.debug: msg: "Hello, world {{ counter }}!"
Desired Behavior
$ ansible-lint /tmp/main.yml
Passed: 0 failure(s), 0 warning(s) on 1 files. Last profile that met the validation criteria was 'production'.
Actual Behavior
$ ansible-lint /tmp/main.yml
WARNING Listing 1 violation(s) that are fatal
jinja[invalid]: An unhandled exception occurred while templating '{{ result is skipped | ternary(1, 2) }}'. Error was a <class 'ansible.errors.AnsibleFilterError'>, original message: The 'skipped' test expects a dictionary
/tmp/main.yml:16 Task/Handler: Test task 2
Read documentation for instructions on how to ignore specific rule violations.
Rule Violation Summary
count tag profile rule associated tags
1 jinja[invalid] basic formatting
Failed: 1 failure(s), 0 warning(s) on 1 files. Last profile that met the validation criteria was 'min'.
The text was updated successfully, but these errors were encountered:
This is similar to #3155
Summary
ansible-lint reports a syntax error for the skipped test when used in task specific vars
Issue Type
OS / ENVIRONMENT
ansible-lint 24.9.1.dev0 using ansible-core:2.17.4 ansible-compat:24.9.0 ruamel-yaml:0.18.6 ruamel-yaml-clib:0.2.8
STEPS TO REPRODUCE
Desired Behavior
Actual Behavior
The text was updated successfully, but these errors were encountered: