Update syntax

This commit is contained in:
Kevin Fenzi 2013-11-25 18:33:35 +00:00
parent 1cb8b9a6e7
commit 5e6941493d

View file

@ -3,35 +3,35 @@
# do an action here that aborts if a bunch of vars are not set # do an action here that aborts if a bunch of vars are not set
- name: get vm list on the vmhost - name: get vm list on the vmhost
delegate_to: $vmhost delegate_to: vmhost
virt: command=list_vms virt: command=list_vms
register: result register: result
- name: ensure the lv for the host is made - name: ensure the lv for the host is made
lvol: lv=$inventory_hostname vg=$volgroup size=$lvm_size state=present lvol: lv={{ inventory_hostname }} vg={{ volgroup }} size={{ lvm_size }} state=present
delegate_to: $vmhost delegate_to: vmhost
when: inventory_hostname not in result.list_vms when: inventory_hostname not in result.list_vms
- name: run the virt-install - name: run the virt-install
shell: ${virt_install_command} shell: "{{ virt_install_command }}"
delegate_to: $vmhost delegate_to: vmhost
when: 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 - name: wait for the install to finish - by watching the domstate
# this just keeps checking the domstate until it stops running # this just keeps checking the domstate until it stops running
shell: while `/usr/bin/virsh domstate ${inventory_hostname} | grep -q running` ; do sleep 20; done shell: while `/usr/bin/virsh domstate {{ inventory_hostname }} | grep -q running` ; do sleep 20; done
delegate_to: $vmhost delegate_to: vmhost
async: 1200 async: 1200
poll: 10 poll: 10
when: inventory_hostname not in result.list_vms when: inventory_hostname not in result.list_vms
- name: start the vm up - name: start the vm up
action: virt state=running name=${inventory_hostname} action: virt state=running name={{ inventory_hostname }}
delegate_to: $vmhost delegate_to: vmhost
when: inventory_hostname not in result.list_vms when: inventory_hostname not in result.list_vms
- name: wait for ssh on the vm to start back - 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 local_action: wait_for delay=10 host={{ inventory_hostname }} port=22 state=started timeout=1200
when: inventory_hostname not in result.list_vms when: inventory_hostname not in result.list_vms