Nico, Please see: http://docs.ansible.com/ec2_module.html
Specifically the "count" and "count_tag" options. - James On Thursday, April 2, 2015 at 4:59:52 PM UTC-4, Nico K. wrote: > > Hi, > > I might be doing things backwards, but I'm gonna ask anyway. > > In my scenario, I first add the host_vars/new_host and only then do I run > the ec2 create task (which is delegated to localhost obviously). > After the instance is created, all variables already exist since they are > defined in host_vars,so far so good. > > The only problem with this approach is that it doesn't seem to be > re-entrant, since the ec2 task will create a new instance every single time > it's called. > Is there a way to have the 'ec2' task only spawn the instance when it does > not exist yet (for example based on it's tags?) > > Thanks, > Nico. > -- 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/567e3b20-1dc5-449c-9d85-a40bbc9c973a%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
