Add maildev install

This commit is contained in:
tom.chivert 2022-09-16 11:33:42 +02:00
parent 5030aab3bc
commit 6afc7ca9c3
6 changed files with 49 additions and 0 deletions

View File

@ -16,6 +16,7 @@ Available services
- Traefik - Traefik
- Watchtower - Watchtower
- Grafana - Grafana
- Maildev
Role variables Role variables
--------------- ---------------
@ -48,9 +49,12 @@ Example variables
- traefik - traefik
- watchtower - watchtower
- grafana - grafana
- maildev
traefik_domain: 'mydomain.com' traefik_domain: 'mydomain.com'
traefik_letsencrypt_email: 'cert@mydomain.com' traefik_letsencrypt_email: 'cert@mydomain.com'
maildev_domain: 'maildev.mydomain.com'
``` ```
TODO TODO

View File

@ -3,16 +3,26 @@
systemd: systemd:
name: docker-compose@traefik name: docker-compose@traefik
state: restarted state: restarted
ignore_errors: '{{ ansible_check_mode }}'
tags: ['docker_traefik'] tags: ['docker_traefik']
- name: watchtower-restart - name: watchtower-restart
systemd: systemd:
name: docker-compose@watchtower name: docker-compose@watchtower
state: restarted state: restarted
ignore_errors: '{{ ansible_check_mode }}'
tags: ['docker_watchtower'] tags: ['docker_watchtower']
- name: grafana-restart - name: grafana-restart
systemd: systemd:
name: docker-compose@grafana name: docker-compose@grafana
state: restarted state: restarted
ignore_errors: '{{ ansible_check_mode }}'
tags: ['docker_grafana'] tags: ['docker_grafana']
- name: maildev-restart
systemd:
name: docker-compose@maildev
state: restarted
ignore_errors: '{{ ansible_check_mode }}'
tags: ['docker_maildev']

View File

@ -34,4 +34,5 @@
daemon_reload: yes daemon_reload: yes
name: docker-compose@{{ service }} name: docker-compose@{{ service }}
enabled: true enabled: true
ignore_errors: '{{ ansible_check_mode }}'
tags: [ 'docker_{{ service }}' ] tags: [ 'docker_{{ service }}' ]

9
tasks/maildev.yml Normal file
View File

@ -0,0 +1,9 @@
---
- name: maildev | check vars are defined
assert:
that:
- maildev_domain is defined
tags: ['docker_maildev']
- include_tasks: base.yml
tags: ['docker_maildev']

View File

@ -13,5 +13,6 @@
- docker_traefik - docker_traefik
- docker_watchtower - docker_watchtower
- docker_grafana - docker_grafana
- docker_maildev
with_items: with_items:
- "{{ docker_services }}" - "{{ docker_services }}"

View File

@ -0,0 +1,24 @@
version: '3.7'
networks:
traefik:
external: true
services:
maildev:
container_name: maildev
image: maildev/maildev:{{ maildev_version | default("latest") }}
restart: unless-stopped
ports:
- "1080:1080"
- "1025:1025"
labels:
traefik.enable: true
traefik.docker.network: traefik
traefik.http.routers.maildev.rule: Host(`{{ maildev_domain }}`)
traefik.http.routers.maildev.tls: true
traefik.http.routers.maildev.tls.certresolver: letsencrypt
traefik.http.routers.maildev.entrypoints: websecure
traefik.http.services.maildev.loadbalancer.server.port: 1080
networks:
- traefik