diff --git a/roles/mail_forwarder/tasks/main.yml b/roles/mail_forwarder/tasks/main.yml index 0cea8e381c948dc3ace75ade8bae1dec2d152cc4..2b397b9df02ced774c01fab71b1f40f51bf5301a 100644 --- a/roles/mail_forwarder/tasks/main.yml +++ b/roles/mail_forwarder/tasks/main.yml @@ -1,7 +1,9 @@ --- - name: Install Postfix - apt: name="postfix" state=installed + apt: + name: postfix + state: installed - name: Install procmail apt: @@ -9,7 +11,10 @@ state: installed - name: Purge Exim configuration - apt: name="exim4*" state=absent purge=yes + apt: + name: "exim4*" + state: absent + purge: yes - name: Deploy the SMTP relay TLS truststore copy: @@ -20,13 +25,22 @@ mode: 0644 - name: Configure visible mail name of the system - copy: content="{{ inventory_hostname }}\n" dest="/etc/mailname" - owner=root group=root mode=0644 + copy: + content: "{{ inventory_hostname }}" + dest: "/etc/mailname" + owner: root + group: root + mode: 0644 notify: - Restart Postfix - name: Deploy Postfix main configuration - template: src="main.cf.j2" dest="/etc/postfix/main.cf" + template: + src: "main.cf.j2" + dest: "/etc/postfix/main.cf" + owner: root + group: root + mode: 0644 notify: - Restart Postfix @@ -41,21 +55,29 @@ - Rebuild mail aliases - name: Enable Postfix service on boot (workaround for systemctl broken handling of SysV) - command: rcconf -on postfix + command: "rcconf -on postfix" register: result changed_when: result.stderr == "" - name: Enable postfix service - service: name=postfix state=started + service: + name: postfix + state: started - name: Deploy firewall configuration for mail forwader - template: src="ferm_mail.conf.j2" dest="/etc/ferm/conf.d/20-mail.conf" - owner=root group=root mode=0640 + template: + src: "ferm_mail.conf.j2" + dest: "/etc/ferm/conf.d/20-mail.conf" + owner: root + group: root + mode: 0640 notify: - Restart ferm - name: Install SWAKS - apt: name="swaks" state=installed + apt: + name: swaks + state: installed - name: Explicitly run all handlers include: ../handlers/main.yml