Awesome, this is a great start. 2 questions off the top of my head:
1) Because I am using ansible-playbook, where do I put these steps such that they run before the roles do so that all the machines are created, running, and in the hosts for the play? Would I have them in the playbook file before the -roles section? 2) Can I take the tags from the ec2 instances and add them as variables on the hosts as I add each instance to the hosts for the play? I have host-specific configuration that would be perfect to put in the instance tags Thanks for you help. On Tuesday, 9 September 2014 13:37:42 UTC-7, Michael DeHaan wrote: > > Take a look at "exact_count" in the Ec2 module for #2, as combined with > the add_host module. > > This is a pretty common pattern. > > With add_host you can throw the machine into a group, and the group_vars > files will pick up and be applied. > > Any specific questions? > > > > On Tue, Sep 9, 2014 at 4:34 PM, Jeremy Gailor <[email protected] > <javascript:>> wrote: > >> I think I have an idea about how to do this, but I wanted some guidance >> from the Ansible community: >> >> What I would like to do is the following: >> >> 1) Run ansible-playbook >> 2) Ensure that there are X nodes in EC2 matching some criteria (an >> instance tag would be best), and create additional instances as necessary >> to bring the count up to X >> 3) Add each of the instance found/created to the set of hosts or the play >> 4) Add host variables based on instance tags on each of the instances >> 5) Run my play (and all associated roles) against that list of hosts >> built from the previous steps. >> >> Thanks for the help. >> >> -- >> 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] <javascript:>. >> To post to this group, send email to [email protected] >> <javascript:>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/ansible-project/718b9ed2-ecb5-4855-bc10-695a1beabc5f%40googlegroups.com >> >> <https://groups.google.com/d/msgid/ansible-project/718b9ed2-ecb5-4855-bc10-695a1beabc5f%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/ab7f48f4-5f04-4c21-b1c1-d84fe2d6fb1a%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
