aboutsummaryrefslogtreecommitdiffstats
path: root/roles/wireguard/tasks/service.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/service.yml
parent2fe1965dbb4cc650fda2b00e69219ac7ae403674 (diff)
downloadrules-c1c300aa21b407351e6045c7b40480d4120db8a7.tar.gz
roles: Generate + deploy wireguard configurations
Diffstat (limited to 'roles/wireguard/tasks/service.yml')
-rw-r--r--roles/wireguard/tasks/service.yml20
1 files changed, 20 insertions, 0 deletions
diff --git a/roles/wireguard/tasks/service.yml b/roles/wireguard/tasks/service.yml
new file mode 100644
index 0000000..d1a1007
--- /dev/null
+++ b/roles/wireguard/tasks/service.yml
@@ -0,0 +1,20 @@
+- name: enable wireguard interface for OpenBSD
+ lineinfile:
+ path: /etc/rc.local
+ regexp: "^/usr/local/bin/wg-quick up {{ wireguard_domain_controller }}$"
+ line: "/usr/local/bin/wg-quick up {{ wireguard_domain_controller }}"
+ owner: 0
+ owner: 0
+ create: true
+ mode: 0644
+ when: ansible_distribution == "OpenBSD"
+
+- name: restart wireguard interface
+ command: wg-quick "{{ item }}" "{{ wireguard_domain_controller }}"
+ ignore_errors: true
+ loop:
+ - down
+ - up
+ loop_control:
+ pause: 5
+ when: ansible_distribution == "OpenBSD"
remember that computers suck.