From 46934bb125c6b3fc53b1669cb5131f9c2f06ac0e Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Tue, 10 Sep 2019 08:48:57 +0200 Subject: wg0: Adding malabaricus. --- .../files/akili/etc/wireguard/public-wg-net1.key | 1 - .../android-trygvis/etc/wireguard/public-wg1.key | 1 - ansible/files/arius/etc/borg/id_ed25519.pub | 1 - .../arius/etc/wireguard/public-wg-hesland.key | 1 - .../files/arius/etc/wireguard/public-wg-net1.key | 1 - ansible/files/arius/etc/wireguard/public-wg0.key | 1 - ansible/files/birgitte/etc/borg/id_ed25519.pub | 1 - .../birgitte/etc/systemd/network/51-eth0.network | 5 --- .../birgitte/etc/wireguard/public-wg-net1.key | 1 - .../files/birgitte/etc/wireguard/public-wg0.key | 1 - ansible/files/conflatorio/etc/borg/id_ed25519.pub | 1 - .../etc/wireguard/public-wg-edipost.key | 1 - .../files/conflatorio/etc/wireguard/public-wg0.key | 1 - ansible/files/knot/etc/wireguard/public-wg0.key | 1 - ansible/files/knot/etc/wireguard/public-wg1.key | 1 - .../webgateway/etc/wireguard/public-wg-hesland.key | 1 - ansible/group_vars/all/wireguard_wg0.yml | 3 ++ ansible/inventory | 5 ++- .../files/akili/etc/wireguard/public-wg-net1.key | 1 + .../plays/files/akili/etc/wireguard/public-wg0.key | 1 + .../android-trygvis/etc/wireguard/public-wg1.key | 1 + ansible/plays/files/arius/etc/borg/id_ed25519.pub | 1 + .../arius/etc/wireguard/public-wg-hesland.key | 1 + .../files/arius/etc/wireguard/public-wg-net1.key | 1 + .../plays/files/arius/etc/wireguard/public-wg0.key | 1 + .../plays/files/birgitte/etc/borg/id_ed25519.pub | 1 + .../birgitte/etc/systemd/network/51-eth0.network | 5 +++ .../birgitte/etc/wireguard/public-wg-net1.key | 1 + .../files/birgitte/etc/wireguard/public-wg0.key | 1 + .../files/conflatorio/etc/borg/id_ed25519.pub | 1 + .../etc/wireguard/public-wg-edipost.key | 1 + .../files/conflatorio/etc/wireguard/public-wg0.key | 1 + .../plays/files/knot/etc/wireguard/public-wg0.key | 1 + .../plays/files/knot/etc/wireguard/public-wg1.key | 1 + .../files/malabaricus/etc/wireguard/public-wg0.key | 1 + .../webgateway/etc/wireguard/public-wg-hesland.key | 1 + ansible/plays/wireguard.yml | 44 ++++++++++++++++++++++ ansible/roles/wireguard/tasks/main.yml | 43 ++++++++------------- ansible/wireguard.yml | 44 ---------------------- 39 files changed, 88 insertions(+), 93 deletions(-) delete mode 100644 ansible/files/akili/etc/wireguard/public-wg-net1.key delete mode 100644 ansible/files/android-trygvis/etc/wireguard/public-wg1.key delete mode 100644 ansible/files/arius/etc/borg/id_ed25519.pub delete mode 100644 ansible/files/arius/etc/wireguard/public-wg-hesland.key delete mode 100644 ansible/files/arius/etc/wireguard/public-wg-net1.key delete mode 100644 ansible/files/arius/etc/wireguard/public-wg0.key delete mode 100644 ansible/files/birgitte/etc/borg/id_ed25519.pub delete mode 100644 ansible/files/birgitte/etc/systemd/network/51-eth0.network delete mode 100644 ansible/files/birgitte/etc/wireguard/public-wg-net1.key delete mode 100644 ansible/files/birgitte/etc/wireguard/public-wg0.key delete mode 100644 ansible/files/conflatorio/etc/borg/id_ed25519.pub delete mode 100644 ansible/files/conflatorio/etc/wireguard/public-wg-edipost.key delete mode 100644 ansible/files/conflatorio/etc/wireguard/public-wg0.key delete mode 100644 ansible/files/knot/etc/wireguard/public-wg0.key delete mode 100644 ansible/files/knot/etc/wireguard/public-wg1.key delete mode 100644 ansible/files/webgateway/etc/wireguard/public-wg-hesland.key create mode 100644 ansible/plays/files/akili/etc/wireguard/public-wg-net1.key create mode 100644 ansible/plays/files/akili/etc/wireguard/public-wg0.key create mode 100644 ansible/plays/files/android-trygvis/etc/wireguard/public-wg1.key create mode 100644 ansible/plays/files/arius/etc/borg/id_ed25519.pub create mode 100644 ansible/plays/files/arius/etc/wireguard/public-wg-hesland.key create mode 100644 ansible/plays/files/arius/etc/wireguard/public-wg-net1.key create mode 100644 ansible/plays/files/arius/etc/wireguard/public-wg0.key create mode 100644 ansible/plays/files/birgitte/etc/borg/id_ed25519.pub create mode 100644 ansible/plays/files/birgitte/etc/systemd/network/51-eth0.network create mode 100644 ansible/plays/files/birgitte/etc/wireguard/public-wg-net1.key create mode 100644 ansible/plays/files/birgitte/etc/wireguard/public-wg0.key create mode 100644 ansible/plays/files/conflatorio/etc/borg/id_ed25519.pub create mode 100644 ansible/plays/files/conflatorio/etc/wireguard/public-wg-edipost.key create mode 100644 ansible/plays/files/conflatorio/etc/wireguard/public-wg0.key create mode 100644 ansible/plays/files/knot/etc/wireguard/public-wg0.key create mode 100644 ansible/plays/files/knot/etc/wireguard/public-wg1.key create mode 100644 ansible/plays/files/malabaricus/etc/wireguard/public-wg0.key create mode 100644 ansible/plays/files/webgateway/etc/wireguard/public-wg-hesland.key create mode 100644 ansible/plays/wireguard.yml delete mode 100644 ansible/wireguard.yml diff --git a/ansible/files/akili/etc/wireguard/public-wg-net1.key b/ansible/files/akili/etc/wireguard/public-wg-net1.key deleted file mode 100644 index 31725d2..0000000 --- a/ansible/files/akili/etc/wireguard/public-wg-net1.key +++ /dev/null @@ -1 +0,0 @@ -g9j0a3WVjzjFXZFXxdI0zDOdLrmXNIdOppj06I+RtTI= diff --git a/ansible/files/android-trygvis/etc/wireguard/public-wg1.key b/ansible/files/android-trygvis/etc/wireguard/public-wg1.key deleted file mode 100644 index 4ab6833..0000000 --- a/ansible/files/android-trygvis/etc/wireguard/public-wg1.key +++ /dev/null @@ -1 +0,0 @@ -9SgKebI72gmwuglEQfSOp3CKrYprUXam6+9BbEPnEkU= diff --git a/ansible/files/arius/etc/borg/id_ed25519.pub b/ansible/files/arius/etc/borg/id_ed25519.pub deleted file mode 100644 index b4e14aa..0000000 --- a/ansible/files/arius/etc/borg/id_ed25519.pub +++ /dev/null @@ -1 +0,0 @@ -ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDjRKEgNV8t2WsejrR7C2nZTNd9x57/mwBj6FzubPf1C for borg @ arius diff --git a/ansible/files/arius/etc/wireguard/public-wg-hesland.key b/ansible/files/arius/etc/wireguard/public-wg-hesland.key deleted file mode 100644 index 3102f19..0000000 --- a/ansible/files/arius/etc/wireguard/public-wg-hesland.key +++ /dev/null @@ -1 +0,0 @@ -+h76BN8VCL/pZcDjhpSJXyTcLrUc7bPbB+aqwu892Gc= diff --git a/ansible/files/arius/etc/wireguard/public-wg-net1.key b/ansible/files/arius/etc/wireguard/public-wg-net1.key deleted file mode 100644 index 879fa3c..0000000 --- a/ansible/files/arius/etc/wireguard/public-wg-net1.key +++ /dev/null @@ -1 +0,0 @@ -mgHlZP+w0qhE8h1ryyl4SzLLbcQaOLpAT7+SpVULrXE= diff --git a/ansible/files/arius/etc/wireguard/public-wg0.key b/ansible/files/arius/etc/wireguard/public-wg0.key deleted file mode 100644 index a722138..0000000 --- a/ansible/files/arius/etc/wireguard/public-wg0.key +++ /dev/null @@ -1 +0,0 @@ -8OOM3+qqdyh3uoI6/1pA+9/ksYwNB7jUk9HZx13zsS0= diff --git a/ansible/files/birgitte/etc/borg/id_ed25519.pub b/ansible/files/birgitte/etc/borg/id_ed25519.pub deleted file mode 100644 index f4b79b5..0000000 --- a/ansible/files/birgitte/etc/borg/id_ed25519.pub +++ /dev/null @@ -1 +0,0 @@ -ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINVpbC77vXGiv1PYPRDpIC9GpRuQNQdYfKOTO1eBPQx7 for borg @ birgitte diff --git a/ansible/files/birgitte/etc/systemd/network/51-eth0.network b/ansible/files/birgitte/etc/systemd/network/51-eth0.network deleted file mode 100644 index 82831c5..0000000 --- a/ansible/files/birgitte/etc/systemd/network/51-eth0.network +++ /dev/null @@ -1,5 +0,0 @@ -[Match] -Name=eth0 - -[Network] -Bridge=lxc0-br diff --git a/ansible/files/birgitte/etc/wireguard/public-wg-net1.key b/ansible/files/birgitte/etc/wireguard/public-wg-net1.key deleted file mode 100644 index 22e2fe3..0000000 --- a/ansible/files/birgitte/etc/wireguard/public-wg-net1.key +++ /dev/null @@ -1 +0,0 @@ -A+6nNcP2bjlLYy6QG7swT4mHwiC8C2P4bCQvy1hV93E= diff --git a/ansible/files/birgitte/etc/wireguard/public-wg0.key b/ansible/files/birgitte/etc/wireguard/public-wg0.key deleted file mode 100644 index d595dff..0000000 --- a/ansible/files/birgitte/etc/wireguard/public-wg0.key +++ /dev/null @@ -1 +0,0 @@ -r/eymAwM7HDSJkkWSY2Ec7A+F8AQ7tuL0drD/OI1LyM= diff --git a/ansible/files/conflatorio/etc/borg/id_ed25519.pub b/ansible/files/conflatorio/etc/borg/id_ed25519.pub deleted file mode 100644 index 7bdbe0c..0000000 --- a/ansible/files/conflatorio/etc/borg/id_ed25519.pub +++ /dev/null @@ -1 +0,0 @@ -ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDOFPpZthu5br8GFccV9/RtMrm/A3hsM92g8IwSLli+J for borg @ conflatorio diff --git a/ansible/files/conflatorio/etc/wireguard/public-wg-edipost.key b/ansible/files/conflatorio/etc/wireguard/public-wg-edipost.key deleted file mode 100644 index dd3609c..0000000 --- a/ansible/files/conflatorio/etc/wireguard/public-wg-edipost.key +++ /dev/null @@ -1 +0,0 @@ -JwZ1bmkuCvZfzzVzWqpEt5+NRAQ/B3ciURg2Gg5jdVw= diff --git a/ansible/files/conflatorio/etc/wireguard/public-wg0.key b/ansible/files/conflatorio/etc/wireguard/public-wg0.key deleted file mode 100644 index f4cc915..0000000 --- a/ansible/files/conflatorio/etc/wireguard/public-wg0.key +++ /dev/null @@ -1 +0,0 @@ -170TWFqJLCfkw48ddLLnx7zWAo1qpx/AQf8Dar8mSXY= diff --git a/ansible/files/knot/etc/wireguard/public-wg0.key b/ansible/files/knot/etc/wireguard/public-wg0.key deleted file mode 100644 index 8caf3db..0000000 --- a/ansible/files/knot/etc/wireguard/public-wg0.key +++ /dev/null @@ -1 +0,0 @@ -cuUgTdFH1UEXpUH6V1nashdH7K/L+pl6dmJCpBWN+Xw= diff --git a/ansible/files/knot/etc/wireguard/public-wg1.key b/ansible/files/knot/etc/wireguard/public-wg1.key deleted file mode 100644 index 0b891d1..0000000 --- a/ansible/files/knot/etc/wireguard/public-wg1.key +++ /dev/null @@ -1 +0,0 @@ -LM3L40nY0FWMECG6oP8VWYDjWVkRLp3kK0fofP3W7S0= diff --git a/ansible/files/webgateway/etc/wireguard/public-wg-hesland.key b/ansible/files/webgateway/etc/wireguard/public-wg-hesland.key deleted file mode 100644 index e9aa962..0000000 --- a/ansible/files/webgateway/etc/wireguard/public-wg-hesland.key +++ /dev/null @@ -1 +0,0 @@ -BSuop+m0ca2zrJ+gZgawFP22tM/MJ2YXIol2kr8ETT4= diff --git a/ansible/group_vars/all/wireguard_wg0.yml b/ansible/group_vars/all/wireguard_wg0.yml index 42b149b..872c432 100644 --- a/ansible/group_vars/all/wireguard_wg0.yml +++ b/ansible/group_vars/all/wireguard_wg0.yml @@ -22,3 +22,6 @@ wireguard-wg0: akili: state: present ipv6: fdf3:aad9:a885:0b3a::7 + malabaricus: + state: present + ipv6: fdf3:aad9:a885:0b3a::8 diff --git a/ansible/inventory b/ansible/inventory index 638ee5b..5ae2af7 100644 --- a/ansible/inventory +++ b/ansible/inventory @@ -13,7 +13,7 @@ all: homepi: ansible_host: homepi.local malabaricus: - ansible_host: malabaricus.trygvis.io + ansible_host: 10.13.37.187 # malabaricus.trygvis.io conflatorio: ansible_host: conflatorio.trygvis.io akili: @@ -144,10 +144,11 @@ all: hosts: akili: arius: + astyanax: birgitte: conflatorio: knot: - astyanax: + malabaricus: wireguard_wg1: hosts: diff --git a/ansible/plays/files/akili/etc/wireguard/public-wg-net1.key b/ansible/plays/files/akili/etc/wireguard/public-wg-net1.key new file mode 100644 index 0000000..31725d2 --- /dev/null +++ b/ansible/plays/files/akili/etc/wireguard/public-wg-net1.key @@ -0,0 +1 @@ +g9j0a3WVjzjFXZFXxdI0zDOdLrmXNIdOppj06I+RtTI= diff --git a/ansible/plays/files/akili/etc/wireguard/public-wg0.key b/ansible/plays/files/akili/etc/wireguard/public-wg0.key new file mode 100644 index 0000000..f94a7b2 --- /dev/null +++ b/ansible/plays/files/akili/etc/wireguard/public-wg0.key @@ -0,0 +1 @@ +pFbHqAJuQPR+JwHDT6YT9pIpGPfDdhM1WU6RXfrZjCQ= diff --git a/ansible/plays/files/android-trygvis/etc/wireguard/public-wg1.key b/ansible/plays/files/android-trygvis/etc/wireguard/public-wg1.key new file mode 100644 index 0000000..4ab6833 --- /dev/null +++ b/ansible/plays/files/android-trygvis/etc/wireguard/public-wg1.key @@ -0,0 +1 @@ +9SgKebI72gmwuglEQfSOp3CKrYprUXam6+9BbEPnEkU= diff --git a/ansible/plays/files/arius/etc/borg/id_ed25519.pub b/ansible/plays/files/arius/etc/borg/id_ed25519.pub new file mode 100644 index 0000000..b4e14aa --- /dev/null +++ b/ansible/plays/files/arius/etc/borg/id_ed25519.pub @@ -0,0 +1 @@ +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDjRKEgNV8t2WsejrR7C2nZTNd9x57/mwBj6FzubPf1C for borg @ arius diff --git a/ansible/plays/files/arius/etc/wireguard/public-wg-hesland.key b/ansible/plays/files/arius/etc/wireguard/public-wg-hesland.key new file mode 100644 index 0000000..3102f19 --- /dev/null +++ b/ansible/plays/files/arius/etc/wireguard/public-wg-hesland.key @@ -0,0 +1 @@ ++h76BN8VCL/pZcDjhpSJXyTcLrUc7bPbB+aqwu892Gc= diff --git a/ansible/plays/files/arius/etc/wireguard/public-wg-net1.key b/ansible/plays/files/arius/etc/wireguard/public-wg-net1.key new file mode 100644 index 0000000..879fa3c --- /dev/null +++ b/ansible/plays/files/arius/etc/wireguard/public-wg-net1.key @@ -0,0 +1 @@ +mgHlZP+w0qhE8h1ryyl4SzLLbcQaOLpAT7+SpVULrXE= diff --git a/ansible/plays/files/arius/etc/wireguard/public-wg0.key b/ansible/plays/files/arius/etc/wireguard/public-wg0.key new file mode 100644 index 0000000..a722138 --- /dev/null +++ b/ansible/plays/files/arius/etc/wireguard/public-wg0.key @@ -0,0 +1 @@ +8OOM3+qqdyh3uoI6/1pA+9/ksYwNB7jUk9HZx13zsS0= diff --git a/ansible/plays/files/birgitte/etc/borg/id_ed25519.pub b/ansible/plays/files/birgitte/etc/borg/id_ed25519.pub new file mode 100644 index 0000000..f4b79b5 --- /dev/null +++ b/ansible/plays/files/birgitte/etc/borg/id_ed25519.pub @@ -0,0 +1 @@ +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINVpbC77vXGiv1PYPRDpIC9GpRuQNQdYfKOTO1eBPQx7 for borg @ birgitte diff --git a/ansible/plays/files/birgitte/etc/systemd/network/51-eth0.network b/ansible/plays/files/birgitte/etc/systemd/network/51-eth0.network new file mode 100644 index 0000000..82831c5 --- /dev/null +++ b/ansible/plays/files/birgitte/etc/systemd/network/51-eth0.network @@ -0,0 +1,5 @@ +[Match] +Name=eth0 + +[Network] +Bridge=lxc0-br diff --git a/ansible/plays/files/birgitte/etc/wireguard/public-wg-net1.key b/ansible/plays/files/birgitte/etc/wireguard/public-wg-net1.key new file mode 100644 index 0000000..22e2fe3 --- /dev/null +++ b/ansible/plays/files/birgitte/etc/wireguard/public-wg-net1.key @@ -0,0 +1 @@ +A+6nNcP2bjlLYy6QG7swT4mHwiC8C2P4bCQvy1hV93E= diff --git a/ansible/plays/files/birgitte/etc/wireguard/public-wg0.key b/ansible/plays/files/birgitte/etc/wireguard/public-wg0.key new file mode 100644 index 0000000..d595dff --- /dev/null +++ b/ansible/plays/files/birgitte/etc/wireguard/public-wg0.key @@ -0,0 +1 @@ +r/eymAwM7HDSJkkWSY2Ec7A+F8AQ7tuL0drD/OI1LyM= diff --git a/ansible/plays/files/conflatorio/etc/borg/id_ed25519.pub b/ansible/plays/files/conflatorio/etc/borg/id_ed25519.pub new file mode 100644 index 0000000..7bdbe0c --- /dev/null +++ b/ansible/plays/files/conflatorio/etc/borg/id_ed25519.pub @@ -0,0 +1 @@ +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDOFPpZthu5br8GFccV9/RtMrm/A3hsM92g8IwSLli+J for borg @ conflatorio diff --git a/ansible/plays/files/conflatorio/etc/wireguard/public-wg-edipost.key b/ansible/plays/files/conflatorio/etc/wireguard/public-wg-edipost.key new file mode 100644 index 0000000..dd3609c --- /dev/null +++ b/ansible/plays/files/conflatorio/etc/wireguard/public-wg-edipost.key @@ -0,0 +1 @@ +JwZ1bmkuCvZfzzVzWqpEt5+NRAQ/B3ciURg2Gg5jdVw= diff --git a/ansible/plays/files/conflatorio/etc/wireguard/public-wg0.key b/ansible/plays/files/conflatorio/etc/wireguard/public-wg0.key new file mode 100644 index 0000000..f4cc915 --- /dev/null +++ b/ansible/plays/files/conflatorio/etc/wireguard/public-wg0.key @@ -0,0 +1 @@ +170TWFqJLCfkw48ddLLnx7zWAo1qpx/AQf8Dar8mSXY= diff --git a/ansible/plays/files/knot/etc/wireguard/public-wg0.key b/ansible/plays/files/knot/etc/wireguard/public-wg0.key new file mode 100644 index 0000000..8caf3db --- /dev/null +++ b/ansible/plays/files/knot/etc/wireguard/public-wg0.key @@ -0,0 +1 @@ +cuUgTdFH1UEXpUH6V1nashdH7K/L+pl6dmJCpBWN+Xw= diff --git a/ansible/plays/files/knot/etc/wireguard/public-wg1.key b/ansible/plays/files/knot/etc/wireguard/public-wg1.key new file mode 100644 index 0000000..0b891d1 --- /dev/null +++ b/ansible/plays/files/knot/etc/wireguard/public-wg1.key @@ -0,0 +1 @@ +LM3L40nY0FWMECG6oP8VWYDjWVkRLp3kK0fofP3W7S0= diff --git a/ansible/plays/files/malabaricus/etc/wireguard/public-wg0.key b/ansible/plays/files/malabaricus/etc/wireguard/public-wg0.key new file mode 100644 index 0000000..6fe02dc --- /dev/null +++ b/ansible/plays/files/malabaricus/etc/wireguard/public-wg0.key @@ -0,0 +1 @@ +spjhTSR22/RyPy7D2AnMLLzzHuasXD6W4J5Xwuo+UTQ= diff --git a/ansible/plays/files/webgateway/etc/wireguard/public-wg-hesland.key b/ansible/plays/files/webgateway/etc/wireguard/public-wg-hesland.key new file mode 100644 index 0000000..e9aa962 --- /dev/null +++ b/ansible/plays/files/webgateway/etc/wireguard/public-wg-hesland.key @@ -0,0 +1 @@ +BSuop+m0ca2zrJ+gZgawFP22tM/MJ2YXIol2kr8ETT4= diff --git a/ansible/plays/wireguard.yml b/ansible/plays/wireguard.yml new file mode 100644 index 0000000..26ee9ff --- /dev/null +++ b/ansible/plays/wireguard.yml @@ -0,0 +1,44 @@ +- hosts: + - wireguard_wg_net1 + tags: + - never + - wg-net1 + roles: + - role: wireguard + wireguard__state: absent + wireguard__name: wireguard_wg_net1 + +- hosts: + - wireguard_wg0 + tags: wg0 + roles: + - role: wireguard + wireguard__name: wireguard-wg0 + vars: + wg_net: "{{ hostvars[ansible_hostname][wireguard__name] }}" + wg_host: "{{ wg_net.hosts[ansible_hostname] }}" + +- hosts: + - wireguard_wg1 + tags: wg1 + roles: + - role: wireguard + wireguard__name: wireguard-wg1 + +- hosts: + - wireguard_hesland + tags: wg_hesland + roles: + - role: wireguard + wireguard__name: wireguard_wg_hesland + wireguard__state: absent + +- hosts: + - wireguard_edipost + tags: wg_edipost + roles: + - role: wireguard + wireguard__name: wireguard_wg_edipost + wireguard__state: absent + vars: + wg_net: "{{ hostvars[ansible_hostname][wireguard__name] }}" diff --git a/ansible/roles/wireguard/tasks/main.yml b/ansible/roles/wireguard/tasks/main.yml index 787c67c..62d64ce 100644 --- a/ansible/roles/wireguard/tasks/main.yml +++ b/ansible/roles/wireguard/tasks/main.yml @@ -12,12 +12,23 @@ - name: Install packages tags: packages apt: - name: "{{ items }}" - install_recommends: no - vars: - items: + name: - wireguard - - "{{ 'linux-headers-amd64' if ansible_architecture == 'x86_64' else 'linux-headers-686-pae' }}" + install_recommends: no + - name: Install packages (amd64) + tags: packages + apt: + name: + - linux-headers-amd64 + install_recommends: no + when: ansible_architecture == 'x86_64' + - name: Install packages (i686) + tags: packages + apt: + name: + - linux-headers-i686-pae + install_recommends: no + when: ansible_architecture == 'i686' - name: systemctl enable systemd-networkd systemd: @@ -153,25 +164,3 @@ when: links[wg_net.if] is defined vars: links: "{{ ip_link.stdout | from_json | items2dict(key_name='ifname', value_name='ifname') }}" - -- name: generate dns records - tags: -# - wireguard -# - wireguard-dns-records - - never - local_action: - module: copy - content: | - wireguard_dns_records_{{ wg_net.if }}: - {% for c in wireguard__clients|sort %} - {% set client = wireguard__clients[c] %} - - type: A - name: {{ c }} - value: {{ client.ipv4 }} - state: {{ client.state }} - - type: AAAA - name: {{ c }} - value: {{ client.ipv6 }} - state: {{ client.state }} - {% endfor %} - dest: "files/wireguard-dns-records-{{ wg_net.if }}.yml" diff --git a/ansible/wireguard.yml b/ansible/wireguard.yml deleted file mode 100644 index 26ee9ff..0000000 --- a/ansible/wireguard.yml +++ /dev/null @@ -1,44 +0,0 @@ -- hosts: - - wireguard_wg_net1 - tags: - - never - - wg-net1 - roles: - - role: wireguard - wireguard__state: absent - wireguard__name: wireguard_wg_net1 - -- hosts: - - wireguard_wg0 - tags: wg0 - roles: - - role: wireguard - wireguard__name: wireguard-wg0 - vars: - wg_net: "{{ hostvars[ansible_hostname][wireguard__name] }}" - wg_host: "{{ wg_net.hosts[ansible_hostname] }}" - -- hosts: - - wireguard_wg1 - tags: wg1 - roles: - - role: wireguard - wireguard__name: wireguard-wg1 - -- hosts: - - wireguard_hesland - tags: wg_hesland - roles: - - role: wireguard - wireguard__name: wireguard_wg_hesland - wireguard__state: absent - -- hosts: - - wireguard_edipost - tags: wg_edipost - roles: - - role: wireguard - wireguard__name: wireguard_wg_edipost - wireguard__state: absent - vars: - wg_net: "{{ hostvars[ansible_hostname][wireguard__name] }}" -- cgit v1.2.3