Last active
June 30, 2021 03:27
-
-
Save UsmanHaider15/5181cf81601acd147f73ef8ee063c693 to your computer and use it in GitHub Desktop.
Ansible Clone private Repository
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- 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