Skip to content

Instantly share code, notes, and snippets.

@steenzout
Last active August 29, 2015 14:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steenzout/a69b6e7fcd00106a11ca to your computer and use it in GitHub Desktop.
Save steenzout/a69b6e7fcd00106a11ca to your computer and use it in GitHub Desktop.
Poor man's Ansible role update

Creative Commons License
"Poor man's Ansible role update" by Pedro Salgado is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.


  1. create a requirements.yml file

    - src: git+ssh://git@host:port/repo/myrole.git
      version: v1.0.0-1  # git tag that you want to download
      name: myrole
      scm: git
    
  2. to be able to install and update the roles use the following bash script

    #!/bin/bash
    # update-roles.sh
    grep 'name:' requirements.yml | awk -F: '{print $2}' | xargs -I {} ansible-galaxy remove {}
    ansible-galaxy install -r requirements.yml
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment