From ac4bd0a2265da35b421125faec0b802b5daa3e89 Mon Sep 17 00:00:00 2001 From: Gleb Koval Date: Sun, 3 Sep 2023 00:26:25 +0100 Subject: [PATCH] test some stuff --- infra/test-vm-2/proxmox-playbook.yaml | 36 ++++++++++++++++++--------- 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/infra/test-vm-2/proxmox-playbook.yaml b/infra/test-vm-2/proxmox-playbook.yaml index c801464..bcf911a 100644 --- a/infra/test-vm-2/proxmox-playbook.yaml +++ b/infra/test-vm-2/proxmox-playbook.yaml @@ -11,16 +11,28 @@ tasks: - name: Create test-vm-2 community.general.proxmox_kvm: - register: create_data - - name: Print create_data + tags: + - managed + register: vm + - name: Print VM data ansible.builtin.debug: - msg: "{{ create_data }}" - - name: Update test-vm-2 - community.general.proxmox_kvm: - cpu: x86-64-v3 - memory: 2048 - cores: 5 - update: true - - name: Start test-vm-2 - community.general.proxmox_kvm: - state: restarted + msg: "{{ vm }}" + - name: Modify test-vm-2 + module_defaults: + community.general.proxmox_kvm: + vmid: "{{ vm.vmid }}" + tasks: + - name: Wait for test-vm-2 to exist + community.general.proxmox_kvm: + state: current + retries: 30 + delay: 10 + - name: Update test-vm-2 + community.general.proxmox_kvm: + cpu: x86-64-v3 + memory: 2048 + cores: 5 + update: true + - name: Start test-vm-2 + community.general.proxmox_kvm: + state: restarted