15 lines
719 B
YAML
15 lines
719 B
YAML
---
|
|
- name: spin it up
|
|
local_action: ec2_create keypair=${keypair} image=${image} type=${instance_type} wait=true group=${security_group}
|
|
register: inst_res
|
|
|
|
- name: add it to the special group
|
|
local_action: add_host hostname=${inst_res.instances[0].public_ip} groupname=tmp_just_created
|
|
|
|
- name: mail off about where it is
|
|
local_action: mail to=sysadmin-main-members@fedoraproject.org from=ansible-create@fedoraproject.org subject=${inst_res.instances[0].public_ip} msg="cloud instance created on ${inst_res.instances[0].public_ip}\n instance id - ${inst_res.instances[0].id} "
|
|
|
|
- name: wait for the host to be hot
|
|
local_action: wait_for host=${inst_res.instances[0].public_ip} port=22 delay=5 timeout=300
|
|
|
|
|