aboutsummaryrefslogtreecommitdiff
path: root/ansible/roles/wireguard
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2019-09-10 08:48:57 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2019-09-10 08:48:57 +0200
commit46934bb125c6b3fc53b1669cb5131f9c2f06ac0e (patch)
tree9a9b5032c922f8241b6821b58fd2629e72003057 /ansible/roles/wireguard
parent918d066bfdee300e87a4c5777de6125bf62c76b2 (diff)
downloadinfra-46934bb125c6b3fc53b1669cb5131f9c2f06ac0e.tar.gz
infra-46934bb125c6b3fc53b1669cb5131f9c2f06ac0e.tar.bz2
infra-46934bb125c6b3fc53b1669cb5131f9c2f06ac0e.tar.xz
infra-46934bb125c6b3fc53b1669cb5131f9c2f06ac0e.zip
wg0: Adding malabaricus.
Diffstat (limited to 'ansible/roles/wireguard')
-rw-r--r--ansible/roles/wireguard/tasks/main.yml43
1 files changed, 16 insertions, 27 deletions
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"