大网数据广告活动
服务器运维问答

Ansible-galaxy not working with sudo

· 52CE 我爱测

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/a…

问题原文

原帖链接 · Federico Nafria · CC BY-SA 3.0

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?

已采纳解答

原帖链接 · David · CC BY-SA 3.0

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).

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-05-16)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。