Undefine existing VM configurations during rebuild

Allows for configuration changes to be redeployed on a
rebuild where previously it didn't attempt to update
the VMs configuration.
`

Change-Id: If14dbdfe7ba3e69a50127fa724ad3f2a8ed58c1a
This commit is contained in:
Antony Messerli 2018-07-23 13:59:27 -05:00
parent 73b0858b5f
commit ef560373e3

View File

@ -59,6 +59,15 @@
- hostvars[item]['server_vm'] | default(false) | bool - hostvars[item]['server_vm'] | default(false) | bool
with_items: "{{ groups['pxe_servers'] }}" with_items: "{{ groups['pxe_servers'] }}"
- name: Undefine the VM
virt:
name: "{{ hostvars[item]['server_hostname'] }}"
command: undefine
failed_when: false
when:
- hostvars[item]['server_vm'] | default(false) | bool
with_items: "{{ groups['pxe_servers'] }}"
- name: Create VM LV - name: Create VM LV
lvol: lvol:
vg: "{{ default_vm_disk_vg }}" vg: "{{ default_vm_disk_vg }}"