Playbook templating done before loading group_vars contents?

Hey folks,

Ansible 1.9.2 here. I’ve been recently working on moving us over from static inventories to using the ec2 script. One constraint I have is that I separate different environments within the same AWS account by the Environment tag. In this case I’m working on Environment=dev, which in my file tree has its own folder (see tree at the bottom). The problem I’m having is that I can’t figure out how to set {{ env }} in my - hosts: from my all.yml file in group_vars. It looks like group_vars as NOT read at the time of the playbook yml file templating, but only afterwards. As an example, assuming this all.yml:

`

group_vars are applied to individual hosts and is not available globally without a host context. To use a variable for hosts it must be global and provided before parsing the play. Such as providing it via --extra-vars on the command line.

Great, makes sense, thank you.