mirror of
https://github.com/pikami/mail-server.git
synced 2026-06-15 16:56:58 +01:00
Extract playbook actions to roles
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
---
|
||||
primary_mail_server: mx1.example.com
|
||||
server_domain: mx1.example.com
|
||||
mail_receive_domains:
|
||||
- example.net
|
||||
- example.com
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
- name: reload smtpd
|
||||
service:
|
||||
name: smtpd
|
||||
state: restarted
|
||||
@@ -0,0 +1,13 @@
|
||||
---
|
||||
- name: Configure OpenSMTPD smtpd.conf
|
||||
template:
|
||||
src: templates/smtpd.conf
|
||||
dest: /etc/mail/smtpd.conf
|
||||
notify:
|
||||
- reload smtpd
|
||||
|
||||
- name: Enable and start OpenSMTPD service
|
||||
service:
|
||||
name: smtpd
|
||||
enabled: yes
|
||||
state: started
|
||||
@@ -0,0 +1,16 @@
|
||||
# {{ ansible_managed }}
|
||||
pki {{ server_domain }} cert "/etc/ssl/{{ server_domain }}.fullchain.pem"
|
||||
pki {{ server_domain }} key "/etc/ssl/private/{{ server_domain }}.key"
|
||||
|
||||
listen on all tls pki {{ server_domain }}
|
||||
|
||||
table aliases file:/etc/mail/aliases
|
||||
|
||||
action "local" mbox alias <aliases>
|
||||
action "relay" relay host {{ primary_mail_server }}
|
||||
|
||||
{% for domain in mail_receive_domains %}
|
||||
match from any for domain {{ domain }} action "relay"
|
||||
{% endfor %}
|
||||
match from local for local action "local"
|
||||
match from local for any action "relay"
|
||||
Reference in New Issue
Block a user