Add (initial) postfix role
This commit is contained in:
parent
4b3e491983
commit
f01533409f
3 changed files with 58 additions and 0 deletions
6
roles/postfix/handlers/main.yml
Normal file
6
roles/postfix/handlers/main.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
# Restart Postfix
|
||||
- name: Restart postfix service
|
||||
service:
|
||||
name: postfix
|
||||
state: restarted
|
15
roles/postfix/tasks/main.yml
Normal file
15
roles/postfix/tasks/main.yml
Normal file
|
@ -0,0 +1,15 @@
|
|||
---
|
||||
# Install and configure Postfix
|
||||
|
||||
- name: Install Postfix
|
||||
apt:
|
||||
name: postfix
|
||||
update_cache: true # apt update beforehand
|
||||
|
||||
- name: Configure Postfix
|
||||
template:
|
||||
src: main.cf.j2
|
||||
dest: /etc/postfix/main.cf
|
||||
notify: Restart postfix service
|
||||
|
||||
|
37
roles/postfix/templates/main.cf.j2
Normal file
37
roles/postfix/templates/main.cf.j2
Normal file
|
@ -0,0 +1,37 @@
|
|||
# {{ ansible_managed }}
|
||||
# See /usr/share/postfix/main.cf.dist for a full commented version
|
||||
# See BASIC_CONFIGURATION_README and STANDARD_CONFIGURATION_README for more insights
|
||||
# More generally, see the Postfix documentation at http://www.postfix.org
|
||||
|
||||
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
|
||||
biff = no
|
||||
|
||||
# appending .domain is the MUA's job.
|
||||
append_dot_mydomain = no
|
||||
|
||||
# Uncomment the next line to generate "delayed mail" warnings
|
||||
#delay_warning_time = 4h
|
||||
|
||||
readme_directory = no
|
||||
|
||||
# See http://www.postfix.org/COMPATIBILITY_README.html -- default to 2 on
|
||||
# fresh installs.
|
||||
compatibility_level = 2
|
||||
|
||||
# Send mail as user@{{ myorigin }}
|
||||
# myorigin = auro.re
|
||||
myorigin = {{ myorigin }}
|
||||
|
||||
#myhostname = mail.adm.auro.re
|
||||
myhostname = {{ myhostname }}
|
||||
|
||||
mydestination = $myhostname localhost.{{ myorigin }} localhost {{ myorigin }}
|
||||
|
||||
# Specify the trusted networks
|
||||
mynetworks = 127.0.0.0/8 {{ local_network }}
|
||||
|
||||
# This host does not relay mail from untrusted networks
|
||||
relay_domains =
|
||||
|
||||
# Allow plus delimiter
|
||||
recipient_delimiter = +
|
Loading…
Reference in a new issue