From 42f4cf186755f33ee0c2474668129c32293cc33d Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Sat, 20 Jan 2024 15:19:02 +0100 Subject: [PATCH] Solved network bug --- roles/docker-discourse/handlers/main.yml | 2 +- roles/docker-discourse/tasks/main.yml | 6 ++++++ .../templates/discourse_application.yml.j2 | 2 +- roles/docker-discourse/vars/main.yml | 9 +++++---- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/roles/docker-discourse/handlers/main.yml b/roles/docker-discourse/handlers/main.yml index 83e79d85..2c3842e3 100644 --- a/roles/docker-discourse/handlers/main.yml +++ b/roles/docker-discourse/handlers/main.yml @@ -1,5 +1,5 @@ --- - name: recreate discourse command: - cmd: ./launcher rebuild discourse_application + cmd: "./launcher rebuild {{discourse_application_container}}" chdir: "{{discourse_repository_directory}}" diff --git a/roles/docker-discourse/tasks/main.yml b/roles/docker-discourse/tasks/main.yml index 5c851b9b..a47787e7 100644 --- a/roles/docker-discourse/tasks/main.yml +++ b/roles/docker-discourse/tasks/main.yml @@ -63,6 +63,12 @@ - name: flush, to recreate discourse app meta: flush_handlers + +- name: "add {{discourse_application_container}} to network central_postgres" + command: + cmd: "docker network connect central_postgres {{discourse_application_container}}" + ignore_errors: true + when: enable_central_database | bool - name: "remove central database from {{docker_compose_project_name}}_default" command: diff --git a/roles/docker-discourse/templates/discourse_application.yml.j2 b/roles/docker-discourse/templates/discourse_application.yml.j2 index 9c9d4c1b..b9e9e3bc 100644 --- a/roles/docker-discourse/templates/discourse_application.yml.j2 +++ b/roles/docker-discourse/templates/discourse_application.yml.j2 @@ -119,4 +119,4 @@ run: docker_args: - --network={{docker_compose_project_name}}_default - - --name=discourse_application + - --name={{discourse_application_container}} diff --git a/roles/docker-discourse/vars/main.yml b/roles/docker-discourse/vars/main.yml index 97076eb9..b3b4be4a 100644 --- a/roles/docker-discourse/vars/main.yml +++ b/roles/docker-discourse/vars/main.yml @@ -1,4 +1,5 @@ -docker_compose_project_name: "discourse" -database_password: "{{ baserow_database_password }}" -database_type: "postgres" -discourse_repository_directory: "{{ path_docker_compose_instances + docker_compose_project_name + '/repository/' }}" \ No newline at end of file +docker_compose_project_name: "discourse" +discourse_application_container: "discourse_application" +database_password: "{{ baserow_database_password }}" +database_type: "postgres" +discourse_repository_directory: "{{ path_docker_compose_instances + docker_compose_project_name + '/repository/' }}" \ No newline at end of file