aboutsummaryrefslogtreecommitdiffstats
path: root/roles/wireguard/tasks/configuration.yml
diff options
context:
space:
mode:
authorRomain Gonçalves <me@rgoncalves.se>2021-12-10 18:30:32 +0000
committerRomain Gonçalves <me@rgoncalves.se>2021-12-10 21:52:55 +0000
commitc1c300aa21b407351e6045c7b40480d4120db8a7 (patch)
tree48ac6715e649326d02dad7011b31c091db29b7b3 /roles/wireguard/tasks/configuration.yml
parent2fe1965dbb4cc650fda2b00e69219ac7ae403674 (diff)
downloadrules-c1c300aa21b407351e6045c7b40480d4120db8a7.tar.gz
roles: Generate + deploy wireguard configurations
Diffstat (limited to 'roles/wireguard/tasks/configuration.yml')
-rw-r--r--roles/wireguard/tasks/configuration.yml18
1 files changed, 18 insertions, 0 deletions
diff --git a/roles/wireguard/tasks/configuration.yml b/roles/wireguard/tasks/configuration.yml
new file mode 100644
index 0000000..efb8008
--- /dev/null
+++ b/roles/wireguard/tasks/configuration.yml
@@ -0,0 +1,18 @@
+- name: generate wireguard configuration
+ template:
+ src: wireguard.conf.j2
+ dest: "{{ wireguard_local_dir }}/{{ item }}.conf"
+ mode: 0600
+ vars:
+ host: "{{ hostvars[item] }}"
+ run_once: true
+ delegate_to: localhost
+ loop: "{{ groups.all }}"
+
+- name: copy wireguard configuration
+ copy:
+ src: "{{ wireguard_local_dir }}/{{ wireguard_local_configuration }}"
+ dest: "{{ wireguard_dir }}/{{ wireguard_domain_controller }}.conf"
+ owner: 0
+ group: 0
+ mode: 0600
remember that computers suck.