standard mta on arch is not ssmtp

so use variable for distro specific mtas
This commit is contained in:
2022-07-07 22:55:30 +02:00
parent 8f609a95e0
commit d07f13c178

View File

@@ -1,10 +1,10 @@
- name: server | utilities | install ssmtp - 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 when: postfix is not defined or postfix == false
- name: server | utitilies | configure ssmtp - 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).
regexp: "{{ item.regex }}" regexp: "{{ item.regex }}"
@@ -13,4 +13,5 @@
loop: loop:
- { regex: "^root=.*$", line: "root=rene@tantooine.myfirewall.org"} - { regex: "^root=.*$", line: "root=rene@tantooine.myfirewall.org"}
- { regex: "^mailhub=.*", line: "mailhub=coruscant.universe.local"} - { regex: "^mailhub=.*", line: "mailhub=coruscant.universe.local"}
- { regex: "^hostname=.*", line: "hostname={{ ansible_fqdn }}"} - { regex: "^hostname=.*", line: "hostname={{ ansible_fqdn }}"}
when: ansible_distribution in ["Debian", "Pop!_OS", "Ubuntu"]