fix 🐛: Enable snippets in storage.cfg
This commit enables the 'snippets' feature in the Proxmox storage configuration file. It achieves this by adding a snippet line to the storage.cfg, ensuring that Proxmox snippets are available. Additionally, it creates the necessary 'snippets' directory within the specified storage path.
This commit is contained in:
@@ -10,6 +10,24 @@
|
|||||||
state: present
|
state: present
|
||||||
update_cache: yes
|
update_cache: yes
|
||||||
|
|
||||||
|
|
||||||
|
- name: "[PREFLIGHT] Ensure 'snippets' is enabled for {{ proxmox_snippets_storage }}"
|
||||||
|
ansible.builtin.replace:
|
||||||
|
path: /etc/pve/storage.cfg
|
||||||
|
regexp: '(dir:\s*{{ proxmox_snippets_storage }}[\s\S]*?content\s+)(.*)(?<!snippets)'
|
||||||
|
replace: '\1\2,snippets'
|
||||||
|
vars:
|
||||||
|
proxmox_snippets_storage: local
|
||||||
|
|
||||||
|
- name: "[PREFLIGHT] Ensure snippets storage directory exists"
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "{{ proxmox_snippets_storage_path }}/snippets"
|
||||||
|
state: directory
|
||||||
|
mode: "0755"
|
||||||
|
vars:
|
||||||
|
proxmox_snippets_storage_path: /var/lib/vz
|
||||||
|
|
||||||
|
|
||||||
- name: Deploy templates with proxmox_template_vm
|
- name: Deploy templates with proxmox_template_vm
|
||||||
ansible.builtin.include_role:
|
ansible.builtin.include_role:
|
||||||
name: joshrnoll.homelab.proxmox_template_vm
|
name: joshrnoll.homelab.proxmox_template_vm
|
||||||
|
|||||||
Reference in New Issue
Block a user