Initial server-infra setup

This commit is contained in:
2026-07-06 15:34:49 -05:00
commit f848420d8f
17 changed files with 605 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
---
- name: Install ufw
ansible.builtin.apt:
name: ufw
state: present
- name: Set UFW default incoming policy to deny
community.general.ufw:
direction: incoming
policy: deny
- name: Set UFW default outgoing policy to allow
community.general.ufw:
direction: outgoing
policy: allow
- name: Allow SSH from LAN only
community.general.ufw:
rule: allow
port: "{{ ufw_ssh_port }}"
proto: tcp
from_ip: "{{ ufw_ssh_allowed_network }}"
- name: Allow HTTP and HTTPS
community.general.ufw:
rule: allow
port: "{{ item }}"
proto: tcp
loop: "{{ ufw_allowed_tcp_ports }}"
- name: Enable UFW
community.general.ufw:
state: enabled