Adapted discourse version to new code after the big refactoring

This commit is contained in:
2025-07-20 09:29:56 +02:00
parent 1b9775ccb5
commit d86ca6cc0e
11 changed files with 81 additions and 21 deletions

View File

@@ -1,2 +1,3 @@
# Todo
- Finish LDAP implementation
- Finish LDAP implementation
- Check if this current network setting makes sense. Seems a bit unneccessary complicated. Could be that a more straight foreword approach makes more sense.

View File

@@ -32,3 +32,16 @@ docker:
volumes:
data: discourse_data
network: discourse
plugins:
docker_manager:
enabled: true
discourse-activity-pub:
enabled: true
discourse-akismet:
enabled: true
discourse-cakeday:
enabled: true
discourse-solved:
enabled: true
discourse-voting:
enabled: true

View File

@@ -7,7 +7,7 @@
failed_when: container_action.failed and 'No such container' not in container_action.msg
listen: recreate discourse
- name: "add central database temporary to {{ discourse_network }}"
- name: "add central database temporary to discourse network"
command: "docker network connect {{ discourse_network }} {{ database_host }}"
failed_when: >
result.rc != 0 and

View File

@@ -35,9 +35,10 @@
template:
src: config.yml.j2
dest: "{{ discourse_application_yml_destination }}"
mode: '0640'
notify: recreate discourse
- name: "Verify that {{ discourse_container }} is running"
- name: "Verify that '{{ discourse_container }}' is running"
command: docker compose ps --filter status=running --format '{{"{{"}}.Name{{"}}"}}' | grep -x {{ discourse_container }}
register: docker_ps
changed_when: docker_ps.rc == 1
@@ -62,13 +63,17 @@
when:
- applications | get_app_conf(application_id, 'features.central_database', False)
- name: Set error string for network not connected
set_fact:
docker_discourse_not_connected: 'is not connected to network {{ discourse_network }}'
- 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
'is not connected to network {{ discourse_network }}' not in network_disconnect.stderr
docker_discourse_not_connected not in network_disconnect.stderr
changed_when: network_disconnect.rc == 0
when:
- applications | get_app_conf(application_id, 'features.central_database', False)

View File

@@ -74,7 +74,7 @@ env:
DISCOURSE_DB_NAME: {{ database_name }}
# Redis Configuration
DISCOURSE_REDIS_HOST: {{application_id}}-redis
DISCOURSE_REDIS_HOST: {{ discourse_redis_host }}
## If you added the Lets Encrypt template, uncomment below to get a free SSL certificate
#LETSENCRYPT_ACCOUNT_EMAIL: administrator@veen.world
@@ -103,18 +103,11 @@ hooks:
- exec:
cd: $home/plugins
cmd:
- git clone --depth=1 https://github.com/discourse/docker_manager.git
- git clone --depth=1 https://github.com/discourse/discourse-activity-pub.git
- git clone --depth=1 https://github.com/discourse/discourse-calendar.git
- git clone --depth=1 https://github.com/discourse/discourse-akismet.git
- git clone --depth=1 https://github.com/discourse/discourse-cakeday.git
- git clone --depth=1 https://github.com/discourse/discourse-solved.git
- git clone --depth=1 https://github.com/discourse/discourse-voting.git
- git clone --depth=1 https://github.com/discourse/discourse-oauth2-basic.git
{% if applications | get_app_conf(application_id, 'features.oidc', False) %}
- git clone --depth=1 https://github.com/discourse/discourse-openid-connect.git
{% for plugin_name, plugin_config in discourse_plugins.items() %}
{% if plugin_config.enabled %}
- git clone --depth=1 https://github.com/discourse/{{ plugin_name }}.git
{% endif %}
{% endfor %}
{% if applications | get_app_conf(application_id, 'features.ldap', False) %}
- git clone --depth=1 https://github.com/jonmbake/discourse-ldap-auth.git
@@ -177,5 +170,5 @@ run:
- exec: echo "End of custom commands"
docker_args:
- --network={{application_id}}_default
- --network={{ discourse_network }}
- --name={{ discourse_container }}

View File

@@ -4,5 +4,5 @@
redis:
{% include 'roles/docker-compose/templates/networks.yml.j2' %}
discourse_default:
{{ discourse_network }}:
external: true

View File

@@ -6,10 +6,12 @@ database_type: "postgres"
# Discourse
discourse_container: "{{ applications | get_app_conf(application_id, 'docker.services.discourse.name') }}"
discourse_application_yml_destination: "{{ docker_repository_directory }}containers/{{ discourse_container }}.yml"
discourse_network: "{{ applications | get_app_conf(application_id, 'docker.network') }}"
discourse_volume: "{{ applications | get_app_conf(application_id, 'docker.volumes.data') }}"
discourse_plugins: "{{ applications | get_app_conf(application_id, 'plugins') }}"
discourse_pg_network: "{{ applications | get_app_conf('svc-db-postgres', 'docker.network' ) }}"
discourse_application_yml_destination: "{{ docker_repository_directory }}containers/{{ discourse_container }}.yml"
discourse_redis_host: "{{ application_id |get_entity_name }}-redis"
# General Docker Configuration
docker_repository_directory : "{{ docker_compose.directories.services}}{{applications | get_app_conf( application_id, 'repository') }}/"