--- - name: restart postfix docker_container: name: "{{ postfix_container}}" state: started restart: yes - name: reload postfix command: docker exec {{ postfix_container }} postfix reload - name: newaliases command: docker exec {{ postfix_container }} newaliases - name: postmap hash aliases command: "docker exec {{ postfix_container }} postmap hash:{{ postfix_mail_domains[item].alias_lookup.file }}" when: - postfix_mail_domains[item].alias_lookup.provider|default(postfix_lookup_provider) == 'file' loop: "{{ postfix_mail_domains.keys()|list }}" - name: postmap hash users command: "docker exec {{ postfix_container }} postmap hash:{{ postfix_mail_domains[item].user_lookup.file }}" when: - postfix_mail_domains[item].user_lookup.provider|default(postfix_lookup_provider) == 'file' loop: "{{ postfix_mail_domains.keys()|list }}" - name: postmap no reply aliases command: "docker exec {{ postfix_container }} postmap hash:{{ postfix_mail_domains[item].noreply_file }}" loop: "{{ postfix_mail_domains.keys()|list }}" - name: postmap access lists command: docker exec {{ postfix_container }} postmap {{ item }} loop: - "/etc/postfix/{{ postfix_rules_dir }}/client_access_list" - "/etc/postfix/{{ postfix_rules_dir }}/helo_access_list" - "/etc/postfix/{{ postfix_rules_dir }}/recipient_access_list" - "/etc/postfix/{{ postfix_rules_dir }}/sender_access_list"