2

I'm having problems instaling plugins with ansible-galaxy.

I've tried 3 things:

Instaling without sudo:

ansible-galaxy install sfromm.epel
[WARNING]: - sfromm.epel was NOT installed successfully: Could not update files in /etc/ansible/roles/sfromm.epel: [Errno 13] Permission denied: '/etc/ansible/roles/sfromm.epel'

Nothing weird here, obviously my user can't write in that folder.


Instaling with sudo su:

$ sudo su
root@notebook# ansible-galaxy install  sfromm.epel 
- ...
- sfromm.epel was installed successfully

As you can see I'm able to install the plugin this way.


Instaling with sudo:

Here is where I don't understand what is happening.

$ sudo ansible-galaxy install  sfromm.epel
[WARNING]: - sfromm.epel was NOT installed successfully: The API server (https://galaxy.ansible.com/api/) is not responding, please try again later

sudo curl https://galaxy.ansible.com/api/ responds OK. I'm not behind a proxy.

Could it be a problem with certificates since the API is https? How can I know where does ansible pick those from?

1

I'm seeing the same thing. I worked around it by setting ansible_roles=~/.ansible/roles in my ~/.ansible.cfg file and installing the roles without the need for sudo. Does installing them in a system-wide even make sense in most cases? Still, it's annoying and worked in previous versions of ansible (I'm using 2.1.0.0).

| improve this answer | |
  • Had to use roles_path in the config file. – Federico Nafria Jan 20 '17 at 23:09
0

As of 2.1.10, ansible-galaxy masked error messages connecting to the api server and returned a generic 'server must be down' error. This has been fixed at https://github.com/ansible/ansible/issues/16039 and as of this moment is part of their 2.2 milestone (so presumably it will be released with ansible 2.2).

I had an identical problems as your 'Instaling with sudo' section, and it was due to a badly-formed ~/.netrc file in my user's home directory (which the github PR specifically addresses). I was able to fix the file and re-run ansible-galaxy and it correctly installed the desired roles.

Something is causing this function to raise an unhandled exception here, perhaps a read through the code would be helpful.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.