From 701db06dc455d9dce84b1216afb22832fc790957 Mon Sep 17 00:00:00 2001 From: Jose Date: Sat, 6 Dec 2025 09:12:38 +0100 Subject: [PATCH] fix: ensure 'snippets' is enabled for Proxmox storage configuration --- tasks/preflight-checks.yml | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/tasks/preflight-checks.yml b/tasks/preflight-checks.yml index b86b3a3..5d98fd9 100644 --- a/tasks/preflight-checks.yml +++ b/tasks/preflight-checks.yml @@ -159,22 +159,14 @@ - name: "[PREFLIGHT] Ensure Proxmox storage supports snippets" block: - - name: "[PREFLIGHT] Ensure 'snippets' is in the content list for {{ proxmox_snippets_storage }}" + - name: "[PREFLIGHT] Ensure 'snippets' is enabled for {{ proxmox_snippets_storage }}" ansible.builtin.lineinfile: path: /etc/pve/storage.cfg insertafter: "^dir: {{ proxmox_snippets_storage }}$" - regexp: "^(\\s*content\\s+)(.*)$" - line: '\1{{ (storage_content.split(",") | union(["snippets"])) | join(",") }}' + regexp: '^(\\s*content\\s+)(.*)(?- - {{ lookup('ansible.builtin.lines', '/etc/pve/storage.cfg') - | select('match', '^\\s*dir: {{ proxmox_snippets_storage }}') - | list - | map('regex_search', '^\\s*content\\s+(.*)$') - | select('string') - | first - | default('') }} + become: true - name: "[PREFLIGHT] Ensure snippets storage directory exists" ansible.builtin.file: