fix 🐛: Ensure snippets storage is enabled
This commit updates the preflight task to correctly enable the 'snippets' storage in /etc/pve/storage.cfg. The change uses a more robust regular expression to handle potential variations in the storage configuration, ensuring the snippets feature is properly activated.
This commit is contained in:
@@ -10,12 +10,12 @@
|
|||||||
state: present
|
state: present
|
||||||
update_cache: yes
|
update_cache: yes
|
||||||
|
|
||||||
|
|
||||||
- name: "[PREFLIGHT] Ensure 'snippets' is enabled for {{ proxmox_snippets_storage }}"
|
- name: "[PREFLIGHT] Ensure 'snippets' is enabled for {{ proxmox_snippets_storage }}"
|
||||||
ansible.builtin.replace:
|
ansible.builtin.replace:
|
||||||
path: /etc/pve/storage.cfg
|
path: /etc/pve/storage.cfg
|
||||||
regexp: '(dir:\s*{{ proxmox_snippets_storage }}[\s\S]*?content\s+)(.*)(?<!snippets)'
|
regexp: '^(\s*content\s*=.*?)(?<!snippets)$'
|
||||||
replace: '\1\2,snippets'
|
replace: '\1,snippets'
|
||||||
|
multiline: true
|
||||||
vars:
|
vars:
|
||||||
proxmox_snippets_storage: local
|
proxmox_snippets_storage: local
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user