From 13b586d6882b1ec21e49278cc706ebced7b81bfd Mon Sep 17 00:00:00 2001 From: Ronald Date: Tue, 31 Dec 2024 15:13:50 +0000 Subject: [PATCH] Remove previous change, ensure we always run a task to check that we can connect to the new box --- tasks/connect.yml | 12 ++++++------ tasks/proxmox.yml | 4 +++- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/tasks/connect.yml b/tasks/connect.yml index 1038b34..076969a 100644 --- a/tasks/connect.yml +++ b/tasks/connect.yml @@ -27,11 +27,11 @@ changed_when: true delegate_to: localhost - - name: Connect - Ensure we can connect - ansible.builtin.wait_for_connection: - connect_timeout: 10 - delay: 5 - sleep: 2 - timeout: 120 +- name: Connect - Ensure we can connect + ansible.builtin.wait_for_connection: + connect_timeout: 10 + delay: 5 + sleep: 2 + timeout: 120 ... diff --git a/tasks/proxmox.yml b/tasks/proxmox.yml index 9de0f0a..29b9ab6 100644 --- a/tasks/proxmox.yml +++ b/tasks/proxmox.yml @@ -94,7 +94,9 @@ ipconfig: "{{ create_vm_proxmox_cloudinit_ipconfig }}" nameservers: "{{ create_vm_proxmox_cloudinit_nameservers }}" searchdomains: "{{ create_vm_proxmox_cloudinit_searchdomains }}" - when: create_vm_proxmox_configure_cloudinit | bool + when: + - create_vm_proxmox_check_if_vm_exists.proxmox_vms | length == 0 + - create_vm_proxmox_configure_cloudinit | bool delegate_to: localhost - name: Proxmox - Enable QEMU guest agent for VM