first install new mta, then remove postfix

This commit is contained in:
2024-11-30 15:37:37 +01:00
parent c119f5e695
commit 4cd63971e4

View File

@@ -1,14 +1,5 @@
- name: server | utilities | {{ mta_package }}
block:
- name: server | utilities | remove postfix
package:
name:
- postfix
- postfix-ldap
- postfix-mysql
- postfix-sqlite
- postgrey
state: absent
- name: server | utilities | install {{ mta_package }}
package:
name: "{{ mta_package }}"
@@ -24,4 +15,13 @@
- { regex: "^mailhub=.*", line: "mailhub=mail.universe.local"}
- { regex: "^hostname=.*", line: "hostname={{ ansible_fqdn }}"}
when: ansible_distribution in ["Debian", "Pop!_OS", "Ubuntu", "Linux Mint"]
when: postfix is not defined or postfix == false and not (is_proxmox is defined and is_proxmox == true)
- name: server | utilities | remove postfix
package:
name:
- postfix
- postfix-ldap
- postfix-mysql
- postfix-sqlite
- postgrey
state: absent
when: postfix is not defined or postfix == false