Description
The Ansible content organization documentation only talks about a single project with multiple staging environments.
That is great and all, but I need to manage many projects that will be reusing a lot of the same Ansible roles. Should I build a single roles directory and have all of the project specific playbooks point at a "shared" roles directory. Or should each project have a dedicated roles directory containing only the roles related to the project. Below are some of the pros and cons I have thought of for both:
Shared roles directory
Pros:
- All roles are in one single location.
- For roles that are shared across multiple projects, the role version upgrade will be applied to all projects that depends on it.
Cons:
- For roles that are shared across multiple projects, a role version change will need to be tested in every project, even if it is not the project you are working on.
Dedicated roles directory
Pros:
- It is clear what roles are needed to run a specific project.
- A role version upgrade can be applied to specific projects that require the upgrade.
Cons:
- Common roles are copied/cloned many times. However, using
ansible-galaxy
withrequirements.yml
file will handle the managment of roles and role dependencies for us.
Question
Has anyone had success with either of this organization strategies?