aboutsummaryrefslogtreecommitdiffstats
path: root/roles/wireguard/tasks/service.yml
blob: d1a1007b4e0b3fece2937ddf4280d817ed8db067 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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.