mirror of
https://pagure.io/fedora-infra/ansible.git
synced 2026-03-20 03:57:02 +08:00
prototype of what the persistent cloud instance playbooks/hostvars will look like
This commit is contained in:
19
tasks/persistent_cloud.yml
Normal file
19
tasks/persistent_cloud.yml
Normal file
@@ -0,0 +1,19 @@
|
||||
---
|
||||
- name: check it out
|
||||
local_action: shell nc -d -z -w 5 ${inventory_hostname} 22 >>/dev/null
|
||||
register: host_is_up
|
||||
ignore_errors: true
|
||||
|
||||
- name: spin it up
|
||||
local_action: ec2_create keypair=${keypair} image=${image} type=${instance_type} wait=true
|
||||
register: inst_res
|
||||
only_if: "'${host_is_up.rc}' != '0'"
|
||||
|
||||
- name: assign it a special ip
|
||||
local_action: shell euca-associate-address -i ${inst_res.instances[0].id} ${public_ip}
|
||||
only_if: "'${host_is_up.rc}' != '0'"
|
||||
|
||||
- name: wait for the reassignation
|
||||
local_action: wait_for host=${public_ip} port=22 delay=20 timeout=300
|
||||
only_if: "'${host_is_up.rc}' != '0'"
|
||||
|
||||
Reference in New Issue
Block a user