"I'm trying to use SSH forwarding to clone some private repos from github using Ansible on a Vagrant instance but it fails"
Would it be possible to put your private key on the development machine, since it's local to you anyway? You could then use the key_file parameter and save yourself the trouble. Unfortunately I don't know a lot about Vagrant but a lot of people get confused by the provisioner when trying to do fancy things with it, and the extra level of SSH involved may be hiccuping things. http://docs.ansible.com/git_module.html On Fri, Oct 24, 2014 at 5:30 AM, Navid Paya <[email protected]> wrote: > 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. > > Vagrantfile <http://pastebin.com/mQAyggGi#> > > local.yml <http://pastebin.com/qeuY3qR4> > > nodes.yml <http://pastebin.com/vhS65c8X> > > 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. > > -- > You received this message because you are subscribed to the Google Groups > "Ansible Project" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/758a4c05-ea52-4cf0-9be1-4920fd24a378%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/758a4c05-ea52-4cf0-9be1-4920fd24a378%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgxuo%2BZ%3Dd4KF_8ncfmsasEW61X18hctmHVcPi%2BHm-LfVXA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
