diff --git a/playbook.yml b/playbook.yml index fd6d5271..ccc7aa0d 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 45c9233e..57280699 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 e8a5d598..ab6e7978 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 9ee74bc4..fd972ef2 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 00000000..5d5d6db1 --- /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 }}" +