aboutsummaryrefslogtreecommitdiffstats
path: root/roles/wireguard/tasks/service.yml
diff options
context:
space:
mode:
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.