add hatecomputers role!

This commit is contained in:
Elizabeth Hunt 2024-03-18 17:04:18 -04:00
parent 4e93a081f8
commit b81bfc5a29
4 changed files with 41 additions and 0 deletions

4
deploy-hatecomputers.yml Normal file
View File

@ -0,0 +1,4 @@
- name: hatecomputers setup
hosts: hatecomputers
roles:
- hatecomputers

View File

@ -64,3 +64,6 @@ europa ansible_user=root ansible_connection=ssh
[drone]
europa ansible_user=root ansible_connection=ssh
[hatecomputers]
levi ansible_user=root ansible_connection=ssh

1
roles/hatecomputers/files/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
wireguard.cfg

View File

@ -0,0 +1,33 @@
- name: install wireguard
apt:
name:
- wireguard
state: latest
- 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: started
- name: allow wireguard endpoint ufw
ufw:
rule: allow
port: '51820'
proto: 'udp'