mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 15:06:26 +02:00
Restructure and cleaned up in preparation of new backup logic
This commit is contained in:
@@ -1,10 +1,8 @@
|
||||
network: "discourse_default" # Name of the docker network
|
||||
container: "discourse_application" # Name of the container application
|
||||
repository: "discourse_repository" # Name of the repository folder
|
||||
features:
|
||||
matomo: true
|
||||
css: true
|
||||
port-ui-desktop: true
|
||||
port-ui-desktop: true
|
||||
oidc: true
|
||||
central_database: true
|
||||
ldap: false # @todo implement and activate
|
||||
@@ -25,4 +23,13 @@ docker:
|
||||
database:
|
||||
enabled: true
|
||||
redis:
|
||||
enabled: true
|
||||
enabled: true
|
||||
# This container is propably wrong name.
|
||||
# Chance is high that the name is discourse_application.
|
||||
# @todo check this out and repair it if necessary
|
||||
discourse:
|
||||
name: "discourse"
|
||||
no_stop_required: true
|
||||
volumes:
|
||||
data: discourse_data
|
||||
network: discourse
|
||||
|
@@ -1,7 +1,7 @@
|
||||
---
|
||||
- name: "stop and remove discourse container if it exist"
|
||||
docker_container:
|
||||
name: "{{applications | get_app_conf(application_id, 'container', True)}}"
|
||||
name: "{{ discourse_name }}"
|
||||
state: absent
|
||||
register: container_action
|
||||
failed_when: container_action.failed and 'No such container' not in container_action.msg
|
||||
@@ -17,7 +17,7 @@
|
||||
listen: recreate discourse
|
||||
|
||||
- name: rebuild discourse
|
||||
shell: ./launcher rebuild {{applications | get_app_conf(application_id, 'container', True)}}
|
||||
shell: ./launcher rebuild {{ discourse_name }}
|
||||
args:
|
||||
executable: /bin/bash
|
||||
chdir: "{{docker_repository_directory }}"
|
||||
|
@@ -43,26 +43,26 @@
|
||||
meta: flush_handlers
|
||||
when: run_once_docker_discourse is not defined
|
||||
|
||||
- name: "Connect {{ applications | get_app_conf(application_id, 'container', True) }} to network {{ applications['svc-db-postgres'].network }}"
|
||||
- name: "Connect {{ discourse_name }} to network {{ applications['svc-db-postgres'].network }}"
|
||||
command: >
|
||||
docker network connect {{ applications['svc-db-postgres'].network }} {{ applications | get_app_conf(application_id, 'container', True) }}
|
||||
docker network connect {{ applications['svc-db-postgres'].network }} {{ discourse_name }}
|
||||
register: network_connect
|
||||
failed_when: >
|
||||
network_connect.rc != 0 and
|
||||
'Error response from daemon: endpoint with name {{ applications | get_app_conf(application_id, 'container', True) }} already exists in network {{ applications["svc-db-postgres"].network }}'
|
||||
'Error response from daemon: endpoint with name {{ discourse_name }} already exists in network {{ applications["svc-db-postgres"].network }}'
|
||||
not in network_connect.stderr
|
||||
changed_when: network_connect.rc == 0
|
||||
when:
|
||||
- applications | get_app_conf(application_id, 'features.central_database', False)
|
||||
- run_once_docker_discourse is not defined
|
||||
|
||||
- name: "Remove {{ applications | get_app_conf(application_id, 'network', True) }} from {{ database_host }}"
|
||||
- name: "Remove {{ discourse_network }} from {{ database_host }}"
|
||||
command: >
|
||||
docker network disconnect {{ applications | get_app_conf(application_id, 'network', True) }} {{ database_host }}
|
||||
docker network disconnect {{ discourse_network }} {{ database_host }}
|
||||
register: network_disconnect
|
||||
failed_when: >
|
||||
network_disconnect.rc != 0 and
|
||||
'is not connected to network {{ applications | get_app_conf(application_id, 'network', True) }}' not in network_disconnect.stderr
|
||||
'is not connected to network {{ discourse_network }}' not in network_disconnect.stderr
|
||||
changed_when: network_disconnect.rc == 0
|
||||
when:
|
||||
- applications | get_app_conf(application_id, 'features.central_database', False)
|
||||
|
@@ -90,7 +90,7 @@ env:
|
||||
## The Docker container is stateless; all data is stored in /shared
|
||||
volumes:
|
||||
- volume:
|
||||
host: discourse_data
|
||||
host: {{ discourse_volume }}
|
||||
guest: /shared
|
||||
- volume:
|
||||
host: /var/discourse/shared/standalone/log/var-log
|
||||
@@ -178,4 +178,4 @@ run:
|
||||
|
||||
docker_args:
|
||||
- --network={{application_id}}_default
|
||||
- --name={{applications | get_app_conf(application_id, 'container', True)}}
|
||||
- --name={{ discourse_name }}
|
||||
|
@@ -1,6 +1,15 @@
|
||||
application_id: "discourse"
|
||||
application_id: "web-app-discourse"
|
||||
|
||||
# Database
|
||||
database_password: "{{ applications | get_app_conf(application_id, 'credentials.database_password', True) }}"
|
||||
database_type: "postgres"
|
||||
docker_repository_directory : "{{docker_compose.directories.services}}{{applications | get_app_conf(application_id, 'repository', True)}}/"
|
||||
discourse_application_yml_destination: "{{docker_repository_directory }}containers/{{applications | get_app_conf(application_id, 'container', True)}}.yml"
|
||||
|
||||
# Discourse
|
||||
discourse_name: "{{ applications | get_app_conf(application_id, 'docker.services.discourse.name', True) }}"
|
||||
discourse_application_yml_destination: "{{ docker_repository_directory }}containers/{{discourse_name }}.yml"
|
||||
discourse_network: "{{ applications | get_app_conf(application_id, 'docker.network', True) }}"
|
||||
discourse_volume: "{{ applications | get_app_conf(application_id, 'docker.volumes.data', True) }}"
|
||||
|
||||
# General Docker Configuration
|
||||
docker_repository_directory : "{{ docker_compose.directories.services}}{{applications | get_app_conf(application_id, 'repository', True) }}/"
|
||||
docker_compose_flush_handlers: false
|
Reference in New Issue
Block a user