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.