I have the following scenario, and I just want to see if I understand 
correctly what is happening (hopefully after posting this my alignment 
doesn't get all messed up):

                   main.yml <---- Gathers some variables... has some 
includes based on those variables
                  /             \
           true.yml       false.yml  <--- Try to utilize variables called 
in main.yml
                  \             /
            common_tasks.yml

Questions:

1.  When setting variables in main.yml, and can I utilize those variables 
outside of main?  Such as when I include true|false.yml files and try to 
utilize them in there?  I don't know if setting them within main limits 
their scope.
2.  Say I have servers A B C D and E.  If A B C are evaluated as true, and 
the true.yml is included, and the D E servers resolve as false, is my order 
of execution as follows?

   1. Execute main.yml
   2. Execute true.yml (listed first in main.yml) for all servers: A B C D 
   E, but apply the "when: condition" listed in the main.yml to all servers
   3. Execute the common_tasks.yml for all servers (no condition tied to 
   the common.yml include) as it is in the bottom of the true.yml
   4. Execute false.yml for all servers, but apply the "when: condition" 
   listed in the main.yml to all servers 
   5. Execute the common_tasks.yml for all servers again (as it is listed 
   in the bottom of the false.yml too)?

The above is my guess as to how this is going to want to operate, but I 
haven't confirmed it completely yet.  If that is the case, how can I call 
the common_tasks.yml just once after true/false.yml files are executed?

-- 
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/43df449e-7bf3-4558-b930-c69516635c71%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to