diff options
author | Niklas Yann Wettengel <niyawe@niyawe.de> | 2017-07-05 12:37:39 +0200 |
---|---|---|
committer | Niklas Yann Wettengel <niyawe@niyawe.de> | 2017-07-05 12:37:39 +0200 |
commit | 739f97d85908baba47589bb7466a7d559b4424b2 (patch) | |
tree | 1498ac048448f8ff53b71017d35d1f89ed08dd4d /roles/install_wireguard_mesh/tasks/main.yml | |
parent | d82f8524972086862f64750f325ba067ea993d86 (diff) |
wireguard site mesh
Diffstat (limited to 'roles/install_wireguard_mesh/tasks/main.yml')
-rw-r--r-- | roles/install_wireguard_mesh/tasks/main.yml | 28 |
1 files changed, 28 insertions, 0 deletions
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 }}" |