aboutsummaryrefslogtreecommitdiffstats
path: root/roles/wireguard
diff options
context:
space:
mode:
Diffstat (limited to 'roles/wireguard')
-rw-r--r--roles/wireguard/tasks/main.yml24
1 files changed, 24 insertions, 0 deletions
diff --git a/roles/wireguard/tasks/main.yml b/roles/wireguard/tasks/main.yml
index 51b97c0..5ae3a97 100644
--- a/roles/wireguard/tasks/main.yml
+++ b/roles/wireguard/tasks/main.yml
@@ -54,6 +54,30 @@
- { name: "{{ ansible_host }}", path: /etc/wireguard/dcontroller.conf }
- { name: localhost, path: "{{ wg_dir }}/{{ ansible_host }}.conf" }
+- name: enable wireguard for freebsd
+ lineinfile:
+ path: /etc/rc.conf
+ regexp: "^wireguard_enable"
+ line: wireguard_enable="YES"
+ when: os_distribution == "freebsd"
+
+- name: enable interface for freebsd
+ lineinfile:
+ path: /etc/rc.conf
+ regexp: "^wireguard_interfaces"
+ line: wireguard_interfaces="{{ global.dcontroller }}"
+ when: os_distribution == "freebsd"
+
+- name: generate and enable init script
+ include_role: name=rc
+ vars:
+ rc_cmd: "{{ path_wgquick }}"
+ rc_args: "up {{ global.dcontroller }}"
+ rc_name: wireguard
+ rc_user: "{{ user_root }}"
+ ignore_errors: true
+ when: os_distribution != "freebsd"
+
- name: generate server interface
template:
src: templates/hostname.j2
remember that computers suck.