Hi all
I’m trying to use SSH forwarding to clone some private repos from github using Ansible on a Vagrant instance but it fails. Here are the involved artifacts. I’ve read pretty much all the related Google searches but can’t figure out what’s wrong after a couple of days.
Any this is the log I get when running the playbook.
<127.0.0.1> ESTABLISH CONNECTION FOR USER: vagrant
<127.0.0.1> REMOTE_MODULE git repo=ssh:@github.com:myteksi/dispatcher-API.git accept_hostkey=yes dest=/tmp/-API
<127.0.0.1> EXEC [‘ssh’, ‘-C’, ‘-tt’, ‘-vvv’, ‘-o’, ‘ForwardAgent=yes’, ‘-o’, ‘ControlMaster=auto’, ‘-o’, ‘ControlPersist=60s’, ‘-o’, ‘ControlPath=/Users/navid/.ansible/cp/ansible-ssh-%h-%p-%r’, ‘-o’, ‘StrictHostKeyChecking=no’, ‘-o’, ‘Port=2222’, ‘-o’, ‘IdentityFile=“/Users/navid/.vagrant.d/insecure_private_key”’, ‘-o’, ‘KbdInteractiveAuthentication=no’, ‘-o’, ‘PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey’, ‘-o’, ‘PasswordAuthentication=no’, ‘-o’, ‘User=vagrant’, ‘-o’, ‘ConnectTimeout=10’, ‘127.0.0.1’, “/bin/sh -c ‘mkdir -p $HOME/.ansible/tmp/ansible-tmp-1414142060.76-115960370897689 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1414142060.76-115960370897689 && echo $HOME/.ansible/tmp/ansible-tmp-1414142060.76-115960370897689’”]
<127.0.0.1> PUT /var/folders/5y/f05p3ryx575fjvsrmrv2w1100000gn/T/tmpnk8Suv TO /home/vagrant/.ansible/tmp/ansible-tmp-1414142060.76-115960370897689/git
<127.0.0.1> EXEC [‘ssh’, ‘-C’, ‘-tt’, ‘-vvv’, ‘-o’, ‘ForwardAgent=yes’, ‘-o’, ‘ControlMaster=auto’, ‘-o’, ‘ControlPersist=60s’, ‘-o’, ‘ControlPath=/Users/navid/.ansible/cp/ansible-ssh-%h-%p-%r’, ‘-o’, ‘StrictHostKeyChecking=no’, ‘-o’, ‘Port=2222’, ‘-o’, ‘IdentityFile=“/Users/navid/.vagrant.d/insecure_private_key”’, ‘-o’, ‘KbdInteractiveAuthentication=no’, ‘-o’, ‘PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey’, ‘-o’, ‘PasswordAuthentication=no’, ‘-o’, ‘User=vagrant’, ‘-o’, ‘ConnectTimeout=10’, ‘127.0.0.1’, u"/bin/sh -c ‘LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 /usr/bin/python /home/vagrant/.ansible/tmp/ansible-tmp-1414142060.76-115960370897689/git; rm -rf /home/vagrant/.ansible/tmp/ansible-tmp-1414142060.76-115960370897689/ >/dev/null 2>&1’"]
failed: [default] => (item=-API) => {“cmd”: "/usr/bin/git ls-remote ssh:", “failed”: true, “item”: “-API”, “rc”: 128}
stderr: ERROR: Repository not found.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
msg: ERROR: Repository not found.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Now if I do a “vagrant ssh” and then do “ssh-add -L”, I can see the key is forwarded and I can clone the same repo just fine. The log doesn’t look like I’m doing sudo for that task as well, although I added this to my shudders file to test that as well:
Defaults env_keep += “SSH_AUTH_SOCK”
Any help is appreciated.