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
WARNING Listing 2 violation(s) that are fatal
name[missing]: All tasks should be named.
playbooks/myplaybook.yaml:6 Task/Handler: include_role name=homebrew tasks_from=install
name[missing]: All tasks should be named.
playbooks/myplaybook.yaml:9 Task/Handler: include_role name=homebrew tasks_from=update
...even though, obviously, the tasks are named.
When putting a capital letter to the roles names, the fatal warning disappear.
If I understand correctly what's happening, the warning doesn't raise the right issue (capital letter), but instead says the name is missing. If I don't, this is quite confusing and should be better explained.
The text was updated successfully, but these errors were encountered:
bolinocroustibat
changed the title
Reports "All tasks should be named." whhen the task is named with no capital letter
Reports "All tasks should be named" when the task is named with no capital letter
Sep 30, 2024
What it's actually looking for is the name attribute of the task itself to be present, not of the include_role module. So what the rule is expecting is something like
- name: Do the thing that the role specifies
include_role:
name: homebrew
tasks_from: install
The fact that capitalizing the name field of include_role sidesteps this is unexpected, however, and should not be happening. There might be some overlap with the two name attributes that is causing trouble.
Environment: MacOS 15.0
Ansible version: 10.4.0
Given the following task in a playbook, calling tasks from a role named
homebrew
:Ansible-lint raises the following warnings:
...even though, obviously, the tasks are named.
When putting a capital letter to the roles names, the fatal warning disappear.
If I understand correctly what's happening, the warning doesn't raise the right issue (capital letter), but instead says the name is missing. If I don't, this is quite confusing and should be better explained.
The text was updated successfully, but these errors were encountered: