I am trying to execute a git clone command in my Ansible playbook. It looks like this:
- name: a play that runs entirely on the ansible host
hosts: 127.0.0.1
connection: local
tasks:
- name: check out a git repository
git: repo={{ repo_url }} dest=/Dest/For/Cloning/ accept_hostkey=yes
vars:
repo_url: git@github.com:lorin/mezzanine-example.git
And, my cfg file looks like this:
[defaults]
transport = ssh
[ssh_connection]
ssh_args= -A
However, when I'm running the command: ansible-playbook -i "localhost," -c local GitClone.yaml
, I get the Permission denied (publickey)
error.
I want to clone a gh repo to my local[specified file path].