From 48a865fbc6e6676adf7942e738a9a706fd34dc42 Mon Sep 17 00:00:00 2001 From: Seth Vidal Date: Tue, 11 Jun 2013 16:29:13 +0000 Subject: [PATCH] change a bunch of when_strings to when's and fix up variables --- playbooks/destroy_cloud_inst.yml | 2 +- tasks/virt_instance_create.yml | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/playbooks/destroy_cloud_inst.yml b/playbooks/destroy_cloud_inst.yml index 1426904fa0..65a42cef6e 100644 --- a/playbooks/destroy_cloud_inst.yml +++ b/playbooks/destroy_cloud_inst.yml @@ -9,7 +9,7 @@ tasks: - name: fail if the host/ip is not up local_action: wait_for host=${inventory_hostname} port=22 delay=0 timeout=10 - when_string: ${inventory_hostname} not in ${result.list_vms} + when_string: inventory_hostname not in result.list_vms - name: pause for 30s before doing it pause: seconds=30 prompt="Destroying vm now $target, abort if this is wrong" diff --git a/tasks/virt_instance_create.yml b/tasks/virt_instance_create.yml index c24aee1e97..ec76e5ff06 100644 --- a/tasks/virt_instance_create.yml +++ b/tasks/virt_instance_create.yml @@ -10,12 +10,12 @@ - name: ensure the lv for the host is made lvol: lv=$inventory_hostname vg=$volgroup size=$lvm_size state=present delegate_to: $vmhost - when_string: ${inventory_hostname} not in ${result.list_vms} + when: inventory_hostname not in result.list_vms - name: run the virt-install shell: ${install_command} delegate_to: $vmhost - when_string: ${inventory_hostname} not in ${result.list_vms} + when: inventory_hostname not in result.list_vms - name: wait for the install to finish - by watching the domstate # this just keeps checking the domstate until it stops running @@ -23,15 +23,16 @@ delegate_to: $vmhost async: 1200 poll: 10 - when_string: ${inventory_hostname} not in ${result.list_vms} + when_string: inventory_hostname not in result.list_vms - name: start the vm up action: virt state=running name=${inventory_hostname} delegate_to: $vmhost - when_string: ${inventory_hostname} not in ${result.list_vms} + when_string: inventory_hostname not in result.list_vms - name: wait for ssh on the vm to start back local_action: wait_for delay=10 host=${inventory_hostname} port=22 state=started timeout=1200 - when_string: ${inventory_hostname} not in ${result.list_vms} + when_string: inventory_hostname not in result.list_vms +