On Tuesday, March 24, 2015 at 12:18:29 PM UTC-7, Dag Wieers wrote:
>
> On Tue, 24 Mar 2015, Vince Skahan wrote: 
> > Does ansible do 'include' before 'gather_facts' perhaps ????? 
> > If so, that would be a pretty major bug/misfeature to me... 
>
> I haven't tested your example, but what I usually do is something like: 
>
>    tasks: 
>    - action: group_by key={{ ansible_distribution }}-{{ 
> ansible_distribution_major }} 
>
> and have a a group_vars file for each group: 
>
>    group_vars/debian-7 
>    group_vars/redhat-6 
>
> This will automatically pull variables from the matching group_vars file. 
>
> In fact, in large/complex environments my inventory script has this kind 
> of functionality included so that it has all the needed variables 
> and groups available for every playbook and play from the very start. 
>
>
Thanks, that helps a lot, I think I'll go that route.....

If you have time, see if you can get variable substitution to work in an 
include statement.  It sure 'seems' to try to include the file before doing 
things defined above it (like grabbing the facts) which to me is a design 
flaw.  If we wanted to have calculated filenames based on other things 
defined above it in the sequence, how is that possible currently ?   How do 
we know (or control) the ordering of what ansible is doing ?

Lots of cool stuff here, just a bit undefined and perhaps buggy from what 
I've seen thus far, but I might just not be looking up the right buzzwords 
in their docs.


 

-- 
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/018cb805-31fb-4cbb-901e-bc562b1ecbc8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to