feat(pb,role,task): adds storage validation and uses it in LXC and VM deployment

This commit is contained in:
2026-09-19 14:28:56 +04:00
parent 130fcb5069
commit 8530b93fea
5 changed files with 33 additions and 3 deletions
+22
View File
@@ -0,0 +1,22 @@
---
- name: Set default storage
ansible.builtin.set_fact:
guest_storage: "main"
- name: Prompt for guest storage with immediate validation
ansible.builtin.pause:
prompt: "Choose storage for root, available: main (HDD), local (PCIe NVMe SSD) [{{ guest_storage }}]"
register: storage_result
until: >
storage_result.user_input | length == 0 or
(
storage_result.user_input in ['main', 'local']
)
retries: 2
delay: 0
- name: Use user input only if provided, otherwise keep the default
ansible.builtin.set_fact:
guest_storage: "{{ storage_result.user_input }}"
when: storage_result.user_input | length > 0