Javier,
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.
You are confusing me,
- overriding variables happens within inventory groups, and as documented
- you talk about a "sysadmin group". Is this a /etc/group group or an
ansible group?
I need to know if there is something similar to achieve hierarchies of
inheritance for variables.
Yes, that's what I was talking about. groups within the inventory have a
hierarch
y: child groups override parent groups.
Check
http://docs.ansible.com/intro_inventory.html
and the topic of variable precedence
http://docs.ansible.com/playbooks_variables.html#variable-precedence-where-should-i-put-a-variable
(I'd agree the hierarchy of groups should be better documented though.)
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.
Basically you can define groups of groups, and the deeper the group, the
higher the level of importance.
I mean not being able to specify exceptions without having them be
executed twice. (once for all and another for the specific case).
You need to execute on the highest level group, then modify variables on
child and/or grandchild groups.
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.
I'm actually not aware of extensive examples
of group hierarchy. Maybe a fellow list member can help here?
Serge