From e91913d9a31292b151b15031bf685b7d0096cabc Mon Sep 17 00:00:00 2001 From: Ronald Date: Sun, 30 Jun 2024 16:23:09 +0100 Subject: [PATCH] Bug fix, ensure that qemu-guest-agent and autostart work --- tasks/proxmox.yml | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/tasks/proxmox.yml b/tasks/proxmox.yml index 9a30c02..6ee046b 100644 --- a/tasks/proxmox.yml +++ b/tasks/proxmox.yml @@ -76,7 +76,7 @@ - create_vm_proxmox_configure_cloudinit | bool delegate_to: localhost -- name: Start VM +- name: Enable QEMU guest agent for VM community.general.proxmox_kvm: api_host: "{{ create_vm_proxmox_host }}" api_user: "{{ create_vm_proxmox_user }}" @@ -84,12 +84,13 @@ node: "{{ create_vm_proxmox_host }}" vmid: "{{ create_vm_proxmox_vmid }}" name: "{{ create_vm_proxmox_name }}" - state: started + agent: true + update: true when: - - create_vm_proxmox_start_vm + - create_vm_proxmox_enable_guest_agent | bool delegate_to: localhost -- name: Enable QEMU guest agent for VM +- name: Set VM to autostart community.general.proxmox_kvm: api_host: "{{ create_vm_proxmox_host }}" api_user: "{{ create_vm_proxmox_user }}" @@ -97,12 +98,14 @@ node: "{{ create_vm_proxmox_host }}" vmid: "{{ create_vm_proxmox_vmid }}" name: "{{ create_vm_proxmox_name }}" - agent: true + proxmox_default_behavior: no_defaults + onboot: true + update: true when: - - create_vm_proxmox_enable_guest_agent | bool + - create_vm_proxmox_start_vm_onboot | bool delegate_to: localhost -- name: Set VM to autostart +- name: Start VM community.general.proxmox_kvm: api_host: "{{ create_vm_proxmox_host }}" api_user: "{{ create_vm_proxmox_user }}" @@ -110,10 +113,9 @@ node: "{{ create_vm_proxmox_host }}" vmid: "{{ create_vm_proxmox_vmid }}" name: "{{ create_vm_proxmox_name }}" - proxmox_default_behavior: no_defaults - onboot: true + state: started when: - - create_vm_proxmox_start_vm_onboot | bool + - create_vm_proxmox_start_vm delegate_to: localhost ...