Refactoring of discourse role during debugging

This commit is contained in:
2025-08-15 20:06:56 +02:00
parent 3adb08fc68
commit e3b09e7f1a
10 changed files with 111 additions and 105 deletions

View File

@@ -0,0 +1,21 @@
- name: "Connect '{{ DISCOURSE_CONTAINER }}' to network '{{ DISCOURSE_PG_NETWORK }}'"
command: >
docker network connect {{ DISCOURSE_PG_NETWORK }} {{ DISCOURSE_CONTAINER }}
register: network_connect
failed_when: >
network_connect.rc != 0 and
DISCOURSE_ERROR_ALREADY_IN_NET not in network_connect.stderr
changed_when: network_connect.rc == 0
when:
- applications | get_app_conf(application_id, 'features.central_database', False)
- name: "Remove {{ DISCOURSE_NETWORK }} from {{ database_host }}"
command: >
docker network disconnect {{ DISCOURSE_NETWORK }} {{ database_host }}
register: network_disconnect
failed_when: >
network_disconnect.rc != 0 and
DISCOURSE_ERROR_NOT_CONNECTED not in network_disconnect.stderr
changed_when: network_disconnect.rc == 0
when:
- applications | get_app_conf(application_id, 'features.central_database', False)