aboutsummaryrefslogblamecommitdiffstats
path: root/roles/wireguard/tasks/service.yml
blob: 85849ee4546fa601a932c49e5dd5ca41e521d06b (plain) (tree)
1
2
3
4
5
6
7
8
9

   
                                              
                             



                                                                            
                
                


                                         
                        


                                                   
                                         


                             
                        
               
---

- name: enable wireguard interface for OpenBSD
  ansible.builtin.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
    create: true
    mode: "0644"
  when: ansible_distribution == "OpenBSD"

- name: restart wireguard interface
  ansible.builtin.raw: |
    wg-quick down {{ wireguard_domain_controller }}
    sleep {{ 10 | random(start=1) }}
    wg-quick up {{ wireguard_domain_controller }}
  when: ansible_distribution == "OpenBSD"
  register: result

- name: show wireguard output
  ansible.builtin.debug:
    var: result
remember that computers suck.