【发布时间】:2017-05-09 16:20:36
【问题描述】:
您好,我正在尝试从 vsts git 存储库 (ssh://********/_git/ClouderaAutomation) 克隆,但是当我尝试时,ansible 似乎只是挂起。下面是正在使用的 git 模块的 sn-p。
name: Clone git repo.
git:
repo: "{{ repoToClone }}"
dest: "/home/vagrant/ClouderaAutomation"
accept_hostkey: yes
clone: yes
become: yes
repoToClone 是 ssh://********/_git/ClouderaAutomation。当我直接在远程服务器上执行 'git clone' cmd 时,它会毫无问题地克隆存储库。但是,当我尝试通过 ansible 进行克隆时,它只是挂起而没有错误,这是 -vvv 日志的最后一行:
SSH:EXEC sshpass -d15 ssh -C -o ControlMaster=auto -o ControlPersist=60s -o ConnectTimeout=10 -o ControlPath=/home/vagrant/.ansible/cp/9a3517bddd -tt 192.168 .33.30 '/bin/sh -c '"'"'sudo -H -S -n -u root /bin/sh -c '"'"'"'"'"'"'"'"'echo 成为-成功-lugffujkolhidvafudbyhootlistpyyf; /usr/bin/python /home/vagrant/.ansible/tmp/ansible-tmp-1494346256.28-165153189526831/git.py; rm -rf "/home/vagrant/.ansible/tmp/ansible-tmp-1494346256.28-165153189526831/" > /dev/null 2>&1'"'"'"'"'"'"'"'"' && sleep 0'"'"''
【问题讨论】:
-
这是 ansible 的唯一问题吗?您可以使用哪个用户在远程机器上手动克隆?
-
是的,这是我目前在使用 Ansible 时面临的唯一问题。例如,如果我尝试使用相同的 ansible 模块克隆“github.com/Microsoft/PowerBI-JavaScript.git”,它会成功完成。我手动使用 vagrant 用户。
标签: git ansible azure-pipelines azure-pipelines-release-pipeline