summaryrefslogtreecommitdiff
path: root/roles/hatecomputers/tasks/main.yml
blob: 4e12d320f2ab9ffc571d8d011a04794ea35d11e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
- name: install wireguard
  apt:
    name:
      - wireguard
    state: latest

- name: stop wireguard and enable on boot
  systemd:
    name: wg-quick@hatecomputers
    enabled: yes
    state: stopped

- name: copy config
  ansible.builtin.copy:
    src: ../files/wireguard.cfg
    dest: /etc/wireguard/hatecomputers.conf
    owner: root
    group: root
    mode: 0600

- name: enable and persist ip forwarding
  sysctl:
    name: net.ipv4.ip_forward
    value: "1"
    state: present
    sysctl_set: yes
    reload: yes

- name: start wireguard and enable on boot
  systemd:
    name: wg-quick@hatecomputers
    enabled: yes
    state: restarted

- name: allow wireguard endpoint ufw
  ufw:
    rule: allow
    port: '51820'
    proto: 'udp'