Add Postfix for email sending
This commit is contained in:
parent
d2820859a2
commit
31c5c9e455
|
@ -1,9 +1,9 @@
|
||||||
# vim: ft=yaml.ansible
|
# vim: ft=yaml.ansible
|
||||||
---
|
---
|
||||||
ssh_key: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPd/4fQV7CL8/KVwbo/phiV5UdXFBIDlkZ+ps8C7FeRf
|
ssh_key: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPd/4fQV7CL8/KVwbo/phiV5UdXFBIDlkZ+ps8C7FeRf
|
||||||
|
|
||||||
hostname: pi
|
hostname: pi
|
||||||
timezone: Europe/Copenhagen
|
timezone: Europe/Copenhagen
|
||||||
|
base_domain: sapti.me
|
||||||
|
|
||||||
hdd_name: storage
|
hdd_name: storage
|
||||||
hdd_mount_point: /opt/{{ hdd_name }}
|
hdd_mount_point: /opt/{{ hdd_name }}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
# vim: ft=yaml.ansible
|
# vim: ft=yaml.ansible
|
||||||
---
|
---
|
||||||
base_domain: sapti.me
|
|
||||||
base_volume: "{{ hdd_mount_point }}/apps"
|
base_volume: "{{ hdd_mount_point }}/apps"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
@ -8,6 +7,11 @@ services:
|
||||||
volume: "{{ base_volume }}/caddy"
|
volume: "{{ base_volume }}/caddy"
|
||||||
version: 2-alpine
|
version: 2-alpine
|
||||||
|
|
||||||
|
postfix:
|
||||||
|
volume: "{{ base_volume }}/postfix"
|
||||||
|
hostname: smtp.{{ base_domain }}
|
||||||
|
version: latest-alpine
|
||||||
|
|
||||||
emby:
|
emby:
|
||||||
domain: watch.{{ base_domain }}
|
domain: watch.{{ base_domain }}
|
||||||
volume: "{{ base_volume }}/emby"
|
volume: "{{ base_volume }}/emby"
|
||||||
|
@ -38,3 +42,6 @@ services:
|
||||||
|
|
||||||
watchtower:
|
watchtower:
|
||||||
version: arm64v8-1.5.1
|
version: arm64v8-1.5.1
|
||||||
|
|
||||||
|
sender_domains:
|
||||||
|
- "{{ services.nextcloud.domain }}"
|
||||||
|
|
|
@ -76,6 +76,7 @@
|
||||||
PHP_UPLOAD_LIMIT: 16G
|
PHP_UPLOAD_LIMIT: 16G
|
||||||
networks:
|
networks:
|
||||||
default:
|
default:
|
||||||
|
postfix:
|
||||||
services:
|
services:
|
||||||
aliases:
|
aliases:
|
||||||
- nextcloud
|
- nextcloud
|
||||||
|
@ -88,5 +89,7 @@
|
||||||
- redis
|
- redis
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
|
postfix:
|
||||||
|
external: true
|
||||||
services:
|
services:
|
||||||
external: true
|
external: true
|
||||||
|
|
26
roles/docker_services/tasks/services/postfix.yml
Normal file
26
roles/docker_services/tasks/services/postfix.yml
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
# vim: ft=yaml.ansible
|
||||||
|
---
|
||||||
|
- name: Create Docker network for Postfix
|
||||||
|
docker_network:
|
||||||
|
name: postfix
|
||||||
|
|
||||||
|
- name: Create Postfix volume directories
|
||||||
|
file:
|
||||||
|
name: "{{ services.postfix.volume }}/dkim"
|
||||||
|
owner: root
|
||||||
|
mode: u=rwx,g=rx,o=rx
|
||||||
|
state: directory
|
||||||
|
|
||||||
|
- name: Deploy Postfix Docker container
|
||||||
|
docker_container:
|
||||||
|
name: postfix
|
||||||
|
image: boky/postfix:{{ services.postfix.version }}
|
||||||
|
restart_policy: always
|
||||||
|
env:
|
||||||
|
ALLOWED_SENDER_DOMAINS: "{{ sender_domains | join(' ') }}"
|
||||||
|
HOSTNAME: "{{ services.postfix.hostname }}"
|
||||||
|
DKIM_AUTOGENERATE: "true"
|
||||||
|
networks:
|
||||||
|
- name: postfix
|
||||||
|
volumes:
|
||||||
|
- "{{ services.postfix.volume }}/dkim:/etc/opendkim/keys:rw"
|
Reference in a new issue