Skip to content
New issue

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

key-order rule does not work at the play level for name key #3787

Closed
shatakshiiii opened this issue Sep 29, 2023 · 1 comment · Fixed by #3815
Closed

key-order rule does not work at the play level for name key #3787

shatakshiiii opened this issue Sep 29, 2023 · 1 comment · Fixed by #3815
Assignees
Labels

Comments

@shatakshiiii
Copy link
Contributor

shatakshiiii commented Sep 29, 2023

Summary

As per the documentation of key-order rule, key name must always be the first key for plays, tasks and handlers. Which doesn't seem to work for a given scenario:

Issue Type
  • Bug Report
STEPS TO REPRODUCE
---
- hosts: localhost
  name: This is a playbook  # <-- name key should be the first one
  tasks:
    - name: A block
      when: true
      block:
        - name: Display a message
          debug:
            msg: "Hello world!"

For the above playbook we should get a key-order rule violation at line 2, as name should be the first key (instead of hosts).

Actual Behavior

There is no error for key-order rule while running ansible-lint on this playbook.

(l1) ➜  test_lint  ansible-lint playbooks/key-order.yml
WARNING  Listing 1 violation(s) that are fatal
fqcn[action-core]: Use FQCN for builtin module actions (debug).
playbooks/key-order.yml:8 Use `ansible.builtin.debug` or `ansible.legacy.debug` instead.
@audgirka
Copy link
Contributor

Related: #3634

@audgirka audgirka removed the new Triage required label Sep 29, 2023
@audgirka audgirka self-assigned this Oct 5, 2023
@audgirka audgirka moved this from Roadmap to In Progress in 🧰 devtools project board Oct 5, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Done in 🧰 devtools project board Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants