summaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
authorAhmed Abdelhalim <[email protected]>2025-09-02 01:32:34 +0200
committerAhmed Abdelhalim <[email protected]>2025-09-02 01:32:34 +0200
commit4c59a5a3d07ab0aa72aed3663823bbf69eec647e (patch)
tree327e241b0d171c4152a3c263767bd7e6085cc706 /roles
parent744d2521ffc1c68fc0328731275c9fc7751f366d (diff)
Fix testing wireguard gateway role on CI
Diffstat (limited to 'roles')
-rw-r--r--roles/wireguard_gateway/tasks/main.yml6
1 files changed, 6 insertions, 0 deletions
diff --git a/roles/wireguard_gateway/tasks/main.yml b/roles/wireguard_gateway/tasks/main.yml
index 14f31f54..bfd54886 100644
--- a/roles/wireguard_gateway/tasks/main.yml
+++ b/roles/wireguard_gateway/tasks/main.yml
@@ -31,6 +31,7 @@
jump: "MASQUERADE"
comment: "NAT local subnet traffic through VPN"
state: "{{ 'present' if wireguard_gateway_enabled else 'absent' }}"
+ when: ansible_default_ipv4.address is defined
- name: "Add IPv4 FORWARD rule to accept traffic from local subnet"
become: true
@@ -40,6 +41,7 @@
jump: "ACCEPT"
comment: "Allow forwarding from local subnet"
state: "{{ 'present' if wireguard_gateway_enabled else 'absent' }}"
+ when: ansible_default_ipv4.address is defined
- name: "Add IPv4 FORWARD rule to accept established connections"
become: true
@@ -50,6 +52,7 @@
jump: "ACCEPT"
comment: "Allow established connections"
state: "{{ 'present' if wireguard_gateway_enabled else 'absent' }}"
+ when: ansible_default_ipv4.address is defined
# IPv6 iptables rules
- name: "Add IPv6 NAT masquerading for traffic through VPN"
@@ -63,6 +66,7 @@
comment: "NAT IPv6 local subnet traffic through VPN"
ip_version: "ipv6"
state: "{{ 'present' if wireguard_gateway_enabled else 'absent' }}"
+ when: ansible_default_ipv6.address is defined
- name: "Add IPv6 FORWARD rule to accept traffic from local subnet"
become: true
@@ -73,6 +77,7 @@
comment: "Allow IPv6 forwarding from local subnet"
ip_version: "ipv6"
state: "{{ 'present' if wireguard_gateway_enabled else 'absent' }}"
+ when: ansible_default_ipv6.address is defined
- name: "Add IPv6 FORWARD rule to accept established connections"
become: true
@@ -84,3 +89,4 @@
comment: "Allow IPv6 established connections"
ip_version: "ipv6"
state: "{{ 'present' if wireguard_gateway_enabled else 'absent' }}"
+ when: ansible_default_ipv6.address is defined