Thanks John, that was just what I was looking for.  This would be a great 
addition to the docs. I was originally trying to do:

pre_tasks:
   - include_vars: sharedvars.yml

But the variables in that case weren't being pulled in. I feel like the 
docs would warn you that pre_tasks don't affect the environment for the 
subsequent roles and also suggest the dependency trick for sharing variable 
values across roles.

Regards,
David

On Wednesday, August 27, 2014 at 2:51:14 PM UTC-5, John Dickerson wrote:
>
> In our environment, we have several roles that share common default "site" 
> variables for things like the lists of domain controllers, NTP servers, the 
> name of the kerberos realm, etc.  Many of these variables are used in more 
> than one role, but not all the roles are used by all systems.  So we just  
> created a role called "site-defaults" that only has a defaults/main.yml 
> containing all the site-specific default variables; it doesn't perform any 
> tasks.  Then we just add a role dependency in the other roles for the 
> site-defaults role.  Admins can always override the defaults with host or 
> group variables if they need to, but at least we make an attempt to get 
> everyone off on the right foot. 
>
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/be4aa1a1-eba1-4e6c-8b97-107e3eb8547a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to