feat(pb,role,task): completes the LXC deployment workflow using new validation tasks

This commit is contained in:
2026-09-17 10:50:46 +04:00
parent 0696218eb6
commit daa5826573
3 changed files with 17 additions and 16 deletions
+12 -3
View File
@@ -2,7 +2,11 @@
- name: Set default ip
ansible.builtin.set_fact:
lxc_ip_address: "192.168.0.90/24"
lxc_ip_address: "192.168.0.90"
- name: Set default network mask
ansible.builtin.set_fact:
lxc_netmask: "24"
- name: Prompt for IP with immediate validation
ansible.builtin.pause:
@@ -14,7 +18,12 @@
retries: 2
delay: 0
- name: Use user input only if provided, otherwise keep the default
- name: Use user input only if provided, otherwise keep the default (IP)
ansible.builtin.set_fact:
lxc_ip_address: "{{ ip_result.user_input }}"
lxc_ip_address: "{{ ip_result.user_input.split('/') | first }}"
when: ip_result.user_input | length > 0
- name: Use user input only if provided, otherwise keep the default (netmask)
ansible.builtin.set_fact:
lxc_netmask: "{{ ip_result.user_input.split('/') | second }}"
when: ip_result.user_input | length > 0