From fefbabcc3343b898cdd779f91cfbdc8ce2973c51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=AD=C3=B0ir=20Valberg=20Gu=C3=B0mundsson?= Date: Sun, 10 Feb 2019 08:59:53 +0100 Subject: [PATCH] Add postfix container. Get passit running with that. Fider is still not working. --- playbook.yml | 4 ++++ roles/docker/tasks/services.yml | 8 ++++++++ roles/docker/tasks/services/fider.yml | 7 ++++--- roles/docker/tasks/services/passit.yml | 7 ++++--- roles/docker/tasks/services/postfix.yml | 11 +++++++++++ 5 files changed, 31 insertions(+), 6 deletions(-) create mode 100644 roles/docker/tasks/services/postfix.yml diff --git a/playbook.yml b/playbook.yml index fd6d527..ccc7aa0 100644 --- a/playbook.yml +++ b/playbook.yml @@ -15,6 +15,10 @@ - fider - passit - gitea + - postfix + + smtp_host: postfix + smtp_port: 587 tasks: - import_role: diff --git a/roles/docker/tasks/services.yml b/roles/docker/tasks/services.yml index 45c9233..5728069 100644 --- a/roles/docker/tasks/services.yml +++ b/roles/docker/tasks/services.yml @@ -3,6 +3,14 @@ docker_network: name: external_services +- name: setup network for postfix + docker_network: + name: postfix + ipam_options: + subnet: '172.16.0.0/16' + gateway: 172.16.0.1 + + - name: setup services include_tasks: "services/{{ item }}.yml" with_items: "{{ services }}" diff --git a/roles/docker/tasks/services/fider.yml b/roles/docker/tasks/services/fider.yml index e8a5d59..ab6e797 100644 --- a/roles/docker/tasks/services/fider.yml +++ b/roles/docker/tasks/services/fider.yml @@ -19,17 +19,18 @@ volumes: - fider_db:/var/lib/postgresql/data env: - POSTGRES_DB: somethingelse POSTGRES_USER: fider POSTGRES_PASSWORD: "{{ postgres_passwords.fider }}" - name: fider app container docker_container: + name: fider image: getfider/fider:stable restart_policy: always networks: - name: fider - name: external_services + - name: postfix env: GO_ENV: production DATABASE_URL: postgres://fider:{{ postgres_passwords.fider }}@fider_db:5432/fider?sslmode=disable @@ -38,8 +39,8 @@ EMAIL_NOREPLY: noreply@{{ fider.domain }} EMAIL_SMTP_HOST: "{{ smtp_host }}" EMAIL_SMTP_PORT: "{{ smtp_port }}" - EMAIL_SMTP_USERNAME: "{{ smtp_username }}" - EMAIL_SMTP_PASSWORD: "{{ smtp_password }}" + EMAIL_SMTP_USERNAME: "noop" + EMAIL_SMTP_PASSWORD: "noop" VIRTUAL_HOST: "{{ fider.domain }}" LETSENCRYPT_HOST: "{{ fider.domain }}" diff --git a/roles/docker/tasks/services/passit.yml b/roles/docker/tasks/services/passit.yml index 9ee74bc..fd972ef 100644 --- a/roles/docker/tasks/services/passit.yml +++ b/roles/docker/tasks/services/passit.yml @@ -19,23 +19,24 @@ volumes: - passit_db:/var/lib/postgresql/data env: - POSTGRES_DB: somethingelse POSTGRES_USER: passit POSTGRES_PASSWORD: "{{ postgres_passwords.passit }}" - name: passit app container docker_container: + name: passit image: passit/passit:stable command: bin/start.sh restart_policy: always networks: - name: passit + - name: postfix - name: external_services env: - DATABASE_URL: "postgres://passit:{{ postgres_passwords.passit }}@db:5432/passit" + DATABASE_URL: "postgres://passit:{{ postgres_passwords.passit }}@passit_db:5432/passit" SECRET_KEY: "{{ passit_secret_key }}" IS_DEBUG: 'False' - EMAIL_URL: smtp://{{ smtp_user }}:{{ smtp_password }}@{{ smtp_host }}:{{ smtp_port}} + EMAIL_URL: smtp://noop@{{ smtp_host }}:{{ smtp_port }} DEFAULT_FROM_EMAIL: "noreply@{{ passit.domain }}" EMAIL_CONFIRMATION_HOST: "https://{{ passit.domain }}" diff --git a/roles/docker/tasks/services/postfix.yml b/roles/docker/tasks/services/postfix.yml new file mode 100644 index 0000000..5d5d6db --- /dev/null +++ b/roles/docker/tasks/services/postfix.yml @@ -0,0 +1,11 @@ +--- + +- name: setup postfix docker container for outgoing mail + docker_container: + name: postfix + image: boky/postfix + networks: + - name: postfix + env: + ALLOWED_SENDER_DOMAINS: "{{ base_domain }}" +