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-galaxy requires access to "/etc/ansible" even when ansible installed in python virtual environment #3332

Open
dwebr opened this issue Feb 26, 2024 · 1 comment

Comments

@dwebr
Copy link

dwebr commented Feb 26, 2024

Bug Report

SUMMARY

Ansible is not installed on host, so /etc/ansible does not exist.
Ansible is installed in python virtual environment using pip install ansible
Using ansible-galaxy to install collections fails with [Errno 13] Permission denied: '/etc/ansible'
On a previous bastion servers (Redhat7), ansible was installed on the host but never actually used, we always run within a virtual environment. On the new bastion server, ansible was not installed which we didn't think would be a problem since it is not used directly, but found some collections and ansible-galaxy appear to rely on /etc/ansible

STEPS TO REPRODUCE

1.) activate virtual environment
2.) attempt to use ansible-galaxy to install collection

[user@bastion ~]$ source /opt/netadmin/ve/ansible3.11.8/bin/activate
(ansible3.11.8) [user@bastion ~]$
(ansible3.11.8) [user@bastion ~]$ ansible-galaxy collection install f5networks.f5_modules --force
Starting galaxy collection install process
Process install dependency map
[WARNING]: Skipping Galaxy server https://galaxy.ansible.com. Got an unexpected error when getting available versions of collection f5networks.f5_modules: Unknown error when attempting to call Galaxy at
'https://galaxy.ansible.com/api/': [Errno 13] Permission denied: '/etc/ansible'. [Errno 13] Permission denied: '/etc/ansible'
ERROR! Unknown error when attempting to call Galaxy at 'https://galaxy.ansible.com/api/': [Errno 13] Permission denied: '/etc/ansible'. [Errno 13] Permission denied: '/etc/ansible'

EXPECTED RESULTS

I expect the collection to be installed in ~/.ansible/collections

ACTUAL RESULTS

I get the error

ERROR! Unknown error when attempting to call Galaxy at 'https://galaxy.ansible.com/api/': [Errno 13] Permission denied: '/etc/ansible'. [Errno 13] Permission denied: '/etc/ansible'

@dwebr
Copy link
Author

dwebr commented Feb 26, 2024

An update to this ... the /etc/ansible directory did exist, it was not readable by my user. Linux admin, added read permission and galaxy and the f5 modules appear to work. Still why the dependency on /etc/ansible, where is this defined, its not in my ansible.cfg anywhere.

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

1 participant