I am working on an ansible playbook for our infrastructure. I have the following recurring need for which I have yet to find a recommended pattern:
I have a server that needs to run multiple vhosts (/databases/rbenv environment/etc). I can install nginx (postgres/rbenv/etc) with a dependency on a role from galaxy, i. e.
dependencies:
- role: "geerlingguy.nginx"
nginx_ppa_use: true
nginx_ppa_version: development
..
Now I could add an array of vhost configurations to this dependency. However, I'd like to bundle these definitions not by technology (nginx/rbenv...) but by project.
The best path I have found so far is to repeat the nginx dependency in each project role. But that results in the duplication of all the global nginx options and repeated execution of the nginx installation when provisioning a fresh server.