--- - name: "include tls config vars (preset: {{ postfix_tls_configuration }})" include_vars: file: "tls-{{ postfix_tls_configuration }}.yml" tags: - postfix - mail - name: ensure all required postfix packages are installed apt: name: - postfix - postfix-pcre - postfix-cdb state: present tags: - postfix - mail - name: ensure additional packages are installed if required apt: name: memcached state: present when: postfix_enable_memcached tags: - postfix - mail - name: ensure config is present template: src: "{{ item }}.j2" dest: "/etc/postfix/{{ item }}" with_items: - login_maps.pcre - master.cf - main.cf - postscreen_access.cidr notify: - restart postfix tags: - postfix - mail - name: ensure dh params are available copy: src: "{{ postfix_tls_dh_file }}" dest: /etc/postfix/dh.pem owner: root group: root mode: '0644' when: postfix_tls_dh_file is string notify: - restart postfix tags: - postfix - mail - name: ensure memcached config is present template: src: memcached.conf.j2 dest: /etc/memcached.conf when: postfix_enable_memcached notify: - restart memcached tags: - postfix - mail - name: ensure postscreen memcached integration is present template: src: postscreen_cache.j2 dest: /etc/postfix/postscreen_cache when: postfix_enable_memcached notify: - restart memcached tags: - postfix - mail - import_tasks: mta-sts.yml - name: install rt-mailgate if needed apt: name: rt4-clients state: present when: postfix_aliases_rt|bool tags: - postfix - mail - name: ensure system alias database is present template: src: aliases.j2 dest: /etc/aliases notify: - postmap system tags: - postfix - mail - name: ensure virtual alias database is present template: src: virtual.j2 dest: /etc/postfix/virtual notify: - postmap virtual tags: - postfix - mail - name: ensure mailname is properly configured template: src: mailname.j2 dest: /etc/mailname notify: - restart postfix tags: - postfix - mail - name: ensure transport_maps are configured template: src: transport.j2 dest: /etc/postfix/transport notify: - postmap transport when: postfix_transport_maps|bool tags: - postfix - mail