On 05/28/2014 03:24 PM, Maciej Delmanowski wrote:

28 maj 2014 22:18 "C. Morgan Hamill" <[email protected] <mailto:[email protected]>> napisał(a):
>
> For what it's worth, I simply follow this rule: if data needs to be
> accessed from outside a role, then it should go in inventory somewhere
> (e.g., group_vars/foo or group_vars/all/foo).
>
> My 2¢.

This is very good solution too (my nginx role also accounts for this). I would also provide sane default values whenever possible via role/defaults/main.yml to not force configuration upon user if not necessary.

Maciej


Yes -- I totally agree that setting these shared-between-roles variables in group_vars/all.yml is the way to go. And I also agree with Maciej in that you shouldn't force a user to configure things in their inventory vars if you can provide sensible values in role/defaults/main.yml -- which is what I've done and demonstrated -- and which is why I started this dang thread to begin with.

Setting the shared-between-roles variables in group_vars/all.yml is probably the way to go; as it avoids needing to depend on roles when all you need is a var from it, or the alternative of using include_vars, but it does force the user to add values to their inventory.

~ Brice



--
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/53864794.2060709%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to