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

ansible-lint exits when using newer role dependency dict structure #337

Closed
slmingol opened this issue Apr 17, 2018 · 0 comments
Closed

ansible-lint exits when using newer role dependency dict structure #337

slmingol opened this issue Apr 17, 2018 · 0 comments

Comments

@slmingol
Copy link

Issue Type

  • Bug report

Ansible and Ansible Lint details

$ ansible --version
ansible 2.5.0 (stable-2.5 6e1ca544dd) last updated 2018/04/04 12:43:54 (GMT -400)
....
  python version = 2.7.14 (default, Mar 10 2018, 00:01:11) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)]
$ ansible-lint --version
ansible-lint 3.4.21
  • ansible installation method: one of source
  • ansible-lint installation method: one of pip

Desired Behaviour

Command should not exit with error when role dependency is in newer dictionary format. The inclusion of a name or role is not mandatory when including dependencies in the meta.yml.

Actual Behaviour (Bug report only)

When a role dependency in meta/main.yml is defined like so:

dependencies:
  - src: [email protected]:devops/my-role.git
    scm: git

Errors with with:

role dict {u'scm': u'git', u'src': u'[email protected]:devops/my-role.git'} does not contain a "role" or "name" key
@willthames willthames added the bug label Apr 19, 2018
willthames pushed a commit that referenced this issue Sep 19, 2018
Fixes: #337

Added a check in the _roles_children function if the children that are to be included came out of the dependencies.
If the are from 'dependencies' we don't expect name or key

Added testcases according to the possible notations of the dependencies in the meta/main.yml as stated here: https://docs.ansible.com/ansible/latest/reference_appendices/galaxy.html#dependencies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants