library/roles/postfix-relay/tasks/postfix-relay-server.yml: Fix the saslauthd configuration on Ubuntu xenial.

This commit is contained in:
Andrea Dell'Amico 2018-05-04 15:20:52 +02:00
parent 92e71712bc
commit 4912213694
1 changed files with 22 additions and 18 deletions

View File

@ -1,41 +1,45 @@
--- ---
- name: Create the /etc/mailname file if it's not present
template: src=mailname.j2 dest=/etc/mailname owner=root group=root mode=0644
tags: postfix-relay
- name: Write the network hash file - name: Write the network hash file
template: src=network_table.j2 dest=/etc/postfix/network_table owner=root group=root mode=0444 template: src=network_table.j2 dest=/etc/postfix/network_table owner=root group=root mode=0444
notify: Update the network hash table notify: Update the network hash table
tags: tags: postfix-relay
- postfix-relay
- name: Install the sasl2 authentication infrastructure - name: Install the sasl2 authentication infrastructure
apt: pkg={{ item }} state=installed apt: pkg={{ item }} state=installed
with_items: '{{ postfix_sasl_packages }}' with_items: '{{ postfix_sasl_packages }}'
tags: tags: postfix-relay
- postfix-relay
- name: Create the sasl directory inside /etc/postfix - name: Create the sasl directory inside /etc/postfix
file: dest=/etc/postfix/sasl state=directory owner=root group=root mode=0555 file: dest=/etc/postfix/sasl state=directory owner=root group=root mode=0555
tags: tags: postfix-relay
- postfix-relay
- name: Create the sasl run directory inside /var/spool/postfix, for chroot
file: dest=/var/spool/postfix/var/run/saslauthd state=directory owner=root group=root mode=0555
notify: start saslauth daemon
tags: postfix-relay
- name: Install the smtpd.conf file inside inside /etc/postfix/sasl - name: Install the smtpd.conf file inside inside /etc/postfix/sasl
copy: src=sasl_smtpd.conf dest=/etc/postfix/sasl/smtpd.conf owner=root group=root mode=0444 copy: src=sasl_smtpd.conf dest=/etc/postfix/sasl/smtpd.conf owner=root group=root mode=0444
tags: tags: postfix-relay
- postfix-relay
- name: Enable the saslauth daemon
action: configfile path=/etc/default/saslauthd key=START value='yes' syntax=shell
notify: start saslauth daemon
tags:
- postfix-relay
- name: Change the socket path because postfix on debian runs inside a chroot jail - name: Change the socket path because postfix on debian runs inside a chroot jail
action: configfile path=/etc/default/saslauthd key=OPTIONS value='"-c -m /var/spool/postfix/var/run/saslauthd"' syntax=shell action: configfile path=/etc/default/saslauthd key=OPTIONS value='"-c -m /var/spool/postfix/var/run/saslauthd"' syntax=shell
notify: restart saslauth daemon notify: restart saslauth daemon
tags: tags: postfix-relay
- postfix-relay
- name: Enable the saslauth daemon
action: configfile path=/etc/default/saslauthd key=START value='yes' syntax=shell
tags: postfix-relay
- name: Assign the sasl group to the postfix user so that postfix can use the saslauthd socket - name: Assign the sasl group to the postfix user so that postfix can use the saslauthd socket
user: name=postfix groups='sasl' user: name=postfix groups='sasl'
notify: Restart postfix notify: Restart postfix
tags: tags: postfix-relay
- postfix-relay
- name: Ensure that the saslauthd daemon is started and enabled
service: name=saslauthd state=restarted enabled=yes
tags: postfix-relay