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