2

I am fairly new to Ansible. I am using a couple of Ansible roles that need some tweaking of specific tasks to work on CentOS 7. What is the best workflow to handle local changes to Ansible-Galaxy roles?

Here are the options I am considering:

  1. Fork the role and make change. Downside is that I would lose the ability to grab dependencies by running Ansible-Galaxy install -r requirements.txt
  2. File an issue with the developer on github. Downside is they may never accept my change or may take several days/weeks.
  3. Make changes locally. Downside is I wont be able to update roles from galaxy without losing my local changes.
m3ta
  • 171
  • 7
  • 1
    For the 1st option, why would you lose the ability to grab the dependencies? – RaviTezu May 02 '16 at 17:57
  • After reading the [documentation](http://docs.ansible.com/ansible/galaxy.html#advanced-control-over-role-requirements-files) for ansible-galaxy command I didn't realize it could be pointed directly at github for dependencies. Problem solved thanks! – m3ta May 02 '16 at 19:01

1 Answers1

1

After reading the documentation for the ansible-galaxy command I realized I could be pointed directly at my github fork and not affect the ability to grab dependencies using Ansible-Galaxy install -r requirements.txt.

Example: Adding a github repo to requirements.yml:

# from GitHub src: https://github.com/bennojoy/nginx

m3ta
  • 171
  • 7
  • Note: even if doing this, make sure to track the upstream PR and switch back to the upstream role—that is, if it's something minor that has a good chance of getting merged. Otherwise you're now the maintainer of everything in that role, but only for your one use case :) – geerlingguy Sep 11 '17 at 16:50