Skip to content

Instantly share code, notes, and snippets.

@rey
Created November 5, 2015 12:06
Show Gist options
  • Save rey/f21ddec2e0d6f581170b to your computer and use it in GitHub Desktop.
Save rey/f21ddec2e0d6f581170b to your computer and use it in GitHub Desktop.
git clone for private repo using Ansible
- hosts: node1
sudo: yes
tasks:
- name: copy ssh key
copy: src=/Users/vinta/.ssh/your_project_deploy_key
dest=/home/ubuntu/.ssh/your_project_deploy_key
mode=0400
- name: git clone
git: repo=git@github.com:your/project.git
dest=/home/ubuntu/your_project
key_file=/home/ubuntu/.ssh/your_project_deploy_key
accept_hostkey=yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment