feat(pb): adds IP address validation for LXC and VM deployment #26

Merged
max merged 1 commits from issue-11-ip-validation into dev 2026-09-15 14:28:28 +04:00
2 changed files with 16 additions and 0 deletions
@@ -42,6 +42,14 @@
when: not lxc_hostname is regex('^[a-zA-Z0-9-]+$')
run_once: true
- name: Validate IP address
ansible.builtin.fail:
msg: |
Invalid IP address: "{{ lxc_ip_address }}"
IP address must be in x.x.x.x/x format (e.g., 192.168.0.90/24).
when: not lxc_ip_address is regex('^((25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(25[0-5]|2[0-4]\\d|[01]?\\d\\d?)(\\/(3[0-2]|[12]?\\d))?$')
run_once: true
roles:
- ../roles/deploy_lxc_on_proxmox
+8
View File
@@ -40,6 +40,14 @@
when: not vm_hostname is regex('^[a-zA-Z0-9-]+$')
run_once: true
- name: Validate IP address
ansible.builtin.fail:
msg: |
Invalid IP address: "{{ vm_ip_address }}"
IP address must be in x.x.x.x/x format (e.g., 192.168.0.89/24).
when: not vm_ip_address is regex('^((25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(25[0-5]|2[0-4]\\d|[01]?\\d\\d?)(\\/(3[0-2]|[12]?\\d))?$')
run_once: true
- name: Validate OS template
ansible.builtin.fail:
msg: |