-
Notifications
You must be signed in to change notification settings - Fork 663
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
How do you lint a role that uses custom module? #245
Comments
willthames/ansible-review#16 here is related issue |
Thanks @strangeman, that's still my best solution :) |
Please honor the libraries setting in either the ansible.cfg file or ANSIBLE_LIBRARY environment variable |
I think that we need an option configurable in ansible-lint config file for this, as env var ....cannot be included with the code. People should be able to run ansible-lint without alterning their environment. For the moment I define this variable in tox.ini but this does not solve the problem of running outside tox. |
While there is a workaround mentioned at pre-commit/pre-commit#758 (comment) I am afraid that it may be usable only if your module is inside the repository itself. it will not work if that module is installed as a python package added to dependencies. I am still looking for somethign that would allow to do:
--- where |
Placing custom modules into "library" folder next to the playbook yaml file is one of the recommended way of doing this in Ansible's official document... |
What is not documented is what if you have other roles or modules that are hosted inside the same repository. On open stack they spread across |
This is a general question, so sorry for not sticking to the given issue template. I'll create another issue with a bug report later if it makes sense.
Imagine the following scenario:
Role
FOO
provides a custom modulefoo
, which can be used asNow I have a role
BAR
. This role has a dependency to FOO in itsmeta/main.yml
. This works fine with ansible-galaxy. If the role has been included in a playbook the provided modules can be used in any role. In one of the tasks files ofbar
is a task like seen above:How would I only run the linter on the role
BAR
? If I do so, it complains it wasn't able find a task.I can not even disable the linting for those tasks per
tags: skip_ansible_lint
. I assume this is because the parsing is done by the Ansible library.Is there a clean way to overcome this problem?
The text was updated successfully, but these errors were encountered: