Skip to content

Reports "All tasks should be named" when the task is named with no capital letter #4351

Open
@bolinocroustibat

Description

Environment: MacOS 15.0
Ansible version: 10.4.0

Given the following task in a playbook, calling tasks from a role named homebrew:

- name: Install and update Homebrew
  hosts: local
  tasks:
    - include_role:
        name: homebrew
        tasks_from: install
    - include_role:
        name: homebrew
        tasks_from: update

Ansible-lint raises the following warnings:

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.

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions