When launching AWS instances wait for the one we just launched
because the ec2.instances variable will return all that are currently running
This commit is contained in:
parent
421cc9c22f
commit
ea98969014
@ -22,11 +22,14 @@
|
||||
port: 22
|
||||
state: started
|
||||
with_items: "{{ ec2.instances }}"
|
||||
when: item.image_id == ami_id
|
||||
|
||||
- name: Save instance ID
|
||||
local_action: copy content={{ item.instance_id }} dest={{ tmp_dir }}/instance_id
|
||||
with_items: "{{ ec2.instances }}"
|
||||
when: item.image_id == ami_id
|
||||
|
||||
- name: Save public IP
|
||||
local_action: copy content={{ item.public_ip_address }} dest={{ tmp_dir }}/public_ip
|
||||
with_items: "{{ ec2.instances }}"
|
||||
when: item.image_id == ami_id
|
||||
|
@ -162,7 +162,6 @@ __EOF__
|
||||
'key_name=$KEY_NAME \
|
||||
ssh_key_dir=$SSH_KEY_DIR \
|
||||
ami_id=$AMI_ID \
|
||||
key_name=$KEY_NAME \
|
||||
tmp_dir=$TMP_DIR' \
|
||||
$PLAYBOOKS_DIR/instance.yml"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user