feat(pb): adds IP address validation for LXC and VM deployment
This commit was merged in pull request #26.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user