fix(proxmox_lxc_provision): wait for container config file before editing it
The proxmox create task can return before pmxcfs has flushed the .conf, so the first delegated lineinfile hit 'Destination /etc/pve/lxc/<vmid>.conf does not exist'. Poll for the file with wait_for (up to 30s) before applying idmaps/GPU config, which continues as soon as it appears rather than eating a fixed sleep.
This commit is contained in:
@@ -6,6 +6,13 @@
|
||||
# preserves in place. Each line is keyed on its own exact content, so no comment
|
||||
# markers are needed and re-runs stay churn-free.
|
||||
|
||||
- name: Wait for the container config file to exist
|
||||
ansible.builtin.wait_for:
|
||||
path: "/etc/pve/lxc/{{ lxc_vmid }}.conf"
|
||||
timeout: 30
|
||||
delegate_to: "{{ proxmox_delegate_host }}"
|
||||
become: true
|
||||
|
||||
- name: Configure ID mappings
|
||||
ansible.builtin.lineinfile:
|
||||
path: "/etc/pve/lxc/{{ lxc_vmid }}.conf"
|
||||
|
||||
Reference in New Issue
Block a user