[Errno 13] Permission denied: '/etc/ansible/collections' while installing ansible-galaxy collection on Satellite 6.10.

Solution Verified - Updated -

Issue

  • Below error while installing ansible-galaxy collection using foreman-proxy user:
# su - foreman-proxy -s /bin/bash -c "ansible-galaxy collection install community.general"
ansible-galaxy 2.9.27
  config file = /usr/share/foreman-proxy/.ansible.cfg
  configured module search path = [u'/usr/share/foreman-proxy/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /bin/ansible-galaxy
  python version = 2.7.5 (default, Aug 13 2020, 02:51:10) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]
Using /usr/share/foreman-proxy/.ansible.cfg as config file
ERROR! Unexpected Exception, this is probably a bug: [Errno 13] Permission denied: '/etc/ansible/collections'
the full traceback was:

Traceback (most recent call last):
  File "/bin/ansible-galaxy", line 123, in <module>
    exit_code = cli.run()
  File "/usr/lib/python2.7/site-packages/ansible/cli/galaxy.py", line 374, in run
    context.CLIARGS['func']()
  File "/usr/lib/python2.7/site-packages/ansible/cli/galaxy.py", line 847, in execute_install
    os.makedirs(b_output_path)
  File "/usr/lib64/python2.7/os.py", line 150, in makedirs
    makedirs(head, mode)
  File "/usr/lib64/python2.7/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/etc/ansible/collections'

Environment

  • Satellite 6.10

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content