From a7948364cd3d9851fd9e416e04e99523ce4681b4 Mon Sep 17 00:00:00 2001 From: Justus Grunow Date: Tue, 17 Dec 2024 06:39:52 -0500 Subject: [PATCH] Moved Wireguard server to wireguard container --- ansible/assets/{docker-int => wireguard}/wg0.conf.j2 | 1 + ansible/buildHomelab.yaml | 4 ++-- ansible/inventory/hosts.yaml | 2 +- ansible/roles/bastion/tasks/main.yml | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) rename ansible/assets/{docker-int => wireguard}/wg0.conf.j2 (99%) diff --git a/ansible/assets/docker-int/wg0.conf.j2 b/ansible/assets/wireguard/wg0.conf.j2 similarity index 99% rename from ansible/assets/docker-int/wg0.conf.j2 rename to ansible/assets/wireguard/wg0.conf.j2 index 2430507..139dad3 100644 --- a/ansible/assets/docker-int/wg0.conf.j2 +++ b/ansible/assets/wireguard/wg0.conf.j2 @@ -11,6 +11,7 @@ ListenPort = 51820 PublicKey = /A0WduzRrt/LwKmGm6lq/+TS/1gBekU86FSdhvUo82M= AllowedIPs = 10.11.19.4 +#Work [Peer] PublicKey = eEHA7CSOR5nha9w4SCB+tOXcuCxgkxIXtNU3xB7wZn4= AllowedIPs = 10.11.19.5/32 diff --git a/ansible/buildHomelab.yaml b/ansible/buildHomelab.yaml index 7f22831..87883e1 100644 --- a/ansible/buildHomelab.yaml +++ b/ansible/buildHomelab.yaml @@ -107,8 +107,8 @@ backup: true -- name: Setup docker-int wireguard - hosts: docker-int +- name: Setup Wireguard wireguard + hosts: wireguard vars: tags: - wireguard diff --git a/ansible/inventory/hosts.yaml b/ansible/inventory/hosts.yaml index 8709c52..398d085 100644 --- a/ansible/inventory/hosts.yaml +++ b/ansible/inventory/hosts.yaml @@ -23,7 +23,7 @@ docker: wireguard: hosts: - docker-int: + wireguard: external_access: hosts: diff --git a/ansible/roles/bastion/tasks/main.yml b/ansible/roles/bastion/tasks/main.yml index 1b0254d..7713712 100644 --- a/ansible/roles/bastion/tasks/main.yml +++ b/ansible/roles/bastion/tasks/main.yml @@ -7,6 +7,7 @@ ansible.builtin.package: name: wireguard state: present + update_cache: true - name: Shutdown Wireguard (remove iptables rules) ansible.builtin.shell: wg-quick down wg0 ignore_errors: true