This commit is contained in:
2025-09-23 18:04:54 +02:00
parent d7cab54470
commit e1f5243d11
3 changed files with 46 additions and 33 deletions

View File

@@ -141,52 +141,62 @@
# Add additional SMTP ports OUT
# ---
- name: Check if String 'smtpd_additional_outgoung_ports..' (IPv4) is present
shell: grep -q -E "^#?smtpd_additional_outgoung_ports=" /etc/ipt-firewall/main_ipv4.conf
register: smtpd_additional_outgoung_ports_ipv4_present
- name: Check if String 'allow_ipmi_request_in..' (IPv4) is present
shell: grep -q -E "^#?allow_ipmi_request_in=" /etc/ipt-firewall/main_ipv4.conf
register: allow_ipmi_request_in_ipv4_present
when: main_ipv4_exists.stat.exists
failed_when: "smtpd_additional_outgoung_ports_ipv4_present.rc > 1"
changed_when: "smtpd_additional_outgoung_ports_ipv4_present.rc > 0"
failed_when: "allow_ipmi_request_in_ipv4_present.rc > 1"
changed_when: "allow_ipmi_request_in_ipv4_present.rc > 0"
- name: Adjust file '/etc/ipt-firewall/main_ipv4.conf' (FreeIPA Service)
- name: Adjust file '/etc/ipt-firewall/main_ipv4.conf' (allow_ipmi_request_in)
blockinfile:
path: /etc/ipt-firewall/main_ipv4.conf
insertafter: '^#?\s*mail_user_ports'
insertafter: '^#?\s*ipmi_tcp_ports='
block: |
# Additional Ports for outgoing smtp traffic
#
# blank separated list of ports
#
smtpd_additional_outgoung_ports=""
marker: "# Marker set by modify-ipt-gateway.yml (FreeIPA Service)"
# - Allow Access to IPMI Interfaces from outside
# -
# - Note:
# - In addition, ports
# -
# - TCP :443, 3520, 5900
# - UDP: 623
# -
# - must be forwarded to the IP address of the IPMI network interface in the router (e.g., Fritzbox).
# -
allow_ipmi_request_in=false
marker: "# Marker set by modify-ipt-gateway.yml (allow_ipmi_request_in)"
when:
- main_ipv4_exists.stat.exists
- smtpd_additional_outgoung_ports_ipv4_present is changed
- allow_ipmi_request_in_ipv4_present is changed
- name: Check if String 'smtpd_additional_outgoung_ports..' (IPv6) is present
shell: grep -q -E "^#?smtpd_additional_outgoung_ports=" /etc/ipt-firewall/main_ipv6.conf
register: smtpd_additional_outgoung_ports_ipv6_present
- name: Check if String 'allow_ipmi_request_in..' (IPv6) is present
shell: grep -q -E "^#?allow_ipmi_request_in=" /etc/ipt-firewall/main_ipv6.conf
register: allow_ipmi_request_in_ipv6_present
when: main_ipv6_exists.stat.exists
failed_when: "smtpd_additional_outgoung_ports_ipv6_present.rc > 1"
changed_when: "smtpd_additional_outgoung_ports_ipv6_present.rc > 0"
failed_when: "allow_ipmi_request_in_ipv6_present.rc > 1"
changed_when: "allow_ipmi_request_in_ipv6_present.rc > 0"
- name: Adjust file '/etc/ipt-firewall/main_ipv6.conf' (FreeIPA Service)
- name: Adjust file '/etc/ipt-firewall/main_ipv6.conf' (allow_ipmi_request_in)
blockinfile:
path: /etc/ipt-firewall/main_ipv6.conf
insertafter: '^#?\s*mail_user_ports='
insertafter: '^#?\s*ipmi_tcp_ports='
block: |
# Additional Ports for outgoing smtp traffic
#
# blank separated list of ports
#
smtpd_additional_outgoung_ports=""
marker: "# Marker set by modify-ipt-gateway.yml (FreeIPA Service)"
# - Allow Access to IPMI Interfaces from outside
# -
# - Note:
# - In addition, ports
# -
# - TCP :443, 3520, 5900
# - UDP: 623
# -
# - must be forwarded to the IP address of the IPMI network interface in the router (e.g., Fritzbox).
# -
allow_ipmi_request_in=false
marker: "# Marker set by modify-ipt-gateway.yml (allow_ipmi_request_in)"
when:
- main_ipv6_exists.stat.exists
- smtpd_additional_outgoung_ports_ipv6_present is changed
- allow_ipmi_request_in_ipv6_present is changed
# ---