From c35abf3e24683b3bdbab54e08f94bb3c9bb9818f Mon Sep 17 00:00:00 2001 From: Maxim Vershinin Date: Tue, 7 Jul 2026 15:35:51 +0000 Subject: [PATCH] FIX: LXC is created first, then we make sure that it is actually running --- roles/00_basic_proxmox_lxc/tasks/main.yaml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/roles/00_basic_proxmox_lxc/tasks/main.yaml b/roles/00_basic_proxmox_lxc/tasks/main.yaml index 9f808d2..3456368 100644 --- a/roles/00_basic_proxmox_lxc/tasks/main.yaml +++ b/roles/00_basic_proxmox_lxc/tasks/main.yaml @@ -15,10 +15,22 @@ ostemplate: 'main:vztmpl/debian-13-standard_13.1-2_amd64.tar.zst' memory: 2048 cores: 5 - state: started + state: present disk_volume: size: 2 # 2GB rootfs storage: local pubkey: "{{ lookup('file', lookup('env','HOME') + '/.ssh/ansible_key.pub') }}" netif: - net0: "name=eth0,gw=192.168.0.1,ip=192.168.0.40/24,bridge=vmbr0" \ No newline at end of file + net0: "name=eth0,gw=192.168.0.1,ip=192.168.0.40/24,bridge=vmbr0" + +- name: Make sure the container has started + become: no + community.proxmox.proxmox: + node: proxmox-server + api_user: root@pam + api_host: 192.168.0.2 + api_token_id: ansible + api_token_secret: "{{ proxmox_token_secret }}" + + vmid: 1040 + state: started \ No newline at end of file