No no, I meant overriding variables. In this case, the variable 
"user_groups" is an array of the groups that the role "users" has to 
install in each machine, and it doesn't inherit from all the "sysadmin" 
group.

I need to know if there is something similar to achieve hierarchies of 
inheritance for variables. Or a big sample project. I need to understand 
how stuff is structured, because I find it like too linear atm, not 
allowing to specify that some machines have different properties makes 
harder to me to understand the abstraction layers.

I mean not being able to specify exceptions without having them be executed 
twice. (once for all and another for the specific case).

I understand is because of the knowledge I have and that I am accustomed to 
puppet, so any example on how to structure a big project would be really 
helpful. I aim to control everything with ansible, from users, 
configuration, installed programs, iptables rules, applications deployed, 
etc.

Thank you,

On Friday, September 19, 2014 8:09:40 PM UTC+2, Serge van Ginderachter 
wrote:
>
> OK, I think I see it. There is no such thing as overriding playbooks. 
> Playbooks are a series of plays that are a series of roles and tasks to 
> execute, and tasks use variables.
>
> The overriding here with ansible happens with variables in the inventory.
>
> Given your case, you would define the variable user_groups in the 
> inventory, as a group variable:
>
> group_vars/all  
>
>     - user_groups:
>>       - sysadmin
>>
> ​and 
> group_vars/dev​
>
>  
>
>>     - user_groups:
>>       - development
>>
>
> ​And then you only keep the play targetting the all group.​
>
>
> ​Personally, I rarely use vars defined in the playbook, except when I just 
> need some "constant"​.
>
>

-- 
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 email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/076db278-3e73-4dda-a994-189a097e8be1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to