【发布时间】:2020-02-16 18:27:45
【问题描述】:
我已成功配置 Ansible Tower 项目以从远程 git 存储库中提取,并使用 ssh 和存储的凭据(密钥)从本地存储库中提取。在此服务器上,不允许 ssh 登录访问 git,因此我尝试将 Ansible Tower 配置为使用本地 git 存储库;不使用 git: 或 ssh: 协议访问,只需通过 file:///path/to/AnsibleTower.git 访问它
Ansible Tower 项目更新函数尝试“git clone”,但它给出了错误:
"fatal: Could not read from remote repository.",
"Please make sure you have the correct access rights",
"and the repository exists."
它显示这是它用来尝试克隆的命令:
"cmd": "/usr/bin/git clone --origin origin file:///path/to/AnsibleTower.git/ /var/lib/awx/projects/_114__00_test"
当我直接在服务器上执行上述命令时,作为awx 用户,我没有收到任何错误,并且克隆工作正常。当 Tower 尝试更新时,我可以看到 git 命令正在使用 awx 用户执行(监视 ps 的进程)。 awx 用户拥有 AnsibleTower.git 目录及其中的所有内容。
这很重要以及我将其标记为“ansible-inventory”的原因是,使用 SCM 支持的项目似乎是将基于文本的清单导入/同步到 Tower 的唯一方法。我真的很想避免使用 Tower Web 界面重新创建/更新我的库存;我也希望在 SCM 中进行跟踪。
我什至授权所有用户访问 .git 目录(暂时);这也不起作用,这似乎不是用户权限问题。
【问题讨论】:
标签: git ansible ansible-inventory ansible-tower