initial version of opensmtpd which is applied to all hosts

This commit is contained in:
Timo Makinen 2019-05-11 00:14:03 +03:00
parent a3cc1b3b18
commit 76f0f6b741
4 changed files with 49 additions and 0 deletions

View file

@ -0,0 +1,34 @@
---
- name: install opensmtpd
package:
name: opensmtpd
state: installed
- name: set default mta to opensmtpd
alternatives:
name: mta
path: /usr/sbin/sendmail.opensmtpd
- name: create smtpd.conf from template
template:
src: smtpd.conf.j2
dest: /etc/opensmtpd/smtpd.conf
mode: 0644
owner: root
group: root
notify: restart opensmtpd
- name: force serer name to domain name
copy:
content: "{{ mail_domain }}\n"
dest: /etc/opensmtpd/mailname
mode: 0644
owner: root
group: root
notify: restart opensmtpd
- name: enable opensmtpd
service:
name: opensmtpd
state: started
enabled: true