Skip to content

Commit

Permalink
Merge pull request #21 from id-unibe-ch/20-add-release-announcement-w…
Browse files Browse the repository at this point in the history
…orkflow

Adopt release announcement workflow
  • Loading branch information
mrolli authored Jun 28, 2024
2 parents 863d0fa + 8d363a0 commit a8308b5
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 13 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/release_announcement.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: Release announcement
on:
release:
types: [published]

jobs:
notify:
name: Notify new release
runs-on: ubuntu-latest
if: github.event.release.name != ''

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Notify dedicated teams channel
uses: simbo/msteams-message-card-action@v1.4.3
with:
webhook: ${{ secrets.TEAMS_SYS_WEBHOOK_ANSIBLE_TALK_URI }}
title: "New Release for ${{ github.repository }}"
message: "Release ${{ github.event.release.name }} for repository ${{ github.repository }} has just been published!"
color: "ff6e00"
buttons: |
Open release notes at GitHub https://github.com/${{ github.repository }}/releases/tag/${{ github.event.release.name }}
8 changes: 4 additions & 4 deletions handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@
ansible.builtin.command:
cmd: postalias "{{ __postfix_alias_path }}"
changed_when: yes
listen: rebuild_aliases_db
listen: Rebuild_aliases_db

- name: Rebuild sender_canonical database
ansible.builtin.command:
cmd: postmap "{{ __postfix_sender_canonical_path }}"
changed_when: yes
listen: rebuild_sender_canonical_db
listen: Rebuild_sender_canonical_db

# Restart postfix service
- name: Restart postfix service
ansible.builtin.service:
name: "{{ __postfix_service }}"
state: "{{ postfix_restart_state }}"
listen: "restart-postifx"
listen: Restart-postifx
when: postfix_state | default('started') == 'started'

- name: Reload postfix service
ansible.builtin.service:
name: "{{ __postfix_service }}"
state: "reloaded"
listen: "reload-postfix"
listen: Reload-postfix
when: postfix_state | default('started') == 'started'
4 changes: 2 additions & 2 deletions tasks/ldap_sender_canonical_cf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
- name: Manage configuration parameter file
when: postfix_sender_canonical_ldap_config.server_host is defined
notify:
- reload-postfix
- Reload-postfix
block:
- name: Prepare template variable
ansible.builtin.set_fact:
Expand All @@ -21,7 +21,7 @@
- name: Remove mapping files
when: postfix_sender_canonical_ldap_config.server_host is not defined
notify:
- reload-postfix
- Reload-postfix
block:
- name: Remove map file
ansible.builtin.file:
Expand Down
4 changes: 2 additions & 2 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
group: root
setype: postfix_etc_t
mode: 0644
notify: restart-postifx
notify: Restart-postifx

- name: Ensure Postfix is started and enabled at boot.
ansible.builtin.service:
Expand All @@ -36,7 +36,7 @@
line: "{{ item.key }}: {{ item.value if (item.value is string) else item.value | join(', ') }}"
state: "{{ 'absent' if (item.value == 'undef') else 'present' }}"
loop: "{{ postfix_alias_map | dict2items }}"
notify: rebuild_aliases_db
notify: Rebuild_aliases_db

- name: Postfix is going to be removed from the system
ansible.builtin.include_tasks: "uninstall_{{ ansible_os_family | lower }}.yml"
Expand Down
6 changes: 3 additions & 3 deletions tasks/sender_canonical_map.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
- name: Manage mapping entries
when: postfix_sender_canonicals | length > 0
notify:
- rebuild_sender_canonical_db
- reload-postfix
- Rebuild_sender_canonical_db
- Reload-postfix
block:
- name: Prepare template variable
ansible.builtin.set_fact:
Expand All @@ -22,7 +22,7 @@
- name: Remove mapping files
when: postfix_sender_canonicals | length == 0
notify:
- reload-postfix
- Reload-postfix
block:
- name: Remove map file
ansible.builtin.file:
Expand Down
3 changes: 1 addition & 2 deletions tasks/uninstall_redhat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@
when: ansible_distribution_version is version('8', '>=')

- name: Remove postfix from yum-based system
ansible.builtin.yum:
ansible.builtin.package:
name: "{{ __postfix_packages }}"
state: "absent"
autoremove: true
when: ansible_distribution_version is version('8', '<')

- name: Remove configuration files left on the system
Expand Down

0 comments on commit a8308b5

Please sign in to comment.