fix: refine regex to limit snippet insertion to specific Proxmox storage

This commit is contained in:
2025-12-06 09:28:23 +01:00
parent 8082728c6e
commit 4792c24195

View File

@@ -165,12 +165,8 @@
regexp: '^(\s*content\s+.*)(?<!snippets)$'
line: '\1,snippets'
backrefs: yes
# Only apply inside the block for the specified storage
# by matching the storage ID and content line together
# 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 }}"
# Limit the match to lines following the correct storage ID
insertafter: "^dir: {{ proxmox_snippets_storage }}$"
- name: "[PREFLIGHT] Ensure snippets storage directory exists"
ansible.builtin.file: