Add mail playbook and update firewall rules for mail services

This commit is contained in:
2025-03-15 22:49:13 +01:00
parent 7c5f6c5f0f
commit afe0a1010d
3 changed files with 52 additions and 1 deletions
+4 -1
View File
@@ -39,6 +39,8 @@ fw_allowed_ports:
- { rule: "allow", port: "80", proto: "tcp" } - { rule: "allow", port: "80", proto: "tcp" }
- { rule: "allow", port: "443", proto: "tcp" } - { rule: "allow", port: "443", proto: "tcp" }
- { rule: "allow", port: "22", proto: "tcp" } - { rule: "allow", port: "22", proto: "tcp" }
- { rule: "allow", port: "993", proto: "tcp" }
- { rule: "allow", port: "465", proto: "tcp" }
- { rule: "allow", port: "21115", proto: "tcp" } - { rule: "allow", port: "21115", proto: "tcp" }
- { rule: "allow", port: "21116", proto: "tcp" } - { rule: "allow", port: "21116", proto: "tcp" }
- { rule: "allow", port: "21116", proto: "udp" } - { rule: "allow", port: "21116", proto: "udp" }
@@ -46,7 +48,7 @@ fw_allowed_ports:
- { rule: "allow", port: "16443", proto: "tcp", from: "10.1.0.0/16" } - { rule: "allow", port: "16443", proto: "tcp", from: "10.1.0.0/16" }
- { rule: "allow", port: "10254", proto: "tcp", from: "10.1.0.0/16" } - { rule: "allow", port: "10254", proto: "tcp", from: "10.1.0.0/16" }
# Access to the Kube API Server from the Office # Access to the Kube API Server from the Office
- { rule: "allow", port: "16443", proto: "tcp", from: "84.195.60.15" } - { rule: "allow", port: "16443", proto: "tcp", from: "188.82.170.183" }
# VPN to Portugal # VPN to Portugal
- { rule: "allow", port: "10254", proto: "tcp", from: "147.78.131.194" } - { rule: "allow", port: "10254", proto: "tcp", from: "147.78.131.194" }
@@ -61,6 +63,7 @@ ufw_outgoing_traffic:
- 16443 # Kube API Server - 16443 # Kube API Server
- 4443 - 4443
- 9443 - 9443
- 995 # POP3S
ufw_default_forward_policy: "ACCEPT" ufw_default_forward_policy: "ACCEPT"
+45
View File
@@ -0,0 +1,45 @@
---
- name: Mail Playbook (K8s)
hosts: mail
gather_facts: true
# Specific tasks for this playbook
tasks:
- name: Set required facts
ansible.builtin.set_fact:
mail_home: "{{ persistent_data | default('/var/lib') }}/mail"
mail_user_id: 1000
mail_group_id: 1000
tags: always
- name: Set required facts
ansible.builtin.set_fact:
mail_folders:
- "{{ mail_home }}/getmail"
- "{{ mail_home }}/mailboxes"
tags: always
- name: Create required mail home folder
become: true
ansible.builtin.file:
state: directory
path: "{{ mail_home }}"
mode: "0750"
owner: "{{ mail_user_id }}"
group: "{{ mail_group_id }}"
tags:
- tasks
- tasks::folders
- name: Create required mail folders
become: true
ansible.builtin.file:
state: directory
path: "{{ item }}"
mode: "0750"
owner: "{{ mail_user_id }}"
group: "{{ mail_group_id }}"
loop: "{{ mail_folders }}"
tags:
- tasks
- tasks::folders
+3
View File
@@ -30,3 +30,6 @@ prod-01.alexpires.me
[rustdesk] [rustdesk]
prod-01.alexpires.me prod-01.alexpires.me
[mail]
prod-01.alexpires.me