Hi all,

I have a question regarding role default variables. First, this is my use 
case: I want to develop reusable, redistributable and configurable roles 
supporting different operating systems. Some variables differ on the 
different operating systems. In addition to the defaults/main.yml file that 
is always automatically loaded, I would like to have a variable file for 
each operating system, something like rhel.yml, debian.yml etc. As the 
roles should be redistributable, it should be easy to override these 
variables, e.g. in the inventory or the playbook.

I really like the approach mentioned in the Ansible Best Practices here: 
http://docs.ansible.com/ansible/playbooks_best_practices.html#operating-system-and-distribution-variance,
 
but it's not on role level. If I would use include_vars, it would be very 
hard to overwrite those role default variables. So the question is

Is there any built-in mechanism to load more files than the main.yml from a 
role defaults/ folder which keeps the variable precedence? And if yes, is 
it possible to load them dynamically based on the operating system?


Of course, I'm open to other ideas how to satisfy the use case and keep 
roles portable, reusable and configurable without always having to modify 
them.


Thanks in advance,
Patrick





-- 
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/aabf6cb9-1f6c-4f3e-9d78-3c6a43d388f9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to