From ce935412fa493b1f9055f1cf7cfab08e36ea7cbc Mon Sep 17 00:00:00 2001 From: Ronald Date: Fri, 23 May 2025 21:13:24 +0100 Subject: [PATCH] Fix some minor bugs --- tasks/connect.yml | 1 + tasks/proxmox.yml | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tasks/connect.yml b/tasks/connect.yml index 076969a..76bd55e 100644 --- a/tasks/connect.yml +++ b/tasks/connect.yml @@ -7,6 +7,7 @@ ansible.builtin.command: cmd: "ssh-keygen -R {{ ansible_host }}" register: create_vm_proxmox_remove_ssh_host_key_cmd + throttle: 1 changed_when: '"# Host " + ansible_host + " found" in create_vm_proxmox_remove_ssh_host_key_cmd.stdout' when: create_vm_proxmox_remove_ssh_host_key | bool delegate_to: localhost diff --git a/tasks/proxmox.yml b/tasks/proxmox.yml index f36efda..f380c95 100644 --- a/tasks/proxmox.yml +++ b/tasks/proxmox.yml @@ -19,7 +19,7 @@ name: "{{ create_vm_proxmox_name }}" state: absent force: true - timeout: 30 + timeout: 120 when: - create_vm_proxmox_check_if_vm_exists.proxmox_vms is defined - create_vm_proxmox_check_if_vm_exists.proxmox_vms | length > 0 @@ -57,7 +57,7 @@ vmid: "{{ create_vm_proxmox_vmid }}" node: "{{ create_vm_proxmox_host }}" vcpus: "{{ create_vm_proxmox_numb_cpus | default(omit) }}" - cores: "{{ create_vm_proxmox_numb_cores | default(omit) }}" + cores: "{{ create_vm_proxmox_numb_cores | default(2) }}" memory: "{{ create_vm_proxmox_memory_mb | default(omit) }}" update: true delegate_to: localhost @@ -93,7 +93,9 @@ update_unsafe: true ide: ide2: "{{ create_vm_proxmox_cloudinit_storage_pool }}:cloudinit,format=raw" - when: create_vm_proxmox_add_cloudinit_drive | bool + when: + - create_vm_proxmox_clone_vm is changed + - create_vm_proxmox_add_cloudinit_drive | bool delegate_to: localhost - name: Proxmox - Add cloud-init settings