Ok, that's fine - tried adding the hosts to the appropriate tag groups after the provisioning run and it seems the group_vars are being applied now, which is great-just wanted to make sure there wasn't a way to reevaluate everything automatically. Thanks for the advice!
> On 5 Sep 2014, at 20:30, Michael DeHaan <[email protected]> wrote: > > > > >> On Fri, Sep 5, 2014 at 10:33 AM, Craig Marvelley <[email protected]> >> wrote: >> Hi all! Up until now, I've provisioned machines in EC2 in two stages - the >> first set of playbooks launch the machine and tag it as necessary, and then >> a second set of playbooks does the proper provisioning, using group_vars >> identified automatically according to the tag_NAME_VALUE convention to >> dictate how the plays are run. > > See how you can include your configuration playbook at the end of your > provisioning playbook with the "add_host" trick, as you can do this all in > one pass. > > > >> I've just changed this process so the launching and configuration happens >> all in the same set of playbooks, i.e. there's no break in between these >> playbooks running. With this done, it seems the group vars matching the new >> instance's tags are not applied automatically - possibly because these are >> evaluated by the dynamic inventory script when the overarching play begins, >> and not as new items enter the inventory? > > Inventory script gets evaluated at inventory host time, so it's always a good > idea to use "add_host" to explicitly add them in memory to those specific > groups. > >> >> After reading around, I believe that were I to manually add the instance >> into groups (named after each of its tags) after launch, the matching >> group_vars would be loaded and applied (I've tried and can't get this to >> work, though). In any case that's not an obvious way to do it - so I was >> hoping someone could suggest an alternative? Is there a way to force a >> reload of group vars based on an updated dynamic inventory during a play? >> -- >> 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/108e4ebf-159b-48ba-a40d-6026afc3413d%40googlegroups.com. >> For more options, visit https://groups.google.com/d/optout. > > -- > You received this message because you are subscribed to a topic in the Google > Groups "Ansible Project" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/ansible-project/gi7S1P3Z8Ew/unsubscribe. > To unsubscribe from this group and all its topics, 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/CA%2BnsWgz3fuP%3DX9svU4a9L6csowyXJxiLmwhNt7KW1dhA2wmp5Q%40mail.gmail.com. > For more options, visit https://groups.google.com/d/optout. -- 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/83C4032B-E9F7-4176-AD2B-7DD11742D1C6%40gmail.com. For more options, visit https://groups.google.com/d/optout.
