From 33700d2b70a1f3fbfd412a0483865f930cb2facc Mon Sep 17 00:00:00 2001
From: Trygve Laugstøl <trygvis@inamo.no>
Date: Fri, 4 Jan 2019 08:54:42 +0100
Subject: wireguard: Updating DNS records.

---
 ansible/files/wireguard-dns-records-net1.yml | 28 ++++++++++++++++++++++++++--
 ansible/roles/wireguard/tasks/main.yml       |  5 +++--
 2 files changed, 29 insertions(+), 4 deletions(-)

diff --git a/ansible/files/wireguard-dns-records-net1.yml b/ansible/files/wireguard-dns-records-net1.yml
index 5a3665d..7546ada 100644
--- a/ansible/files/wireguard-dns-records-net1.yml
+++ b/ansible/files/wireguard-dns-records-net1.yml
@@ -1,4 +1,28 @@
 wireguard_dns_records_net1:
+  - type: A
+    name: akili
+    value: 192.168.80.7
+    state: present
+  - type: AAAA
+    name: akili
+    value: fdf3:aad9:a885:0b3a::7
+    state: present
+  - type: A
+    name: android-trygvis
+    value: 192.168.80.5
+    state: present
+  - type: AAAA
+    name: android-trygvis
+    value: fdf3:aad9:a885:0b3a::5
+    state: present
+  - type: A
+    name: arius
+    value: 192.168.80.6
+    state: present
+  - type: AAAA
+    name: arius
+    value: fdf3:aad9:a885:0b3a::6
+    state: present
   - type: A
     name: birgitte
     value: 192.168.80.2
@@ -10,11 +34,11 @@ wireguard_dns_records_net1:
   - type: A
     name: conflatorio
     value: 192.168.80.3
-    state: absent
+    state: present
   - type: AAAA
     name: conflatorio
     value: fdf3:aad9:a885:0b3a::3
-    state: absent
+    state: present
   - type: A
     name: fuckaduck
     value: 192.168.80.4
diff --git a/ansible/roles/wireguard/tasks/main.yml b/ansible/roles/wireguard/tasks/main.yml
index 80508a7..5330535 100644
--- a/ansible/roles/wireguard/tasks/main.yml
+++ b/ansible/roles/wireguard/tasks/main.yml
@@ -135,8 +135,9 @@
         proto: udp
 
 - name: generate dns records
-  tags: wireguard-dns-records
-  when: wireguard__role == 'server'
+  tags:
+    - wireguard
+    - wireguard-dns-records
   local_action:
     module: copy
     content: |
-- 
cgit v1.2.3