gpt4 book ai didi

ansible-galaxy 角色失败,错误为 "do not have permission to modify/etc/ansible/roles/"

转载 作者:行者123 更新时间:2023-12-03 23:24:26 27 4
gpt4 key购买 nike

tl;dr = OS X 用户建议如何解决此权限错误?

我在 OS X 10.10.1 上,我最近安装了 Ansible,运行以下命令:

sudo pip install ansible --quiet
sudo pip install ansible --upgrade

我想从一个星系角色开始安装自制软件,然后运行这个角色,但出现以下错误:
$ ansible-galaxy install geerlingguy.homebrew
- downloading role 'homebrew', owned by geerlingguy
- downloading role from https://github.com/geerlingguy/ansible-role-homebrew/archive/1.0.1.tar.gz
- extracting geerlingguy.homebrew to /etc/ansible/roles/geerlingguy.homebrew
- error: you do not have permission to modify files in /etc/ansible/roles/geerlingguy.homebrew
- geerlingguy.homebrew was NOT installed successfully.
- you can use --ignore-errors to skip failed roles.

当我看到 /etc归 root 所有,我在文档中没有看到任何注释说我应该 chmod任何事物。

以供引用:
$ ansible --version
ansible 1.8.2
configured module search path = None

这是预期的还是我的安装有问题?

最佳答案

角色的默认位置是 /etc/ansible/roles (对于版本 <= 2.3。自 v2.4 起,默认位置已更改为 ~/.ansible/roles/an issue has been raised )。您需要指定 --roles-path使用时 ansible-galaxy .这是什么 ansible-galaxy install --help说:

-p ROLES_PATH, --roles-path=ROLES_PATH
The path to the directory containing your roles. The
default is the roles_path configured in your
ansible.cfg file (/etc/ansible/roles if not
configured)

您也可以设置 roles_pathansible.cfg ; see the documentation for details .

关于ansible-galaxy 角色失败,错误为 "do not have permission to modify/etc/ansible/roles/",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27681875/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com