GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Praveen492/ansible-git-clone

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

7 Commits
7 Commits

Folders and files

NameName
Last commit message
Last commit date
defaults
defaults
 
 
handlers
handlers
 
 
meta
meta
 
 
tasks
tasks
 
 
tests
tests
 
 
vars
vars
 
 
README.md
README.md
 
 

Repository files navigation

Clone Private Git Repository

An Ansible role that can be used to clone a private GitHub repository.

Requirements

  • This role requires a GitHub personal access token. Generate a new token (Settings -> Developer Settings -> Personal Acess Token). Make sure the token has the scopes outlined in the "Role Variables" section below.

  • Create a password file that will be used to encrypt the GitHub personal access token

    echo "<your-passphrase>" | openssl aes-256-cbc -a -salt > /path/to/password/file

  • In order to let Ansible know where to look for the password file, you have two options:

    1. In the ansible.cfg file, add the line: vault_password_file = /path/to/password/file under [defaults]

    2. Create an environment variable: ANSIBLE_VAULT_PASSWORD_FILE=/path/to/password/file

  • Encrypt the token by running the following command

    ansible-vault encrypt_string '<token>' --name 'GITHUB_ACCESS_TOKEN' --vault-password-file=/path/to/password/file

  • Copy the generated encrypted string and paste it in the vars/main.yml file

Role Variables

  • KEY_TITLE: The title of the SSH key to be added to the GitHub account
  • KEY_PATH: Full path of the directory where the SSH key should be stored. A typical location would be ~/.ssh/<key_name>
  • GITHUB_ACCESS_TOKEN: The personal access token associated with the GitHub account being used. The token should have the following scopes:
    • repo
    • admin:public_key
    • user
    • admin:gpg_ley
  • GIT_REPO: The SSH url of the GitHub repository to be cloned. An example would be ssh://[email protected]/IBMZSoftware/nazare-demo-imsapp.git
  • CLONE_DEST: The folder where repository should be cloned to
  • KNOWN_HOSTS_PATH: Location of the SSH known_hosts file on the target machine. A typical location would be ~/.ssh/known_hosts
  • GIT_EXECUTABLE: The location of the git binary on the target machine. For example /usr/bin/git

Example Playbook

- hosts: servers
  roles:
     - git-clone

License

BSD

Author Information

Author: Asif Mahmud

Email: [email protected]

About

No description, website, or topics provided.

Resources

Readme
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.