From 31e20606e04c127df1d83443d14caff264cc5aa3 Mon Sep 17 00:00:00 2001
From: Antwan <antoine.blancy@etu.hesge.ch>
Date: Mon, 11 Apr 2022 21:57:03 +0200
Subject: [PATCH] a

---
 templates/wg | 3 +--
 wg.yml       | 4 ++--
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/templates/wg b/templates/wg
index 737dc3d..68b6d00 100644
--- a/templates/wg
+++ b/templates/wg
@@ -1,10 +1,9 @@
 [Interface]
-
 Address = {{ myAddr }}
 PostUp = wg set %i private-key privatekey
 ListenPort = 51902
 
 [Peer]
-PublicKey = {{  }}
+PublicKey = {{ publickey }}
 Endpoint = {{ dst }}:51888
 AllowedIPs = 10.0.0.0/24
diff --git a/wg.yml b/wg.yml
index c189e7c..0145cd4 100644
--- a/wg.yml
+++ b/wg.yml
@@ -3,7 +3,7 @@
   roles:
     - role: wg
       vars:
-        server_pubkey: "{{ hostvars[h2].publickey }}" 
+        publickey: "{{ hostvars[h2].publickey }}" 
         myAddr: 10.0.0.1
         dst: 10.0.3.2
 
@@ -12,7 +12,7 @@
   roles:
     - role: wg
       vars:
-        server_pubkey: "{{ hostvars[h2].publickey }}" 
+        publickey: "{{ hostvars[h1].publickey }}" 
         myAddr: 10.0.0.2
         dst: 10.0.1.2
 
-- 
GitLab