I have an ansible playbook that autoamtes my git usage. I am able to clone and update my repos using it. I've also used ssh forwarding and it is working perfectly fine.
My playbook:
- hosts: webservers
sudo: yes
remote_user: ubuntu
tasks:
- name: Test that git ssh connection is working.
command: ssh -T git@github.com
My ssh forwarding is working fine as I'm able to ssh into my server but when I try doing the same thing by executing the playbook, it gives me the following error:
failed: [xxx.xxxxx.com] => {"changed": true, "cmd": ["ssh", "-T", "git@github.com"], "delta": "0:00:00.585651", "end": "2014-06-09 14:11:37.410907", "rc": 255, "start": "2014-06-09 14:11:36.825426"}
stderr: Permission denied (publickey).
What's the issue?