Skip to content

papanito/ansible-role-git

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ansbile role "papanito.git"

Ansible Role Ansible Quality Score Ansible Role GitHub issues GitHub pull requests

This role is used for simplified git checkouts. The idea is to provide a list of git repos to clone to a common directory, which can be overridden.

Requirements

Ansible Collection 'kewlfft.aur'

Role Variables

General parameters

These are all variables

Parameter Description Default Value
git_repos Dictionary of git repos, see Parameters for git_repos -
accept_hostkey if yes, ensure that -o StrictHostKeyChecking=no is present as an ssh option. No
install_packages if no git packages are not installed, otherwise you need to run the role with --ask-become-pass Yes

Parameters for git_repos

git_repos are always mounted with type cifs and in state mounted. However there are some options to provide:

Parameter Description Default Value
repo [Mandatory] git, SSH, or HTTP(S) protocol address of the git repository. -
dest Base dir of path of where the repository should be checked out. This parameter is required, unless clone is set to no
The final path where the git checkout happens is {{ dest }}/{{ git_repos.key }}
-
remote Name of the remote. origin
bare if yes, repository will be created as a bare repo, otherwise it will be a standard repo with a workspace. No
clone If no, do not clone the repository even if it does not exist locally Yes
force If yes, any modified files in the working repository will be discarded. Prior to 0.7, this was always 'yes' and could not be disabled. Prior to 1.9, the default was yes No
recursive If no repository will be cloned without the --recursive option, skipping sub-modules. Yes
update If no do not retrieve new revisions from the origin repository Yes
dependencies List of packages (dependencies) to be installer. It suffices if providing the package name. However it supports additional package types if you add a list { name:PACKAGENAME, type:PACKAGETYPE}, whereas PACKAGETYPE can be
  • aur: Archlinux AUR
[]

Examples:

Checkout repo git@github.com:qeeqbox/social-analyzer.git to ~/Workspace/social-analyzer-demo.

  vars:
    git_repos:
      social-analyzer-demo:
        repo: git@github.com:qeeqbox/social-analyzer.git
        dest: ~/Workspace

Checkout two repos to ~/Workspace/social-analyzer and ~/Workspace/airgeddon. In addition som packages are installed (which are required to run the airgeddon script)

  vars:
    git_repos:
      social-analyzer:
        repo: git@github.com:qeeqbox/social-analyzer.git
      airgeddon:
        repo: git@github.com:v1s1t0r1sh3r3/airgeddon.git
        dependencies:
          - { name: crunch, type: aur }
          - aircrack-nge

Dependencies

none

Example Playbook

Run ansible-playbook ./tests/test.yml -i ./tests/inventory -e "install_packages=No"

---
- hosts: localhost
  vars:
    default_workspace: "~/Workspace/demo"
    git_repos:
      social-analyzer:
        repo: git@github.com:qeeqbox/social-analyzer.git

 roles:
    - papanito.git

License

This is Free Software, released under the terms of the Apache v2 license.

Author Information

Written by Papanito - Gitlab / Github

About

This role is used for simplified git checkouts using a list of git repos.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published