From 739f97d85908baba47589bb7466a7d559b4424b2 Mon Sep 17 00:00:00 2001 From: Niklas Yann Wettengel Date: Wed, 5 Jul 2017 12:37:39 +0200 Subject: wireguard site mesh --- roles/install_wireguard_mesh/tasks/main.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 roles/install_wireguard_mesh/tasks/main.yml (limited to 'roles/install_wireguard_mesh/tasks/main.yml') diff --git a/roles/install_wireguard_mesh/tasks/main.yml b/roles/install_wireguard_mesh/tasks/main.yml new file mode 100644 index 0000000..1672769 --- /dev/null +++ b/roles/install_wireguard_mesh/tasks/main.yml @@ -0,0 +1,28 @@ +--- +- name: create wireguard config for sites + template: + src: wg.conf.j2 + dest: /etc/wireguard/wg{{ item.name }}.conf + mode: 0400 + with_items: "{{ sites }}" + +- name: create wireguard up scripts for sites + template: + src: up.sh.j2 + dest: /etc/wireguard/up{{ item.name }}.sh + mode: 0744 + with_items: "{{ sites }}" + +- name: create wireguard down scripts for sites + template: + src: down.sh.j2 + dest: /etc/wireguard/down{{ item.name }}.sh + mode: 0744 + with_items: "{{ sites }}" + +- name: start and enable wireguard mesh + systemd: + name: wg-quick@wg{{ item.name }}.service + enabled: yes + state: started + with_items: "{{ sites }}" -- cgit v1.2.3-54-g00ecf