I’m having trouble using Ansible to clone a private repo on github on a remote node using a deploy key for authentication. Ultimately I want to move the private key over the to the remote node, add the location of the key to the .ssh/config file, and then use the Ansible git module to pull or clone a repo. When I attempt to use the git module I get a “permission denied” error. I’ve included the relevant portions of the code below. Can someone give me some insights how how I should be handling this problem?
Thanks!
Tasks:
name: make deploy key directory
action: command mkdir deploy_keys
name: moving $project_key to deploy_keys
action: copy src=/deploy_keys/$project’_rsa’ dest=/home/$user/deploy_keys/$project’_rsa’
Hi Chris, not sure I have much insight, but some ideas, included below:
I'm having trouble using Ansible to clone a private repo on github on a
remote node using a deploy key for authentication. Ultimately I want to move
the private key over the to the remote node, add the location of the key to
the .ssh/config file, and then use the Ansible git module to pull or clone a
repo. When I attempt to use the git module I get a "permission denied"
error. I've included the relevant portions of the code below. Can someone
give me some insights how how I should be handling this problem?
Tasks:
- name: make deploy key directory
action: command mkdir deploy_keys
You probably want to have a "creates=deploy_keys" added to your
command action above or use the file module like so: