【发布时间】:2017-03-25 11:49:06
【问题描述】:
我在ansible.cfg中有如下配置
sudo_flags = -H -S -n
[ssh_connection]
ssh_args = -C -o ControlMaster=auto -o ControlPersist=60s -o ForwardAgent=yes
- name: Fetch code from git repo
git: repo={{repo_url}}
dest={{ proj_path }}
version={{ repo_version }}
accept_hostkey=yes
force=true
请记住,在此之前我也有以 sudo 运行的相同任务
错误信息是:
Warning: Permanently added the RSA host key for IP address '2401:1d80:1010::150' to the list of known hosts.\r\nPermission denied (publickey).\r\nfatal: Could not read from remote repository.\n\nPlease make sure you have the correct access rights\nand the repository exists.", "rc": 128, "stderr": "Warning: Permanently added the RSA host key for IP address '2401:1d80:1010::150' to the list of known hosts.\r\nPermission denied (publickey).\r\nfatal: Could not read from remote repository.\n\nPlease make sure you have the correct access rights\nand the repository exists.\n", "stdout": "", "stdout_lines": []}
【问题讨论】:
-
您是否尝试删除要克隆的主机上的密钥。似乎在 ~/.ssh/known_hosts 和 ~/.ssh/authrozed_keys 中有一个错误的密钥
标签: git bitbucket ansible-playbook ssh-agent