You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When ansible-lint and ansible-compat 25.1.1 are present in a virtual env and this venv is not writable by the user running ansible-lint, the linter fails with a "[Errno 13] Permission denied" error it runs galaxy.
Issue Type
Bug Report
STEPS TO REPRODUCE
# Setup venv containing current lint and compatpython3 -m venv venv25venv25/bin/pip install ansible-lint
# Remove write permission all throughout the venvchmod -R -w venv25
# Verify versions
$ /tmp/venv25/bin/ansible-lint --versionWARNING: PATH altered to include /tmp/venv25/bin, /tmp/venv25/bin :: This is usually a sign of broken local setup, which can cause unexpected behaviors.ansible-lint 25.1.1 using ansible-core:2.18.2 ansible-compat:25.1.1 ruamel-yaml:0.18.10 ruamel-yaml-clib:None
# Try to lint a play that has a requirements.yml
$ /tmp/venv25/bin/ansible-lint -vWARNING: PATH altered to include /tmp/venv25/bin, /tmp/venv25/bin :: This is usually a sign of broken local setup, which can cause unexpected behaviors.INFO Identified /home/charly/eclipseprojects/hilt_playground as project root due .git directory.INFO Collection paths was patch to include extra directories /tmp/venv25/lib/python3.13/site-packages,/tmp/venv25/local/lib/python3.13/dist-packages,/tmp/venv25/lib/python3/dist-packages,/tmp/venv25/lib/python3.13/dist-packages,/home/charly/eclipseprojects/hilt_playground/collectionsINFO Set ANSIBLE_LIBRARY=/home/charly/eclipseprojects/hilt_playground/.ansible/modules:/home/charly/.ansible/plugins/modules:/usr/share/ansible/plugins/modulesINFO Set ANSIBLE_COLLECTIONS_PATH=/home/charly/eclipseprojects/hilt_playground/.ansible/collections:/tmp/venv25/lib/python3.13/site-packages:/tmp/venv25/local/lib/python3.13/dist-packages:/tmp/venv25/lib/python3/dist-packages:/tmp/venv25/lib/python3.13/dist-packages:/home/charly/eclipseprojects/hilt_playground/collectionsINFO Set ANSIBLE_ROLES_PATH=/home/charly/eclipseprojects/hilt_playground/.ansible/roles:roles:/home/charly/eclipseprojects/hilt_playground/external_rolesINFO Running ansible-galaxy role install -r /home/charly/eclipseprojects/hilt_playground/requirements.yml -v --roles-path /home/charly/eclipseprojects/hilt_playground/.ansible/rolesINFO Running ansible-galaxy collection install -v -r /home/charly/eclipseprojects/hilt_playground/requirements.ymlERROR Using /home/charly/eclipseprojects/hilt_playground/ansible.cfg as config fileERROR! Unexpected Exception, this is probably a bug: [Errno 13] Permission denied: b'/tmp/venv25/lib/python3.13/site-packages/ansible_collections'Got 250 exit code while running: ansible-galaxy collection install -v -r /home/charly/eclipseprojects/hilt_playground/requirements.yml
Desired Behavior
Lint should pass, at is does when Lint 24.12.2 / Compat 24.x are used in the same setup:
# Setup venv containing current lint 24.12.2 and compat 24.xpython3 -m venv venv24venv24/bin/pip install ansible-lint==24.12.2 "ansible-compat<25"
# Remove write permission all throughout the venvchmod -R -w venv24
# Verify versions
$ /tmp/venv24/bin/ansible-lint --vWARNING: PATH altered to include /tmp/venv24/bin, /tmp/venv24/bin :: This is usually a sign of broken local setup, which can cause unexpected behaviors.ansible-lint 24.12.2 using ansible-core:2.18.2 ansible-compat:24.10.0 ruamel-yaml:0.18.10 ruamel-yaml-clib:NoneA new release of ansible-lint is available: 24.12.2 → 25.1.1[/] Upgrade by running: pip install --upgrade ansible-lint
# Lint a play
$ /tmp/venv24/bin/ansible-lint -vWARNING: PATH altered to include /tmp/venv24/bin, /tmp/venv24/bin :: This is usually a sign of broken local setup, which can cause unexpected behaviors.INFO Identified /home/charly/eclipseprojects/hilt_playground as project root due .git directory.INFO Set ANSIBLE_LIBRARY=/home/charly/.cache/ansible-compat/0a80eb/modules:/home/charly/.ansible/plugins/modules:/usr/share/ansible/plugins/modulesINFO Set ANSIBLE_ROLES_PATH=/home/charly/.cache/ansible-compat/0a80eb/roles:roles:/home/charly/eclipseprojects/hilt_playground/external_rolesINFO Running ansible-galaxy role install -r /home/charly/eclipseprojects/hilt_playground/requirements.yml -v --roles-path /home/charly/.cache/ansible-compat/0a80eb/rolesINFO Running ansible-galaxy collection install -v -r /home/charly/eclipseprojects/hilt_playground/requirements.yml...
# Rule Violation Summary 1 syntax-check profile:min tags:core,unskippable 4 syntax-check profile:min tags:core,unskippable...Failed: 2542 failure(s), 0 warning(s) on 879 files.A new release of ansible-lint is available: 24.12.2 → 25.1.1[/] Upgrade by running: pip install --upgrade ansible-lint
Actual Behavior
ERROR! Unexpected Exception, this is probably a bug: [Errno 13] Permission denied: b'/tmp/venv25/lib/python3.13/site-packages/ansible_collections'
Got 250 exit code while running: ansible-galaxy collection install -v -r /home/charly/eclipseprojects/hilt_playground/requirements.yml
The text was updated successfully, but these errors were encountered:
When I invoke ansible-galaxy standalone it uses collections_path and roles_path from the plays ansible.cfg to determine where to install roles/collections. Any particular reason, why these parameters are not used in the context of ansible-lint?
Summary
When
ansible-lint
andansible-compat
25.1.1 are present in a virtual env and this venv is not writable by the user running ansible-lint, the linter fails with a "[Errno 13] Permission denied" error it runs galaxy.Issue Type
STEPS TO REPRODUCE
Desired Behavior
Lint should pass, at is does when Lint 24.12.2 / Compat 24.x are used in the same setup:
Actual Behavior
The text was updated successfully, but these errors were encountered: