This repository has been archived on 2023-12-29. You can view files and clone it, but cannot push or open issues or pull requests.
pi-ansible/roles/docker_services/tasks/services/postfix.yml

30 lines
888 B
YAML
Raw Normal View History

2023-01-14 17:06:21 +00:00
# vim: ft=yaml.ansible
---
- name: Create Docker network for Postfix
2023-03-22 18:31:21 +00:00
community.docker.docker_network:
2023-01-14 17:06:21 +00:00
name: postfix
2023-01-14 18:25:13 +00:00
state: present
2023-01-14 17:06:21 +00:00
- name: Create Postfix volume directories
2023-03-22 18:31:21 +00:00
ansible.builtin.file:
2023-01-14 17:06:21 +00:00
name: "{{ services.postfix.volume }}/dkim"
owner: root
mode: u=rwx,g=rx,o=rx
state: directory
- name: Deploy Postfix Docker container
2023-03-22 18:31:21 +00:00
community.docker.docker_container:
2023-01-14 17:06:21 +00:00
name: postfix
state: "{{ 'absent' if stop is defined and stop else 'started' }}"
2023-04-20 22:29:19 +00:00
restart: "{{ stop is undefined or not stop }}"
2023-01-14 17:06:21 +00:00
image: boky/postfix:{{ services.postfix.version }}
restart_policy: always
env:
ALLOWED_SENDER_DOMAINS: "{{ sender_domains | join(' ') }}"
2023-04-06 17:26:22 +00:00
HOSTNAME: "{{ services.postfix.domain }}"
2023-01-14 17:06:21 +00:00
DKIM_AUTOGENERATE: "true"
networks:
- name: postfix
volumes:
- "{{ services.postfix.volume }}/dkim:/etc/opendkim/keys:rw"