From 28791acfda122841d11c5c28d0919d5c1f2daf83 Mon Sep 17 00:00:00 2001 From: Maxim Vershinin Date: Sun, 12 Jul 2026 12:39:16 +0000 Subject: [PATCH] FEATURE_REFACTOR: 1-minute delay added at the end. Refactored according to ansible-lint --- roles/basic_proxmox_lxc/tasks/main.yaml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/roles/basic_proxmox_lxc/tasks/main.yaml b/roles/basic_proxmox_lxc/tasks/main.yaml index 3456368..d5033dc 100644 --- a/roles/basic_proxmox_lxc/tasks/main.yaml +++ b/roles/basic_proxmox_lxc/tasks/main.yaml @@ -1,14 +1,16 @@ --- - name: Create new container with minimal options defining network interface with static ip - become: no + become: false community.proxmox.proxmox: + validate_certs: false node: proxmox-server api_user: root@pam api_host: 192.168.0.2 api_token_id: ansible api_token_secret: "{{ proxmox_token_secret }}" + cmode: "shell" vmid: 1040 password: ansible-test hostname: "ansible-test" @@ -19,13 +21,14 @@ disk_volume: size: 2 # 2GB rootfs storage: local - pubkey: "{{ lookup('file', lookup('env','HOME') + '/.ssh/ansible_key.pub') }}" + 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" - name: Make sure the container has started - become: no + become: false community.proxmox.proxmox: + validate_certs: false node: proxmox-server api_user: root@pam api_host: 192.168.0.2 @@ -33,4 +36,11 @@ api_token_secret: "{{ proxmox_token_secret }}" vmid: 1040 - state: started \ No newline at end of file + state: started + +- name: Sleep for a minute to ensure that ssh is ready + become: false + ansible.builtin.wait_for: + timeout: 60 + delegate_to: localhost + changed_when: false