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: