From e17c382de4a1baa60f1dd248afbf5a177f32b37f Mon Sep 17 00:00:00 2001 From: Seth Vidal Date: Tue, 18 Jun 2013 16:58:09 +0000 Subject: [PATCH] - remove now-unused persistent_cloud_nodisks - update persistent_cloud to use new when: conditional instead of when_filed and only_if --- tasks/persistent_cloud.yml | 9 +++++---- tasks/persistent_cloud_nodisks.yml | 19 ------------------- 2 files changed, 5 insertions(+), 23 deletions(-) delete mode 100644 tasks/persistent_cloud_nodisks.yml diff --git a/tasks/persistent_cloud.yml b/tasks/persistent_cloud.yml index 691862519c..42ab388e6b 100644 --- a/tasks/persistent_cloud.yml +++ b/tasks/persistent_cloud.yml @@ -7,18 +7,19 @@ - name: spin it up local_action: ec2 keypair=${keypair} image=${image} type=${instance_type} wait=true group=${security_group} ec2_access_key=$persist_access_key ec2_secret_key=$persist_secret_key ec2_url=$os_ec2_url register: inst_res - when_failed: $host_is_up + when: host_is_up|failed - name: assign it a special ip local_action: shell euca-associate-address --config ${persist_config} -i ${inst_res.instances[0].id} ${public_ip} - when_failed: $host_is_up + when: host_is_up|failed - name: wait for the reassignation local_action: wait_for host=${public_ip} port=22 delay=20 timeout=300 - when_failed: $host_is_up + when: host_is_up|failed # attach and mount volumes - name: attach volumes to the system local_action: shell euca-attach-volume --config ${persist_config} -i ${inst_res.instances[0].id} $item with_items: $volumes - only_if: 'is_set("${volumes}") and "${host_is_up.rc}" != "0"' + when: volumes is defined and host_is_up|failed + diff --git a/tasks/persistent_cloud_nodisks.yml b/tasks/persistent_cloud_nodisks.yml deleted file mode 100644 index 3f15455a3d..0000000000 --- a/tasks/persistent_cloud_nodisks.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- -- 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 keypair=${keypair} image=${image} type=${instance_type} wait=true group=${security_group} ec2_access_key=$persist_access_key ec2_secret_key=$persist_secret_key ec2_url=$os_ec2_url - 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'" -