aboutsummaryrefslogtreecommitdiff
path: root/tasks/preflight.yaml
diff options
context:
space:
mode:
Diffstat (limited to 'tasks/preflight.yaml')
-rw-r--r--tasks/preflight.yaml20
1 files changed, 20 insertions, 0 deletions
diff --git a/tasks/preflight.yaml b/tasks/preflight.yaml
index 6c67ae7..eec97e3 100644
--- a/tasks/preflight.yaml
+++ b/tasks/preflight.yaml
@@ -15,3 +15,23 @@
msg: "distribution not Debian-based"
when: dpkg_check.rc != 0
+
+- name: check nat_subnet format
+ fail:
+ msg: "nat_subnet must be in CIDR format, e.g., 10.10.10.0/24"
+ when: nat_subnet is not match("^(\\d{1,3}\\.){3}\\d{1,3}/\\d{1,2}$")
+
+- name: check nat_bridge_ip is valid ip
+ fail:
+ msg: "nat_bridge_ip must be a valid IPv4 address"
+ when: nat_bridge_ip is not match("^(\\d{1,3}\\.){3}\\d{1,3}$")
+
+- name: check wg_subnet format
+ fail:
+ msg: "wg_subnet must be in CIDR format, e.g., 10.13.37.0/24"
+ when: wg_subnet is not match("^(\\d{1,3}\\.){3}\\d{1,3}/\\d{1,2}$")
+
+- name: check wg_port is between 1024 and 65535
+ fail:
+ msg: "wg_port must be a number between 1024 and 65535"
+ when: wg_port | int < 1024 or wg_port | int > 65535