Thanks James, I will say I misread what count_tag did..
I ended up writing myself a custom Library in the end though

On Friday, April 3, 2015 at 8:22:41 PM UTC+2, James Martin wrote:
>
> 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/09d294df-3c94-4e38-bad2-217e27993bb3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to