# git ls-remote fails

**URL:** <https://forum.ansible.com/t/git-ls-remote-fails/16613>\
**Category:** Ansible Project\
**Created:** [October 26, 2014, 6:43pm UTC](https://forum.ansible.com/t/git-ls-remote-fails/16613 "2014-10-26T18:43:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sam4](https://avatars.discourse-cdn.com/v4/letter/s/b5e925/32.png) [@sam4](https://forum.ansible.com/u/sam4)\
**Post date:** [October 26, 2014, 6:43pm UTC](https://forum.ansible.com/t/git-ls-remote-fails/16613/1 "2014-10-26T18:43:27Z")

</div>

i can’t clone a remote repo:

failed: [IP\_ADDRESS\_REMOVED] =\> {“cmd”: “/usr/bin/git ls-remote [git@bitbucket.org](mailto:git@bitbucket.org):REMOVED/REMOVED.git -h refs/heads/HEAD”, “failed”: true, “rc”: 128}  
stderr: Permission denied (publickey).

i have this in my ansible.cfg:

[defaults]  
transport= ssh

[ssh\_connectin]  
ssh\_args = -o ForwardAgent=yes

not sure what to do at this point, i could use some help

---

<div class="post-metadata">

**Author:** ![Toshio\_Kuratomi](https://avatars.discourse-cdn.com/v4/letter/t/41988e/32.png) [@Toshio\_Kuratomi](https://forum.ansible.com/u/Toshio_Kuratomi)\
**Post date:** [October 28, 2014, 4:33am UTC](https://forum.ansible.com/t/git-ls-remote-fails/16613/2 "2014-10-28T04:33:44Z")

</div>

Some things to try:

If you cut and pasted the ansible.cfg section, the spelling of the  
section header is incorrect:

s/ssh\_connectin/ssh\_connection/

Check that you don't have an old control socket lying around in  
~/.ansible/cp/ between fixing that problem or otherwise updating your  
ssh connection parameters and trying again.

Invoke ansible with the -vvvv flag to see what options are making it  
to the invocation of ssh.

I created a github repo and tried this just now. I moved my existing  
.ssh/config out of the way first and then created an ansible.cfg with  
the misspelled section header. Running:

ansible rhel7 -m git -a 'repo=git@bitbucket.org:toshio/local-playbooks  
dest=/var/tmp/plays'

Replicated your symptoms.

Fixing the section header and then making sure there was no control  
socket still laying around in ~/.ansible/cp/ I then ran the above  
ansible command and it was successful

-Toshio
