Skip to content

Commit

Permalink
fix: Reflect smtp-submission service rename in EL 10 and Fedora 40
Browse files Browse the repository at this point in the history
- In EL 10 and Fedora 40, smtp-submission service has been renamed to submission
firewalld/firewalld@d6a9561
- Add setting vars for platforms
- Fix egrep warning
 "egrep: warning: egrep is obsolescent; using grep -E
  • Loading branch information
spetrosi authored and richm committed Jun 10, 2024
1 parent 7a485a9 commit ddd75bc
Show file tree
Hide file tree
Showing 12 changed files with 74 additions and 6 deletions.
7 changes: 2 additions & 5 deletions tasks/selinux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,10 @@
shell: |-
set -euo pipefail
firewall-cmd --info-service="{{ item }}" | \
egrep " +ports: +" | sed -e "s/ *ports: //"
grep -E " +ports: +" | sed -e "s/ *ports: //"
register: __ports
changed_when: false
loop:
- "smtp"
- "smtps"
- "smtp-submission"
loop: "{{ __postfix_smtp_services }}"

- name: Initialize _postfix_selinux
set_fact:
Expand Down
11 changes: 11 additions & 0 deletions tasks/set_facts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,14 @@
- name: Set flag to indicate system is ostree
set_fact:
__postfix_is_ostree: "{{ __ostree_booted_stat.stat.exists }}"

- name: Set platform/version specific variables
include_vars: "{{ __postfix_vars_file }}"
loop:
- "{{ ansible_os_family }}.yml"
- "{{ ansible_distribution }}.yml"
- "{{ ansible_distribution }}_{{ ansible_distribution_major_version }}.yml"
- "{{ ansible_distribution }}_{{ ansible_distribution_version }}.yml"
vars:
__postfix_vars_file: "{{ role_path }}/vars/{{ item }}"
when: __postfix_vars_file is file
6 changes: 6 additions & 0 deletions vars/CentOS_7.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# SPDX-License-Identifier: GPL-3.0-only
---
__postfix_smtp_services:
- smtp
- smtps
- smtp-submission
6 changes: 6 additions & 0 deletions vars/CentOS_8.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# SPDX-License-Identifier: GPL-3.0-only
---
__postfix_smtp_services:
- smtp
- smtps
- smtp-submission
6 changes: 6 additions & 0 deletions vars/CentOS_9.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# SPDX-License-Identifier: GPL-3.0-only
---
__postfix_smtp_services:
- smtp
- smtps
- smtp-submission
6 changes: 6 additions & 0 deletions vars/Fedora.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# SPDX-License-Identifier: GPL-3.0-only
---
__postfix_smtp_services:
- smtp
- smtps
- submission
6 changes: 6 additions & 0 deletions vars/Fedora_39.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# SPDX-License-Identifier: GPL-3.0-only
---
__postfix_smtp_services:
- smtp
- smtps
- smtp-submission
6 changes: 6 additions & 0 deletions vars/RedHat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# SPDX-License-Identifier: GPL-3.0-only
---
__postfix_smtp_services:
- smtp
- smtps
- submission
6 changes: 6 additions & 0 deletions vars/RedHat_7.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# SPDX-License-Identifier: GPL-3.0-only
---
__postfix_smtp_services:
- smtp
- smtps
- smtp-submission
6 changes: 6 additions & 0 deletions vars/RedHat_8.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# SPDX-License-Identifier: GPL-3.0-only
---
__postfix_smtp_services:
- smtp
- smtps
- smtp-submission
6 changes: 6 additions & 0 deletions vars/RedHat_9.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# SPDX-License-Identifier: GPL-3.0-only
---
__postfix_smtp_services:
- smtp
- smtps
- smtp-submission
8 changes: 7 additions & 1 deletion vars/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
# SPDX-License-Identifier: GPL-3.0-only
---
# List of default rpm packages to install.
__postfix_packages: ['postfix']
__postfix_packages:
- postfix

__postfix_smtp_services:
- smtp
- smtps
- smtp-submission

# ansible_facts required by the role
__postfix_required_facts:
Expand Down

0 comments on commit ddd75bc

Please sign in to comment.