Skip to content

Instantly share code, notes, and snippets.

@UsmanHaider15
Last active June 30, 2021 03:27
Show Gist options
  • Save UsmanHaider15/5181cf81601acd147f73ef8ee063c693 to your computer and use it in GitHub Desktop.
Save UsmanHaider15/5181cf81601acd147f73ef8ee063c693 to your computer and use it in GitHub Desktop.
Ansible Clone private Repository
---
- hosts: all
vars:
GIT_REPO: <private-repo-url>
GIT_BRANCH: master
USER: ubuntu
PROJECT_NAME: ansible-clone-repo
gather_facts: no
tasks:
- name: Clone a private repository into {{PROJECT_NAME}} folder.
git:
repo: "{{ GIT_REPO }}"
version: "{{ GIT_BRANCH }}"
dest: "/home/{{ USER }}/{{ PROJECT_NAME }}"
accept_hostkey: yes
become: no
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment