ansible/roles/ubuntu_base/tasks/firewall.yml

42 lines
713 B
YAML
Raw Normal View History

2022-11-10 20:48:24 +00:00
---
- name: Setup firewall with UFW
community.general.ufw:
state: enabled
policy: deny
- name: Allow necessary ports
community.general.ufw:
rule: allow
2022-11-22 20:22:23 +00:00
port: "{{ item.port }}"
proto: "{{ item.proto }}"
2022-11-10 20:48:24 +00:00
loop:
2022-11-22 20:22:23 +00:00
# Gitea SSH
- port: 22
proto: "tcp"
# HTTP
- port: 80
proto: "tcp"
# HTTPS
- port: 443
proto: "tcp"
# OpenLDAP
- port: 389
proto: "tcp"
# OpenLDAP
- port: 636
proto: "tcp"
# Email
- port: 25
proto: "tcp"
# Email
- port: 465
proto: "tcp"
# Email
- port: 587
proto: "tcp"
# Email
- port: 993
proto: "tcp"
# SSH
- port: 19022
proto: "tcp"