git ls-remote fails

i can’t clone a remote repo:

failed: [IP_ADDRESS_REMOVED] => {“cmd”: “/usr/bin/git ls-remote 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

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