infra/roles/hatecomputers/tasks/main.yml

40 lines
744 B
YAML
Raw Permalink Normal View History

2024-03-18 17:04:18 -04:00
- name: install wireguard
apt:
name:
- wireguard
state: latest
2024-03-23 19:55:30 -04:00
- name: stop wireguard and enable on boot
systemd:
name: wg-quick@hatecomputers
enabled: yes
state: stopped
2024-03-18 17:04:18 -04:00
- 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
2024-03-23 19:55:30 -04:00
state: restarted
2024-03-18 17:04:18 -04:00
- name: allow wireguard endpoint ufw
ufw:
rule: allow
port: '51820'
proto: 'udp'