Estou tentando configurar uma tarefa que clona um repo em uma caixa vagabunda. Eu configurei o encaminhamento do agente corretamente, adicionei o servidor de repo em ~ / .ssh / known_hosts, e validei que posso fazer login como usuário vago e clonar o repo sem precisar de credenciais e a chave do host não está marcada (o git clone é executado sem engate).
Minha tarefa está configurada da seguinte forma:
- name: Check out pname dev branch
git: repo=ssh://[email protected]:dev-team/pname.git
dest=/home/vagrant/pname
version=dev
accept_hostkey=yes
become: yes
become_user: vagrant
Minha tarefa apenas trava, verbose definida como -vvvv fornece a seguinte saída:
<10.210.55.82> ESTABLISH CONNECTION FOR USER: vagrant
<10.210.55.82> REMOTE_MODULE git repo=ssh:********@dev-web.ca:dev-team/project.git dest=/home/vagrant/project_folder version=dev accept_hostkey=yes
<10.210.55.82> EXEC ssh -C -tt -vvv -o UserKnownHostsFile=/dev/null -o IdentitiesOnly=yes -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s -o ControlPath="/Users/stef/.ansible/cp/ansible-ssh-%h-%p-%r" -o StrictHostKeyChecking=no -o Port=22 -o IdentityFile="/Users/stef/devbox_cp/.vagrant/machines/default/parallels/private_key" -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=vagrant -o ConnectTimeout=30 10.210.55.82 /bin/sh -c 'mkdir -p /tmp/ansible-tmp-1449685034.66-224282565675976 && chmod a+rx /tmp/ansible-tmp-1449685034.66-224282565675976 && echo /tmp/ansible-tmp-1449685034.66-224282565675976'
<10.210.55.82> PUT /var/folders/q1/21hlrxsd4y1_hr8n5kx4cq540000gn/T/tmp8KpkMe TO /tmp/ansible-tmp-1449685034.66-224282565675976/git
<10.210.55.82> EXEC ssh -C -tt -vvv -o UserKnownHostsFile=/dev/null -o IdentitiesOnly=yes -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s -o ControlPath="/Users/stef/.ansible/cp/ansible-ssh-%h-%p-%r" -o StrictHostKeyChecking=no -o Port=22 -o IdentityFile="/Users/stef/devbox_cp/.vagrant/machines/default/parallels/private_key" -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=vagrant -o ConnectTimeout=30 10.210.55.82 /bin/sh -c 'chmod a+r /tmp/ansible-tmp-1449685034.66-224282565675976/git'
<10.210.55.82> EXEC ssh -C -tt -vvv -o UserKnownHostsFile=/dev/null -o IdentitiesOnly=yes -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s -o ControlPath="/Users/stef/.ansible/cp/ansible-ssh-%h-%p-%r" -o StrictHostKeyChecking=no -o Port=22 -o IdentityFile="/Users/stef/devbox_cp/.vagrant/machines/default/parallels/private_key" -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=vagrant -o ConnectTimeout=30 10.211.55.82 /bin/sh -c 'sudo -k && sudo -H -S -p "[sudo via ansible, key=fhtkrnevvknmiinzxxqzrvyofblvkzhi] password: " -u vagrant /bin/sh -c '"'"'echo BECOME-SUCCESS-fhtkrnevvknmiinzxxqzrvyofblvkzhi; LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 /usr/bin/python /tmp/ansible-tmp-1449685034.66-224282565675976/git'"'"''
Existe uma maneira de descobrir o que está atrasando a tarefa do git clone?
Atualização:
A execução da tarefa a seguir funciona conforme o esperado:
- name: Clone project dev branch
shell: git clone [email protected]:dev-team/project.git /home/vagrant/www/project
sudo: false
args:
creates: /home/vagrant/www/project
Enquanto o seguinte, usando o manipulador de tarefas nativo git, falha (não trava mais):
# This task does not work!
- name: Check out project dev branch
git: repo=ssh://[email protected]:dev-team/project.git
dest=/home/vagrant/www/project
accept_hostkey=yes
force=yes
sudo: false
Este é o erro mostrado:
failed: [default] => {"cmd": "/usr/bin/git ls-remote 'ssh:********@gitlab.cgi-web.ca:dev-team/project.git' -h refs/heads/HEAD", "failed": true, "rc": 128}
stderr: GitLab: The project you were looking for could not be found.
fatal: Could not read from remote repository.
Por que a tarefa do shell funcionaria, em contraste com a tarefa nativa do git?