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

@ -9,3 +9,7 @@
mode: 0600
owner: root
group: root
- name: install basic roles
include_role:
name: opensmtpd

View file

@ -0,0 +1,5 @@
---
- name: restart opensmtpd
service:
name: opensmtpd
state: restarted

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

View file

@ -0,0 +1,6 @@
listen on lo
table aliases file:/etc/aliases
# use obsolete smtps as it goes through firewalls better than 25
accept from local for any relay via smtps://{{ mail_server }} as "@{{ mail_domain }}"