fix: update snippet enabling logic for Proxmox storage configuration

This commit is contained in:
2025-12-06 09:34:58 +01:00
parent 4792c24195
commit 38d30dca27

View File

@@ -160,13 +160,10 @@
- name: "[PREFLIGHT] Ensure Proxmox storage supports snippets"
block:
- name: "[PREFLIGHT] Ensure 'snippets' is enabled for {{ proxmox_snippets_storage }}"
ansible.builtin.lineinfile:
ansible.builtin.replace:
path: /etc/pve/storage.cfg
regexp: '^(\s*content\s+.*)(?<!snippets)$'
line: '\1,snippets'
backrefs: yes
# Limit the match to lines following the correct storage ID
insertafter: "^dir: {{ proxmox_snippets_storage }}$"
regexp: '(dir:\s*{{ proxmox_snippets_storage }}[\s\S]*?content\s+)(.*)(?<!snippets)'
replace: '\1\2,snippets'
- name: "[PREFLIGHT] Ensure snippets storage directory exists"
ansible.builtin.file: