33 lines
995 B
YAML
33 lines
995 B
YAML
---
|
|
- name: Deprovision cluster
|
|
hosts: localhost
|
|
gather_facts: no
|
|
tasks:
|
|
- community.general.proxmox_kvm:
|
|
api_host: "{{ proxmox_api_host }}"
|
|
api_user: "{{ lookup('env','PM_USER') }}"
|
|
api_password: "{{ lookup('env','PM_PASSWORD') }}"
|
|
name: "{{ item }}"
|
|
node: "{{ hostvars[item].node }}"
|
|
vmid: "{{ hostvars[item].id }}"
|
|
state: stopped
|
|
force: yes
|
|
timeout: 500
|
|
with_inventory_hostnames:
|
|
- primary
|
|
- control_plane
|
|
- workers
|
|
- community.general.proxmox_kvm:
|
|
api_host: "{{ proxmox_api_host }}"
|
|
api_user: "{{ lookup('env','PM_USER') }}"
|
|
api_password: "{{ lookup('env','PM_PASSWORD') }}"
|
|
name: "{{ item }}"
|
|
node: "{{ hostvars[item].node }}"
|
|
vmid: "{{ hostvars[item].id }}"
|
|
state: absent
|
|
force: yes
|
|
timeout: 500
|
|
with_inventory_hostnames:
|
|
- primary
|
|
- control_plane
|
|
- workers |