Re: [ansible-project] Reusing roles with different configuration files

2014-05-11 Thread Strahinja Kustudić
When I think about it, I would probably go with something like that with the combination what Maciej suggested. On Sunday, May 11, 2014 3:02:27 PM UTC+2, Brian Coca wrote: > > You can add the multiple config files to the role and chose the correct > one based on a single parameter > > Brian Coca

Re: [ansible-project] Reusing roles with different configuration files

2014-05-11 Thread Brian Coca
You can add the multiple config files to the role and chose the correct one based on a single parameter Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an emai

Re: [ansible-project] Reusing roles with different configuration files

2014-05-11 Thread Strahinja Kustudić
Thanks for the suggestions how to solve this problem. Maciej's solution is great, since you don't have to modify a role nor create a new one, you just pass different variables and you are good to go, but the problem I have with that solution is that it makes it harder to read what you configure

Re: [ansible-project] Reusing roles with different configuration files

2014-05-09 Thread Michael DeHaan
" I think the most elegant way to handle this is to add a new keyword in the role dependency statement that would allow to override templates and files on a "common" role by another role that depends on it." Adding a new keyword is almost never the answer. It sounds like the OP just needs to pas

Re: [ansible-project] Reusing roles with different configuration files

2014-05-09 Thread Dick Davies
I'm doing the same thing. The way I solved it was to have an base-nginx role that defines things like handlers and useful vars: awesomesauce:$ cat roles/base-nginx/handlers/main.yml --- - name: bounce nginx service: name=nginx state=restarted awesomesauce:$ cat roles/base-nginx/defaults/main.yml

Re: [ansible-project] Reusing roles with different configuration files

2014-05-08 Thread 'Petros Moisiadis' via Ansible Project
On 05/07/2014 11:35 PM, Strahinja Kustudić wrote: > I have been using Ansible for a few months now and it has been a > blast. I think I got the hang of how Ansible works pretty good, but > I'm still not sure about what is the best way to reuse roles. > > Let's take the "nginx" role as an example. W

Re: [ansible-project] Reusing roles with different configuration files

2014-05-07 Thread Maciej Delmanowski
My nginx role uses similar principle, but instead of creating a separate template file for each role, I have one giant, general nginx server template and pass configuration i want for a particular role using hash variables with lists and hashes inside. Nginx role: https://github.com/ginas/ginas/tr

[ansible-project] Reusing roles with different configuration files

2014-05-07 Thread Strahinja Kustudić
I have been using Ansible for a few months now and it has been a blast. I think I got the hang of how Ansible works pretty good, but I'm still not sure about what is the best way to reuse roles. Let's take the "nginx" role as an example. We have Nginx installed on a lot of servers, but besides