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

Imported playbooks not found/linted anymore. #3407

Closed
TimGrt opened this issue May 6, 2023 · 0 comments · Fixed by #3413
Closed

Imported playbooks not found/linted anymore. #3407

TimGrt opened this issue May 6, 2023 · 0 comments · Fixed by #3413
Assignees
Labels
Milestone

Comments

@TimGrt
Copy link

TimGrt commented May 6, 2023

Summary

A global playbook with only import_playbook statements is identified as generic yaml file instead of playbook. Bug was introduced in 6.12.0, previous versions (<6.11.0) are working. Bug does also occur in latest 6.15.0!

Issue Type
  • Bug Report
OS / ENVIRONMENT
ansible-lint 6.12.0 using ansible 2.14.4
  • ansible installation method: pip
  • ansible-lint installation method: pip
STEPS TO REPRODUCE
.
├── playbooks
│   ├── playbook1.yml
│   └── playbook2.yml
└── site.yml
---
# site.yml
- ansible.builtin.import_playbook: playbooks/playbook1.yml
- ansible.builtin.import_playbook: playbooks/playbook2.yml

Both playbooks look like this:

---
# playbooks/playbook1.yml
- hosts: localhost
  connection: local
  tasks:
    - debug:
        msg: "Hello from playbook1"
Desired Behavior
$ ansible-lint --version
ansible-lint 6.11.0 using ansible 2.14.4
$ ansible-lint site.yml -vv
DEBUG    Logging initialized to level 10
...
WARNING  Overriding detected file kind 'yaml' with 'playbook' for given positional argument: site.yml
INFO     Executing syntax check on site.yml (0.24s)
DEBUG    Examining site.yml of type playbook
DEBUG    Examining playbooks/playbook2.yml of type playbook
DEBUG    Examining playbooks/playbook1.yml of type playbook
WARNING  Listing 8 violation(s) that are fatal
...
Failed after min profile: 4 failure(s), 4 warning(s) on 3 files.
A new release of ansible-lint is available: 6.11.0 → 6.15.0 Upgrade by running: pip3 install --user --upgrade ansible-lint
Actual Behavior

Running ansible-lint and providing site.yml with Versions >=6.12.0 does not lint the imported playbooks, as the file is identified as a generic yaml file.

$ ansible-lint site.yml -vv
DEBUG    Logging initialized to level 10
...
DEBUG    Passed 'site.yml' positional argument was identified as generic 'yaml' file kind.
...
Passed with production profile: 0 failure(s), 0 warning(s) on 1 files.
@TimGrt TimGrt added bug new Triage required labels May 6, 2023
@audgirka audgirka closed this as completed May 8, 2023
@audgirka audgirka reopened this May 8, 2023
@audgirka audgirka self-assigned this May 9, 2023
@ssbarnea ssbarnea removed the new Triage required label May 9, 2023
@ssbarnea ssbarnea moved this to In Progress in 🧰 devtools project board May 9, 2023
@ssbarnea ssbarnea added this to the 6.16.x milestone May 9, 2023
@trishnaguha trishnaguha moved this from In Progress to Done in 🧰 devtools project board Sep 6, 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.

3 participants