Hi Christian,
You are correct that there is a wait parameter to the ec2 module but
unfortunately it will probably not get you what you want since an ec2
instance in the "running" state does not necessary mean you can ssh to
it.
What we should probably add to this module is a wait for the system
status check to be 'ok' which is what I do typically when using boto
in python code.
To solve your immediate problem I wouldn't use a prompt; instead you
can wait for ssh to become available using the the wait_for module.
Example:
# register the var "ec2" when you launch it using the ec2 module
- name: Add new instance to host group
local_action: >
add_host
hostname={{ item.public_ip }}
groupname=launched
with_items: ec2.instances
- name: Wait for SSH to come up
local_action: >
wait_for
host={{ item.public_dns_name }}
state=started
port=22
delay=60
timeout=320
with_items: ec2.instances
As for idempotent behavior with the ec2 module you can use the id
parameter, see
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html
-John
> --
> 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
ansible-proje...@googlegroups.com.
> To post to this group, send email to
ansible...@googlegroups.com.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/ansible-project/ccd1cf5f-d344-4c9f-9860-28c012bdabfc%40googlegroups.com.
>
> For more options, visit
https://groups.google.com/d/optout.