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
If you use ansible.builtin.include_role and use role rather than name as the name of the role to include, ansible-lint suppresses output.
Issue Type
Bug Report
OS / ENVIRONMENT
ansible-lint 6.22.2 using ansible-core:2.16.3 ansible-compat:4.1.11 ruamel-yaml:0.18.5 ruamel-yaml-clib:0.2.8
macOS Sonoma, Intel Mac.
ansible installation method: pip
ansible-lint installation method: pip
STEPS TO REPRODUCE
Correct syntax for include_task gives expected result (intentionally unnamed task is flagged):
---
- name: Demonstrate linting issue.hosts: alltasks:
- name: Include a role with the correct syntaxansible.builtin.include_role:
name: foo
- ansible.builtin.setup:
ansible-lint test.yml
WARNING Skipped installing old role dependencies due to running in offline mode.
WARNING Skipped installing collection dependencies due to running in offline mode.
WARNING Listing 1 violation(s) that are fatal
name[missing]: All tasks should be named.
test.yml:9 Task/Handler: setup
Read documentation for instructions on how to ignore specific rule violations.
Rule Violation Summary
count tag profile rule associated tags
1 name[missing] basic idiom
Failed: 1 failure(s), 0 warning(s) on 1 files. Last profile that met the validation criteria was 'min'.
Incorrect syntax still works, but linting output is suppressed even for other issues:
---
- name: Demonstrate linting issue.hosts: alltasks:
- name: Include a role with the wrong syntaxansible.builtin.include_role:
role: foo
- ansible.builtin.setup:
ansible-lint test.yml
WARNING Skipped installing old role dependencies due to running in offline mode.
WARNING Skipped installing collection dependencies due to running in offline mode.
WARNING Listing 2 violation(s) that are fatal
WARNING A rule (load-failure) that is not part of a collection cannot access its configuration.
A rule (load-failure) that is not part of a collection cannot access its configuration.
Desired Behavior
I think it would be reasonable for ansible-lint to say which fatal violation it had detected.
Actual Behavior
There's really no clue here as to what the issue is, and worse Ansible itself actually seems to accept the incorrect syntax. Other things that ansible-lint detects are also suppressed in this case.
The text was updated successfully, but these errors were encountered:
Summary
If you use
ansible.builtin.include_role
and userole
rather thanname
as the name of the role to include,ansible-lint
suppresses output.Issue Type
OS / ENVIRONMENT
ansible-lint 6.22.2 using ansible-core:2.16.3 ansible-compat:4.1.11 ruamel-yaml:0.18.5 ruamel-yaml-clib:0.2.8
macOS Sonoma, Intel Mac.
STEPS TO REPRODUCE
Correct syntax for
include_task
gives expected result (intentionally unnamed task is flagged):Incorrect syntax still works, but linting output is suppressed even for other issues:
Desired Behavior
I think it would be reasonable for
ansible-lint
to say which fatal violation it had detected.Actual Behavior
There's really no clue here as to what the issue is, and worse Ansible itself actually seems to accept the incorrect syntax. Other things that
ansible-lint
detects are also suppressed in this case.The text was updated successfully, but these errors were encountered: