From 2db606151602a391c7c2f1e63dfc7a0181849ae9 Mon Sep 17 00:00:00 2001 From: vincent Date: Sun, 4 Feb 2024 21:22:20 +0100 Subject: [PATCH] fix: declare main interface variable for stagging --- ansible/host_vars/gerard-dev | 8 ++++++-- ansible/host_vars/merlin-dev | 8 ++++++-- ansible/host_vars/nas-dev | 7 +++++-- ansible/host_vars/oscar-dev | 7 +++++-- 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/ansible/host_vars/gerard-dev b/ansible/host_vars/gerard-dev index 9e8e135..bd1a292 100644 --- a/ansible/host_vars/gerard-dev +++ b/ansible/host_vars/gerard-dev @@ -1,4 +1,8 @@ --- + +default_interface: eth0 +vault_iface: "{{ default_interface}}" +ansible_host: gerard-dev.ducamps-dev.eu wireguard_address: "10.0.1.6/24" perrsistent_keepalive: "20" wireguard_endpoint: "" @@ -6,10 +10,10 @@ wireguard_endpoint: "" wireguard_postup: - iptables -A FORWARD -i wg0 -j ACCEPT - iptables -A FORWARD -o wg0 -j ACCEPT - - iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE + - iptables -t nat -A POSTROUTING -o {{ default_interface }} -j MASQUERADE wireguard_postdown: - iptables -D FORWARD -i wg0 -j ACCEPT - iptables -D FORWARD -o wg0 -j ACCEPT - - iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE + - iptables -t nat -D POSTROUTING -o {{ default_interface}} -j MASQUERADE diff --git a/ansible/host_vars/merlin-dev b/ansible/host_vars/merlin-dev index 6446b7c..af375a9 100644 --- a/ansible/host_vars/merlin-dev +++ b/ansible/host_vars/merlin-dev @@ -1,4 +1,8 @@ --- + +ansible_host: merlin-dev.ducamps-dev.eu +default_interface: eth0 +vault_iface: "{{ default_interface}}" wireguard_address: "10.0.1.4/24" wireguard_endpoint: "{{ ansible_default_ipv4.address }}" wireguard_persistent_keepalive: "30" @@ -6,12 +10,12 @@ wireguard_persistent_keepalive: "30" wireguard_postup: - iptables -A FORWARD -o %i -j ACCEPT - iptables -A FORWARD -i %i -j ACCEPT - - iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE + - iptables -t nat -A POSTROUTING -o {{ default_interface }} -j MASQUERADE wireguard_postdown: - iptables -D FORWARD -i %i -j ACCEPT - iptables -D FORWARD -o %i -j ACCEPT - - iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE + - iptables -t nat -D POSTROUTING -o {{ default_interface }} -j MASQUERADE wireguard_unmanaged_peers: phone: diff --git a/ansible/host_vars/nas-dev b/ansible/host_vars/nas-dev index dafbc45..8de97ee 100644 --- a/ansible/host_vars/nas-dev +++ b/ansible/host_vars/nas-dev @@ -1,4 +1,7 @@ --- +ansible_host: nas-dev.ducamps-dev.eu +default_interface: eth0 +vault_iface: "{{ default_interface}}" wireguard_address: "10.0.1.8/24" perrsistent_keepalive: "30" wireguard_endpoint: "" @@ -6,9 +9,9 @@ wireguard_endpoint: "" wireguard_postup: - iptables -A FORWARD -i wg0 -j ACCEPT - iptables -A FORWARD -o wg0 -j ACCEPT - - iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE + - iptables -t nat -A POSTROUTING -o {{ default_interface }} -j MASQUERADE wireguard_postdown: - iptables -D FORWARD -i wg0 -j ACCEPT - iptables -D FORWARD -o wg0 -j ACCEPT - - iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE + - iptables -t nat -D POSTROUTING -o {{ default_interface }} -j MASQUERADE diff --git a/ansible/host_vars/oscar-dev b/ansible/host_vars/oscar-dev index 3600348..5b06971 100644 --- a/ansible/host_vars/oscar-dev +++ b/ansible/host_vars/oscar-dev @@ -1,4 +1,7 @@ --- +ansible_host: oscar-dev.ducamps-dev.eu +default_interface: eth0 +vault_iface: "{{ default_interface}}" wireguard_address: "10.0.1.2/24" perrsistent_keepalive: "30" wireguard_endpoint: "" @@ -6,9 +9,9 @@ wireguard_endpoint: "" wireguard_postup: - iptables -A FORWARD -i wg0 -j ACCEPT - iptables -A FORWARD -o wg0 -j ACCEPT - - iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE + - iptables -t nat -A POSTROUTING -o {{ default_interface }} -j MASQUERADE wireguard_postdown: - iptables -D FORWARD -i wg0 -j ACCEPT - iptables -D FORWARD -o wg0 -j ACCEPT - - iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE + - iptables -t nat -D POSTROUTING -o {{ default_interface }} -j MASQUERADE