75 lines
2.3 KiB
YAML
Raw Normal View History

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
- name: "include docker-central-database"
include_role:
name: docker-central-database
- name: "include role nginx-domain-setup for {{application_id}}"
include_role:
name: nginx-domain-setup
2023-12-08 00:34:48 +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
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"
dest: "{{docker_repository_directory }}"
2023-12-08 00:34:48 +01:00
update: yes
notify: recreate discourse
become: true
ignore_errors: true
- name: set chmod 700 for {{docker_repository_directory }}containers
2023-12-08 00:34:48 +01:00
ansible.builtin.file:
path: "{{docker_repository_directory }}/containers"
2023-12-08 00:34:48 +01:00
mode: '700'
state: directory
- 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
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: "{{docker_repository_directory }}"
2024-01-09 15:03:37 +01:00
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
- name: "add {{applications.discourse.container}} to network central_postgres"
2024-01-20 15:19:02 +01:00
command:
cmd: "docker network connect central_postgres {{applications.discourse.container}}"
2024-01-20 15:19:02 +01:00
ignore_errors: true
when: applications[application_id].database.central_storage | bool
2024-01-09 15:03:37 +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
when: applications[application_id].database.central_storage | bool