Skip to content
This repository has been archived by the owner on Dec 19, 2021. It is now read-only.

Use this project as a submodule

hackmastera edited this page Dec 18, 2015 · 1 revision

You may want to keep your own playbooks set of playbooks in a different repository. Or you may need to maintain a hosts file and your own set of group_vars files in a private repo (and/or protected by ansible-vault).

To use this project and its roles with your own playbooks and hosts, try including it as a git submodule. Here's a public example of what that looks like.

Brief walkthrough of setting this up:

  1. Create your repo with your playbooks / hosts file / whatever you like

  2. Add this repo as a git submodule.

    $ git submodule add [email protected]:curationexperts/ansible-hydra.git
    $ cd ansible-hydra/
    $ git checkout desired-commit-hash-or-branch-or-tag
    $ cd ..
    
  3. Create an ansible.cfg containing

    [defaults]
    roles_path = ./ansible-hydra/roles
    

Then if you pull your 'superproject' repo somewhere else:

$ cd [your wrapper repo]
$ git submodule update --init
Clone this wiki locally