ansible/roles/docker/tasks/services/postfix.yml

22 lines
726 B
YAML

---
- name: setup network for postfix
community.docker.docker_network:
name: postfix
ipam_config:
- subnet: 172.16.0.0/16
gateway: 172.16.0.1
- name: setup postfix docker container for outgoing mail
community.docker.docker_container:
name: postfix
image: boky/postfix:{{ services.postfix.version }}
restart_policy: always
networks:
- name: postfix
env:
# Get all services which have allowed_sender_domain defined
ALLOWED_SENDER_DOMAINS: "{{ services | dict2items | selectattr('value.allowed_sender_domain',\
\ 'defined') | map(attribute='value.domain') | list | join(' ') }}"
HOSTNAME: smtp.data.coop # the name the smtp server will identify itself as