Skip to content

meta/argument_specs.yml in a role is treated as a playbook #1688

@briantist

Description

@briantist
Summary

I'm hitting this issue by way of a vscode extension so I'm having a bit of a hard time determining if it's definitely an issue in ansible-lint or not (see tomaciazek/vscode-ansible#19).

I'm also hitting #1507 so it's difficult for me to run ansible-lint directly with a modern version of Ansible.

But the issue I'm seeing is that the meta/argument_specs.yml is "failing" with an unexpected internal error while other files in the role are being treated ok. This text is shown the extension's log:

[Info - 9:04:01 PM] [ansible-lint] WARNING Overriding detected file kind 'yaml' with 'playbook' for given positional argument: /home/briantist/code/flatiron-ansible-collections/ansible_collections/flatiron/vault/roles/agent/meta/argument_specs.yml
You can skip specific rules or tags by adding them to your configuration file:
# .ansible-lint
warn_list: # or 'skip_list' to silence them completely
- internal-error # Unexpected internal error

Finished with 1 failure(s), 0 warning(s) on 1 files.

I was able to workaround it by adding the following in .ansible-lint:

kinds:
  - meta: '**/roles/**/meta/argument_specs.yml'

I'm unsure if marking it as meta is "correct" but it does make the failure go away.

Issue Type
  • Bug Report
Ansible and Ansible Lint details
$ ansible --version
ansible [core 2.11.2] 
  config file = None
  configured module search path = ['/home/briantist/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/briantist/.a211/lib/python3.6/site-packages/ansible
  ansible collection location = /home/briantist/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/briantist/.a211/bin/ansible
  python version = 3.6.9 (default, Jan 26 2021, 15:33:00) [GCC 8.4.0]
  jinja version = 3.0.1
  libyaml = True

$ ansible-lint --version
ansible-lint 5.0.12 using ansible 2.11.2
FATAL: Ansible CLI (2.11.2) and python module (2.9.22) versions do not match. This indicates a broken execution environment.
  • ansible installation method: pip
  • ansible-lint installation method: pip
OS / ENVIRONMENT

Ubuntu 18.04 (WSL2)

STEPS TO REPRODUCE
Desired Behaviour

File is linted correctly.

Actual Behaviour

(in description)

Metadata

Metadata

Assignees

Labels

reproducer: presentThis PR or issue contains code, which reproduce the problem described or clearly understandable STR

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions