mta for servers must not be postfix unless it is a mailserver

This commit is contained in:
2024-07-25 15:34:38 +02:00
parent 4000699794
commit d2691f5740

View File

@@ -1,9 +1,18 @@
- 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 }} - name: server | utilities | install {{ mta_package }}
package: package:
name: "{{ mta_package }}" name: "{{ mta_package }}"
state: present state: present
when: postfix is not defined or postfix == false
- name: server | utitilies | configure {{ mta_package }} - name: server | utitilies | configure {{ mta_package }}
lineinfile: lineinfile:
path: "/etc/ssmtp/ssmtp.conf" # required. The file to modify. Before Ansible 2.3 this option was only usable as I(dest), I(destfile) and I(name). path: "/etc/ssmtp/ssmtp.conf" # required. The file to modify. Before Ansible 2.3 this option was only usable as I(dest), I(destfile) and I(name).
@@ -15,3 +24,4 @@
- { regex: "^mailhub=.*", line: "mailhub=mail.universe.local"} - { regex: "^mailhub=.*", line: "mailhub=mail.universe.local"}
- { regex: "^hostname=.*", line: "hostname={{ ansible_fqdn }}"} - { regex: "^hostname=.*", line: "hostname={{ ansible_fqdn }}"}
when: ansible_distribution in ["Debian", "Pop!_OS", "Ubuntu"] when: ansible_distribution in ["Debian", "Pop!_OS", "Ubuntu"]
when: postfix is not defined or postfix == false