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
[5.0] dependencies roles step not found by ansible-lint #1387
Comments
@juju4 I found two bugs inside the linter while testing you repository and I am fixing them now. Still, the error you mention is more of a misconfiguration. In order to pass linting, you much assure that all external dependencies are either mentioned inside root level |
Thanks @ssbarnea |
Fixed on master branch. |
Try v5.0.2 it should work fine. |
Thank you for ansible-lint! To me this bug still stands for me on ansible-lint 5.0.2: See a running test, with latest ansible-lint(5.0.2): systemli/ansible-role-etherpad@8244088, see failing github action: https://github.com/systemli/ansible-role-etherpad/actions/runs/611440375 With ansible-lint==4.3.7 it's working fine: https://github.com/systemli/ansible-role-etherpad/actions/runs/611447370 |
I agree with @xshadow. This bug seems still present in ansible@3877c65427e9:~$ ansible-lint --version
ansible-lint 5.0.4 using ansible 2.10.7
(...)
INFO Running default > dependency
Molecule default > dependency
Starting galaxy role install process
- extracting openshift_project to /home/ansible/.cache/molecule/k8s_thanos/default/roles/openshift_project
- openshift_project (v1) was installed successfully
INFO Dependency completed successfully.
WARNING Skipping, missing the requirements file.
INFO Running default > lint
Molecule default > lint
COMMAND: set -e
ansible-lint
WARNING Listing 2 violation(s) that are fatal
internal-error: the role 'openshift_project' was not found in /builds/kafka/ansible/k8s_thanos/molecule/default/roles:/home/ansible/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:/builds/kafka/ansible/k8s_thanos/roles:/builds/kafka/ansible/k8s_thanos/molecule/default /reopen |
The bug is not really in the linter but more in molecule. I started to work on it today and I hope to have a fix ready by monday. That will assure that dependency install is consistent between both tools. If you have specific public repos which you want me to test with, post a link here. |
@ssbarnea That sounds good! Sadly all our code is not available to the general public. But it seems to be a quite general bug. As long as the molecule scenario has a dependency on an collection (expressed in a requirements.yml file inside the scenario), it currently fails. I think you are right about the cause of the bug: molecule and ansibile-lint should be consistent in the role/collection dependency install location. |
@ssbarnea Some additional info: I get the same/similar problem when running ansible-lint from within a pretty standard Ansible role directory:
Running
ansible@96e132b6a8e2:~$ ansible --version
ansible 2.10.7
config file = None
configured module search path = ['/home/ansible/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/lib/python3.9/site-packages/ansible
executable location = /usr/local/bin/ansible
python version = 3.9.2 (default, Mar 12 2021, 18:54:15) [GCC 8.3.0]
ansible@96e132b6a8e2:~$ ansible-lint --version
ansible-lint 5.0.4 using ansible 2.10.7 |
@ssbarnea Any updates on this? Still failing with the latest versions of ansible-lint (5.0.6) and molecule (3.3.0). It is really a blocking issue for us! Please let me know if there is anything I can do to get this fixed as soon as possible. 😅 |
There is a PR with WIP, but I am afraid i run out of time and energy to fix all bugs myself. Unless someone proposed a fix that is passing all the tests (maybe build on top of my partial work), you will have to wait until I find some free time. Or you can stick to old linter if you want to use short role names (without namespace), or fully migrate to FQRN and use v5. |
Yes |
I just had the same issue with the latest version. It was complaining about a test role dependency in molecule's A bit inconsistent behavior, but at least there was a way around it. |
Summary
Inside molecule test, dependency role is installed through dependency step.
I found that after 5.0, ansible-lint does not search the dependency step target PATH (in github action: /home/runner/.cache/molecule/juju4.falco/default/roles) vs its own list (ansible.legacy:/home/runner/work/ansible-falco/ansible-falco/juju4.falco/molecule/default/roles:/home/runner/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:/home/runner/work/ansible-falco/ansible-falco:/home/runner/work/ansible-falco/ansible-falco/juju4.falco/molecule/default)
Example
https://github.com/juju4/ansible-falco/runs/1942507643?check_suite_focus=true#step:5:309
Issue Type
Ansible and Ansible Lint details
OS / ENVIRONMENT
Ubuntu 18.04 from github action for host
STEPS TO REPRODUCE
Example below on my falco ansible role.
Desired Behaviour
roles path of molecule dependency and molecule lint should be common or at least partially shared to avoid duplicates or symlink.
Actual Behaviour
per above
The text was updated successfully, but these errors were encountered: