-
Notifications
You must be signed in to change notification settings - Fork 665
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
Error for custom/local module #372
Comments
It seems to do this for any module it doesn't know about, like |
@flamein It should definitely work with any modules that are in the core version of ansible it's run with (otherwise it wouldn't work with any modules) - is somehow ansible-lint using a different version of ansible? @memelet I must confess I haven't tested with out-of-core modules for a while - I'll flag this as a bug and see what we can do to investigate further |
Disregard, dropping the |
@willthames Any updates on this? I'm facing the same problem for local modules. |
In fact there are cases where modules are installed by various python dependencies and ansible-lint will also choke on these ones. Maybe it would be much easier to allow us to whitelist ansible modules, so the linter will assume that they exists and skip checking them. |
I think that a way to whitelist missing modules could also be seen as a very useful feature. I am facing lots of errors like this on zuul jobs which can use the The reality is that the linted playbooks would run only under zuul, where the module is available. Still, we do not want to prevent people from linting locally, where they do not have (or want to install >100mb complex dependency). |
I'm seeing this issue as well (
https://docs.ansible.com/ansible/latest/dev_guide/developing_locally.html i.e. our structure is:
and this 'just works' with ansible-playbook, but errors as above with ansible-lint. I can workaround this by setting the env variable: |
The linter will not fail if ansible can find the modules, closing as is not an issue but a documented behavior. Please use https://github.com/ansible/ansible-lint/discussions for support. |
I'm sorry but that's not the case here. Ansible finds the module fine, no issues. This is because of the behaviour I quoted. ansible-lint fails, unless you specify that env variable or add This is a valid bug and difference between ansible and ansible-lint. If you want me to put together a minimal test case I can. I did not encounter this on 4.2.0, but did after upgrading to 4.3.4 |
@ssbarnea please find a minimal reproduction of the issue below:
Running
It seems to be an issue with the auto-detection - if I pass in
Just to show that ansible has no issue with this:
Also to note, this error does not occur in v4.2.0, but exists in v4.3.0+ |
Did you really close this issue because "it works in ansible so it must work in this"? I'm sorry but this isn't the case. There are 4 users in this thread that have reported that they are seeing this bug. And I am another one verifying this is the case. Please reopen this and at least recognize that this is a bug. |
bump |
Issue Type
Ansible and Ansible Lint details
brew install ansible
brew install ansible-lint
Desired Behaviour
I have a custom module,
modules/logrotate.py
which is used likeansible.cfg contains
When I run
ansible-lint ansible/playbooks/hosts/configure/agent-tunneller.yml
I expect the modulelogrotate
to not cause an error.Actual Behaviour
What I get instead is
Where it seems that ansible-lint does not detect custom modules.
The text was updated successfully, but these errors were encountered: