This commit is contained in:
Aeris 2018-12-28 22:03:40 +01:00
parent ef7471b3dd
commit 3bfceed585
5 changed files with 50 additions and 12 deletions

View file

@ -1,2 +1,2 @@
[servers] [servers]
club_secure club_mail

View file

@ -0,0 +1,25 @@
- name: Install and start docker
environment:
PYTHONPATH: "/usr/local/lib/python2.7/dist-packages"
block:
- apt_key:
url: https://download.docker.com/linux/debian/gpg
state: present
- apt_repository:
repo: deb [arch=amd64] https://download.docker.com/linux/debian buster stable
state: present
- apt:
name: docker-ce
state: present
- pip:
name: docker-compose
- systemd:
enabled: yes
state: started
daemon_reload: yes
name: docker

View file

@ -0,0 +1,3 @@
---
dependencies:
- { role: docker }

View file

@ -17,6 +17,11 @@
name: "{{ docker_project_folder }}/mailserver/nginx" name: "{{ docker_project_folder }}/mailserver/nginx"
state: directory state: directory
- name: Create db folder
file:
name: "{{ docker_project_folder }}/mailserver/db"
state: directory
- name: Copy nginx config \#1 - name: Copy nginx config \#1
template: template:
src: mailman-web.conf.j2 src: mailman-web.conf.j2
@ -32,6 +37,11 @@
src: smtp src: smtp
dest: "{{ docker_project_folder }}/mailserver" dest: "{{ docker_project_folder }}/mailserver"
- name: Create nginx include folder
file:
name: "{{ docker_project_folder }}/mailserver/webmail"
state: directory
- name: Copy webmail Add - name: Copy webmail Add
template: template:
src: config.inc.php.j2 src: config.inc.php.j2
@ -87,13 +97,13 @@
- name: Copy mailman-conf - name: Copy mailman-conf
copy: copy:
src: mailman-extra.cfg src: mailman/mailman-extra.cfg
dest: "{{ docker_project_folder }}/mailserver/mailman-extra.cfg" dest: "{{ docker_project_folder }}/mailserver/mailman-extra.cfg"
- name: New Mysql EntryPoint - name: New Mysql EntryPoint
copy: copy:
src: docker-entrypoint.sh src: db/docker-entrypoint.sh
dest: "{{ docker_project_folder }}/mailserver/docker-entrypoint.sh" dest: "{{ docker_project_folder }}/mailserver/db/docker-entrypoint.sh"
mode: "555" mode: "555"
- name: Copy docker-compose - name: Copy docker-compose

View file

@ -29,8 +29,8 @@ services:
labels: labels:
- "traefik.enable=false" - "traefik.enable=false"
networks: networks:
defualt: default:
alias: aliases:
- smtp - smtp
imap: imap:
@ -113,7 +113,7 @@ services:
- db:db - db:db
depends_on: depends_on:
- db - db
image: hardware/postfixadmin:latest image: hardware/postfixadmin
expose: expose:
- "8888" - "8888"
restart: always restart: always
@ -131,7 +131,7 @@ services:
db: db:
container_name: mariadb container_name: mariadb
image: mariadb:10.3 image: mariadb:latest
restart: always restart: always
environment: environment:
MYSQL_ROOT_PASSWORD: {{ DB_ROOT_PASSWORD }} MYSQL_ROOT_PASSWORD: {{ DB_ROOT_PASSWORD }}
@ -224,7 +224,7 @@ services:
traefik: traefik:
container_name: traefik container_name: traefik
image: traefik image: traefik:alpine
command: --api --docker # Enables the web UI and tells Traefik to listen to docker command: --api --docker # Enables the web UI and tells Traefik to listen to docker
restart: always restart: always
ports: ports:
@ -241,12 +241,12 @@ services:
container_name: extractor container_name: extractor
image: danielhuisman/traefik-certificate-extractor image: danielhuisman/traefik-certificate-extractor
volumes: volumes:
- {{ docker_data_folder }}/mailserver/traefik:/app/data - {{ docker_project_folder }}/mailserver/traefik:/app/data
- certs:/app/certs_flat - certs:/app/certs_flat
labels: labels:
- "traefik.enable=false" - "traefik.enable=false"
networks: networks:
default: default:
volumes: volumes: