2023-12-08 00:34:48 +01:00
|
|
|
---
|
2024-01-05 11:13:51 +01:00
|
|
|
|
|
|
|
# Necessary for building: https://chat.openai.com/share/99d258cc-294b-4924-8eef-02fe419bb838
|
|
|
|
- name: install which
|
|
|
|
pacman:
|
|
|
|
name: which
|
|
|
|
state: present
|
|
|
|
|
2025-02-04 18:14:37 +01:00
|
|
|
- name: "include docker-central-database"
|
|
|
|
include_role:
|
|
|
|
name: docker-central-database
|
2024-01-02 21:13:34 +01:00
|
|
|
|
2025-02-19 02:00:41 +01:00
|
|
|
- name: "include role nginx-domain-setup for {{application_id}}"
|
|
|
|
include_role:
|
|
|
|
name: nginx-domain-setup
|
2023-12-08 00:34:48 +01:00
|
|
|
|
2025-01-30 15:04:23 +01:00
|
|
|
- name: "cleanup central database from {{application_id}}_default network"
|
2024-01-08 18:21:42 +01:00
|
|
|
command:
|
2025-02-14 09:37:22 +01:00
|
|
|
cmd: "docker network disconnect {{applications.discourse.network}} central-{{ database_type }}"
|
2024-01-08 18:21:42 +01:00
|
|
|
ignore_errors: true
|
2024-01-08 19:38:36 +01:00
|
|
|
when: mode_reset | bool
|
2024-01-08 18:21:42 +01:00
|
|
|
|
2024-01-05 20:16:08 +01:00
|
|
|
- name: add docker-compose.yml
|
2024-01-11 11:25:45 +01:00
|
|
|
template:
|
|
|
|
src: docker-compose.yml.j2
|
2025-02-04 18:14:37 +01:00
|
|
|
dest: "{{docker_compose.directories.instance}}docker-compose.yml"
|
2024-01-05 20:16:08 +01:00
|
|
|
notify: docker compose project setup
|
|
|
|
|
|
|
|
- name: flush, to recreate discourse docker compose
|
|
|
|
meta: flush_handlers
|
2023-12-08 00:34:48 +01:00
|
|
|
|
|
|
|
- name: pull docker repository
|
|
|
|
git:
|
|
|
|
repo: "https://github.com/discourse/discourse_docker.git"
|
2024-01-05 20:16:08 +01:00
|
|
|
dest: "{{discourse_repository_directory}}"
|
2023-12-08 00:34:48 +01:00
|
|
|
update: yes
|
|
|
|
notify: recreate discourse
|
|
|
|
become: true
|
|
|
|
ignore_errors: true
|
|
|
|
|
2024-01-05 20:16:08 +01:00
|
|
|
- name: set chmod 700 for {{discourse_repository_directory}}containers
|
2023-12-08 00:34:48 +01:00
|
|
|
ansible.builtin.file:
|
2024-01-05 20:16:08 +01:00
|
|
|
path: "{{discourse_repository_directory}}/containers"
|
2023-12-08 00:34:48 +01:00
|
|
|
mode: '700'
|
|
|
|
state: directory
|
|
|
|
|
2025-02-04 22:37:07 +01:00
|
|
|
- name: "copy configuration to {{discourse_application_yml_destination}}"
|
2023-12-08 00:34:48 +01:00
|
|
|
template:
|
2024-01-08 18:21:42 +01:00
|
|
|
src: discourse_application.yml.j2
|
2025-02-04 22:37:07 +01:00
|
|
|
dest: "{{discourse_application_yml_destination}}"
|
2024-01-05 20:16:08 +01:00
|
|
|
notify: recreate discourse
|
|
|
|
|
2024-01-09 15:03:37 +01:00
|
|
|
- name: "destroy container discourse_application"
|
|
|
|
command:
|
|
|
|
cmd: "./launcher destroy discourse_application"
|
|
|
|
chdir: "{{discourse_repository_directory}}"
|
|
|
|
ignore_errors: true
|
2024-02-06 23:14:56 +01:00
|
|
|
notify: recreate discourse
|
2024-01-09 15:03:37 +01:00
|
|
|
when: mode_reset | bool
|
|
|
|
|
2024-01-05 20:16:08 +01:00
|
|
|
- name: flush, to recreate discourse app
|
|
|
|
meta: flush_handlers
|
2024-01-20 15:19:02 +01:00
|
|
|
|
2025-02-13 14:11:06 +01:00
|
|
|
- name: "add {{applications.discourse.container}} to network central_postgres"
|
2024-01-20 15:19:02 +01:00
|
|
|
command:
|
2025-02-13 14:11:06 +01:00
|
|
|
cmd: "docker network connect central_postgres {{applications.discourse.container}}"
|
2024-01-20 15:19:02 +01:00
|
|
|
ignore_errors: true
|
|
|
|
when: enable_central_database | bool
|
2024-01-09 15:03:37 +01:00
|
|
|
|
2025-01-30 15:04:23 +01:00
|
|
|
- name: "remove central database from {{application_id}}_default"
|
2024-01-05 20:16:08 +01:00
|
|
|
command:
|
2025-02-14 09:37:22 +01:00
|
|
|
cmd: "docker network disconnect {{applications.discourse.network}} central-{{ database_type }}"
|
2024-02-07 23:13:28 +01:00
|
|
|
ignore_errors: true
|
2024-01-05 20:16:08 +01:00
|
|
|
when: enable_central_database | bool
|