feat(pb): adds IP address validation for LXC and VM deployment #26
@@ -42,6 +42,14 @@
|
|||||||
when: not lxc_hostname is regex('^[a-zA-Z0-9-]+$')
|
when: not lxc_hostname is regex('^[a-zA-Z0-9-]+$')
|
||||||
run_once: true
|
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:
|
||||||
- ../roles/deploy_lxc_on_proxmox
|
- ../roles/deploy_lxc_on_proxmox
|
||||||
|
|
||||||
|
|||||||
@@ -40,6 +40,14 @@
|
|||||||
when: not vm_hostname is regex('^[a-zA-Z0-9-]+$')
|
when: not vm_hostname is regex('^[a-zA-Z0-9-]+$')
|
||||||
run_once: true
|
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
|
- name: Validate OS template
|
||||||
ansible.builtin.fail:
|
ansible.builtin.fail:
|
||||||
msg: |
|
msg: |
|
||||||
|
|||||||
Reference in New Issue
Block a user