Questions: variables and includes

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?

  3. Execute main.yml

  4. 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

  5. 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

  6. Execute false.yml for all servers, but apply the “when: condition” listed in the main.yml to all servers

  7. 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?

I think I answered my last question… assuming things execute as I stated above. I just include the common.yml at the bottom of the main.yml and it will be executed after true|false.yml

Correct me if I am wrong.