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 > <https://groups.google.com/d/msgid/ansible-project/108e4ebf-159b-48ba-a40d-6026afc3413d%40googlegroups.com?utm_medium=email&utm_source=footer> > . > 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/CA%2BnsWgz3fuP%3DX9svU4a9L6csowyXJxiLmwhNt7KW1dhA2wmp5Q%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
