fix: refine regex to limit snippet insertion to specific Proxmox storage
This commit is contained in:
@@ -165,12 +165,8 @@
|
|||||||
regexp: '^(\s*content\s+.*)(?<!snippets)$'
|
regexp: '^(\s*content\s+.*)(?<!snippets)$'
|
||||||
line: '\1,snippets'
|
line: '\1,snippets'
|
||||||
backrefs: yes
|
backrefs: yes
|
||||||
# Only apply inside the block for the specified storage
|
# Limit the match to lines following the correct storage ID
|
||||||
# by matching the storage ID and content line together
|
insertafter: "^dir: {{ proxmox_snippets_storage }}$"
|
||||||
# e.g. "dir: local" followed by " content ..."
|
|
||||||
# This ensures we don't touch other storages
|
|
||||||
# Use 'search_string' to anchor the block
|
|
||||||
search_string: "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