From e22c27b549ec1bfe7af7ae212839e0c81080cd3c Mon Sep 17 00:00:00 2001 From: Dmitry Ilvokhin Date: Sat, 15 Jun 2024 19:19:47 +0100 Subject: Rename wg0 interface to wgnet0 --- roles/wgnet/handlers/main.yml | 2 +- roles/wgnet/tasks/main.yml | 6 +++--- roles/wgnet/templates/wg0.conf.j2 | 14 -------------- roles/wgnet/templates/wgnet0.conf.j2 | 14 ++++++++++++++ 4 files changed, 18 insertions(+), 18 deletions(-) delete mode 100644 roles/wgnet/templates/wg0.conf.j2 create mode 100644 roles/wgnet/templates/wgnet0.conf.j2 (limited to 'roles') diff --git a/roles/wgnet/handlers/main.yml b/roles/wgnet/handlers/main.yml index 214b6db..f95f1cd 100644 --- a/roles/wgnet/handlers/main.yml +++ b/roles/wgnet/handlers/main.yml @@ -2,5 +2,5 @@ # is enough. - name: Reload wgnet ansible.builtin.service: - name: wg-quick@wg0 + name: wg-quick@wgnet0 state: reloaded diff --git a/roles/wgnet/tasks/main.yml b/roles/wgnet/tasks/main.yml index 9156fde..c7ca9bb 100644 --- a/roles/wgnet/tasks/main.yml +++ b/roles/wgnet/tasks/main.yml @@ -1,7 +1,7 @@ - name: Configure WireGuard for wgnet ansible.builtin.template: - src: templates/wg0.conf.j2 - dest: /etc/wireguard/wg0.conf + src: templates/wgnet0.conf.j2 + dest: /etc/wireguard/wgnet0.conf owner: root group: root # Config containes private key for this host, so permissions are @@ -11,6 +11,6 @@ - name: Enable WireGuard service for wgnet ansible.builtin.service: - name: wg-quick@wg0 + name: wg-quick@wgnet0 enabled: yes state: started diff --git a/roles/wgnet/templates/wg0.conf.j2 b/roles/wgnet/templates/wg0.conf.j2 deleted file mode 100644 index f79b2b4..0000000 --- a/roles/wgnet/templates/wg0.conf.j2 +++ /dev/null @@ -1,14 +0,0 @@ -[Interface] -PrivateKey = {{ wireguard_private_key }} -Address = 10.0.0.1/24 -ListenPort = 51820 - -# flame -[Peer] -PublicKey = YUuBBTKHXsD6tTzcAVWXakZffWKlGS5fAdx7zWSXtlI= -AllowedIPs = 10.0.0.2/32 - -# water -[Peer] -PublicKey = X0Gw37N+AUkZjiyZ9buZ8c2ZzFr+niX3FZjxlyqQq0Q= -AllowedIPs = 10.0.0.3/32 diff --git a/roles/wgnet/templates/wgnet0.conf.j2 b/roles/wgnet/templates/wgnet0.conf.j2 new file mode 100644 index 0000000..f79b2b4 --- /dev/null +++ b/roles/wgnet/templates/wgnet0.conf.j2 @@ -0,0 +1,14 @@ +[Interface] +PrivateKey = {{ wireguard_private_key }} +Address = 10.0.0.1/24 +ListenPort = 51820 + +# flame +[Peer] +PublicKey = YUuBBTKHXsD6tTzcAVWXakZffWKlGS5fAdx7zWSXtlI= +AllowedIPs = 10.0.0.2/32 + +# water +[Peer] +PublicKey = X0Gw37N+AUkZjiyZ9buZ8c2ZzFr+niX3FZjxlyqQq0Q= +AllowedIPs = 10.0.0.3/32 -- cgit v1.2.3-70-g09d2