Skip to content

Commit

Permalink
Merge pull request #1 from richm/richm-postfix_files_feature
Browse files Browse the repository at this point in the history
fix test failures
  • Loading branch information
Thulium-Drake authored Jul 2, 2024
2 parents 54b326a + 01d068c commit 46d8dcd
Show file tree
Hide file tree
Showing 16 changed files with 102 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ansible-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ jobs:
- name: Run ansible-lint
uses: ansible/ansible-lint@v24
with:
working_directory: .tox/ansible_collections/${{ env.LSR_ROLE2COLL_NAMESPACE }}/${{ env.LSR_ROLE2COLL_NAME }}
working_directory: ${{ github.workspace }}/.tox/ansible_collections/${{ env.LSR_ROLE2COLL_NAMESPACE }}/${{ env.LSR_ROLE2COLL_NAME }}
2 changes: 1 addition & 1 deletion .github/workflows/ansible-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ jobs:
uses: ansible-community/ansible-test-gh-action@release/v1
with:
testing-type: sanity # wokeignore:rule=sanity
collection-src-directory: .tox/ansible_collections/${{ env.LSR_ROLE2COLL_NAMESPACE }}/${{ env.LSR_ROLE2COLL_NAME }}
collection-src-directory: ${{ github.workspace }}/.tox/ansible_collections/${{ env.LSR_ROLE2COLL_NAMESPACE }}/${{ env.LSR_ROLE2COLL_NAME }}
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
Changelog
=========

[1.4.5] - 2024-06-11
--------------------

### Bug Fixes

- fix: Reflect smtp-submission service rename in EL 10 and Fedora 40+ (#131)

### Other Changes

- refactor: Modify backup task to use the 'copy' module instead of 'shell' (#2)
- ci: use tox-lsr 3.3.0 which uses ansible-test 2.17 (#124)
- ci: tox-lsr 3.4.0 - fix py27 tests; move other checks to py310 (#126)
- ci: Add supported_ansible_also to .ansible-lint (#127)

[1.4.4] - 2024-04-04
--------------------

Expand Down
18 changes: 12 additions & 6 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,20 @@
- name: Apply changes
when: __postfix_has_config_changed | d("") is search("True")
block:
- name: Gather facts for ansible_date_time
setup:
filter:
- ansible_date_time
when: postfix_backup_multiple | bool

- name: Backup configuration
shell: >-
set -euo pipefail;
cp /etc/postfix/main.cf
/etc/postfix/main.cf.{{ postfix_backup_multiple |
ternary("$(date -Iseconds)", "backup") }}
copy:
remote_src: true
src: /etc/postfix/main.cf
dest: /etc/postfix/main.cf.{{ postfix_backup_multiple |
ternary(ansible_date_time.iso8601, "backup") }}
mode: "0644"
when: postfix_backup or postfix_backup_multiple
changed_when: true

- name: Ensure Last modified header is absent
lineinfile:
Expand Down
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 46d8dcd

Please sign in to comment.