28 lines
756 B
YAML
28 lines
756 B
YAML
---
|
|
- name: Setup Cleanup
|
|
when: hypervisor == "proxmox"
|
|
delegate_to: localhost
|
|
become: false
|
|
block:
|
|
- name: Cleanup Setup Disks
|
|
community.proxmox.proxmox_disk:
|
|
api_host: "{{ hypervisor_url }}"
|
|
api_user: "{{ hypervisor_username }}"
|
|
api_password: "{{ hypervisor_password }}"
|
|
name: "{{ hostname }}"
|
|
vmid: "{{ vm_id }}"
|
|
disk: "{{ item }}"
|
|
state: absent
|
|
loop:
|
|
- ide0
|
|
- ide2
|
|
|
|
- name: Start the VM
|
|
community.proxmox.proxmox_kvm:
|
|
api_host: "{{ hypervisor_url }}"
|
|
api_user: "{{ hypervisor_username }}"
|
|
api_password: "{{ hypervisor_password }}"
|
|
node: "{{ hypervisor_node }}"
|
|
vmid: "{{ vm_id }}"
|
|
state: restarted
|