kayobe/ansible/seed-vm-deprovision.yml
Pierre Riteau 11dbe8bffe Fix seed vm deprovision
The libvirt_vm_vcpus and libvirt_vm_memory_mb variables are required by
the stackhpc.libvirt-vm role even when setting libvirt_vm_state to
absent. Without these variables, `kayobe seed vm deprovision` fails with
the following error:

    FAILED! => {"msg": "'libvirt_vm_vcpus' is undefined"}

Change-Id: If74f4229cf777328e3a02794067caae7aa731a80
2018-09-28 17:33:21 +01:00

18 lines
692 B
YAML

---
- name: Ensure that the seed VM is deprovisioned
hosts: seed-hypervisor
vars:
seed_host: "{{ groups['seed'][0] }}"
seed_hostvars: "{{ hostvars[seed_host] }}"
roles:
- role: stackhpc.libvirt-vm
seed_vm_configdrive_volume:
name: "{{ seed_hostvars.seed_vm_name }}-configdrive"
pool: "{{ seed_hostvars.seed_vm_pool }}"
libvirt_vm_name: "{{ seed_hostvars.seed_vm_name }}"
libvirt_vm_memory_mb: "{{ seed_hostvars.seed_vm_memory_mb }}"
libvirt_vm_vcpus: "{{ seed_hostvars.seed_vm_vcpus }}"
libvirt_vm_volumes: "{{ seed_hostvars.seed_vm_volumes + [seed_vm_configdrive_volume] }}"
libvirt_vm_state: "absent"
become: True