From ab964af9c302b6f0090ad28141f33916734077fb Mon Sep 17 00:00:00 2001 From: nbouma Date: Sat, 25 Mar 2023 15:55:37 +0100 Subject: [PATCH 1/7] Add redis support for nextcloud service --- group_vars/mash_servers | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/group_vars/mash_servers b/group_vars/mash_servers index 3ceb85f..90a767e 100644 --- a/group_vars/mash_servers +++ b/group_vars/mash_servers @@ -735,13 +735,19 @@ nextcloud_systemd_required_systemd_services_list: | (['docker.service']) + ([devture_postgres_identifier ~ '.service'] if devture_postgres_enabled and nextcloud_database_hostname == devture_postgres_identifier else []) + + + ([redis_identifier ~ '.service'] if redis_enabled and nextcloud_redis_enabled and nextcloud_redis_hostname == redis_identifier else []) }} nextcloud_container_additional_networks: | {{ - ([mash_playbook_reverse_proxyable_services_additional_network] if mash_playbook_reverse_proxyable_services_additional_network else []) - + - ([devture_postgres_container_network] if devture_postgres_enabled and nextcloud_database_hostname == devture_postgres_identifier and nextcloud_container_network != devture_postgres_container_network else []) + ( + ([mash_playbook_reverse_proxyable_services_additional_network] if mash_playbook_reverse_proxyable_services_additional_network else []) + + + ([devture_postgres_container_network] if devture_postgres_enabled and nextcloud_database_hostname == devture_postgres_identifier and nextcloud_container_network != devture_postgres_container_network else []) + + + ([redis_container_network] if redis_enabled and nextcloud_redis_enabled and nextcloud_redis_hostname == redis_identifier else []) + ) | unique }} nextcloud_container_labels_traefik_enabled: "{{ mash_playbook_traefik_labels_enabled }}" @@ -754,6 +760,9 @@ nextcloud_database_port: "{{ '5432' if devture_postgres_enabled else '' }}" nextcloud_database_username: "nextcloud" nextcloud_database_password: "{{ '%s' | format(mash_playbook_generic_secret_key) | password_hash('sha512', 'db.nextcloud', rounds=655555) | to_uuid }}" +nextcloud_redis_enabled: false +nextcloud_redis_hostname: "{{ redis_identifier if redis_enabled and nextcloud_redis_enabled else '' }}" + ######################################################################## # # # /nextcloud # From 4cd5a7795510e1e484e4edbb52d3d8012edd9855 Mon Sep 17 00:00:00 2001 From: Niels Bouma Date: Sat, 25 Mar 2023 16:05:21 +0100 Subject: [PATCH 2/7] Update nextcloud.md updated nextcloud service docs with redis support info --- docs/services/nextcloud.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/services/nextcloud.md b/docs/services/nextcloud.md index 31d194e..ff8599f 100644 --- a/docs/services/nextcloud.md +++ b/docs/services/nextcloud.md @@ -9,6 +9,7 @@ This service requires the following other services: - a [Postgres](postgres.md) database - a [Traefik](traefik.md) reverse-proxy server +- a [Redis](redis.md) data-store (optional) ## Configuration @@ -27,6 +28,9 @@ nextcloud_enabled: true nextcloud_hostname: mash.example.com nextcloud_path_prefix: /nextcloud +# Enable redis (optional) +#nextcloud_redis_enabled: true + ######################################################################## # # # /nextcloud # From 2ea62c3d31d3233e1e5e86cb2b741f3132f4e5b6 Mon Sep 17 00:00:00 2001 From: Niels Bouma <9073152+nielscil@users.noreply.github.com> Date: Wed, 29 Mar 2023 12:29:01 +0200 Subject: [PATCH 3/7] Redo Nextcloud redis intergration --- group_vars/mash_servers | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/group_vars/mash_servers b/group_vars/mash_servers index 90a767e..0799a57 100644 --- a/group_vars/mash_servers +++ b/group_vars/mash_servers @@ -730,23 +730,19 @@ nextcloud_base_path: "{{ mash_playbook_base_path }}/{{ mash_playbook_service_bas nextcloud_uid: "{{ mash_playbook_uid }}" nextcloud_gid: "{{ mash_playbook_gid }}" -nextcloud_systemd_required_systemd_services_list: | +nextcloud_systemd_required_services_list_auto: | {{ (['docker.service']) + ([devture_postgres_identifier ~ '.service'] if devture_postgres_enabled and nextcloud_database_hostname == devture_postgres_identifier else []) - + - ([redis_identifier ~ '.service'] if redis_enabled and nextcloud_redis_enabled and nextcloud_redis_hostname == redis_identifier else []) }} -nextcloud_container_additional_networks: | +nextcloud_container_additional_networks_auto: | {{ ( ([mash_playbook_reverse_proxyable_services_additional_network] if mash_playbook_reverse_proxyable_services_additional_network else []) + ([devture_postgres_container_network] if devture_postgres_enabled and nextcloud_database_hostname == devture_postgres_identifier and nextcloud_container_network != devture_postgres_container_network else []) - + - ([redis_container_network] if redis_enabled and nextcloud_redis_enabled and nextcloud_redis_hostname == redis_identifier else []) ) | unique }} @@ -760,9 +756,6 @@ nextcloud_database_port: "{{ '5432' if devture_postgres_enabled else '' }}" nextcloud_database_username: "nextcloud" nextcloud_database_password: "{{ '%s' | format(mash_playbook_generic_secret_key) | password_hash('sha512', 'db.nextcloud', rounds=655555) | to_uuid }}" -nextcloud_redis_enabled: false -nextcloud_redis_hostname: "{{ redis_identifier if redis_enabled and nextcloud_redis_enabled else '' }}" - ######################################################################## # # # /nextcloud # From c5a8115a73727abfc36df07f5d0d28a99c350ad1 Mon Sep 17 00:00:00 2001 From: Niels Bouma <9073152+nielscil@users.noreply.github.com> Date: Wed, 29 Mar 2023 12:57:45 +0200 Subject: [PATCH 4/7] Updated nextcloud docs Updated nextcloud docs for redis support --- docs/services/nextcloud.md | 142 ++++++++++++++++++++++++++++++++++++- 1 file changed, 139 insertions(+), 3 deletions(-) diff --git a/docs/services/nextcloud.md b/docs/services/nextcloud.md index ff8599f..485ccb3 100644 --- a/docs/services/nextcloud.md +++ b/docs/services/nextcloud.md @@ -9,7 +9,7 @@ This service requires the following other services: - a [Postgres](postgres.md) database - a [Traefik](traefik.md) reverse-proxy server -- a [Redis](redis.md) data-store (optional) +- a [Redis](redis.md) data-store (optional), installation details [below](#redis) ## Configuration @@ -28,8 +28,7 @@ nextcloud_enabled: true nextcloud_hostname: mash.example.com nextcloud_path_prefix: /nextcloud -# Enable redis (optional) -#nextcloud_redis_enabled: true +# Redis configuration, as described below ######################################################################## # # @@ -42,6 +41,143 @@ In the example configuration above, we configure the service to be hosted at `ht You can remove the `nextcloud_path_prefix` variable definition, to make it default to `/`, so that the service is served at `https://mash.example.com/`. +### Redis + +As described on the [Redis](redis.md) documentation page, if you're hosting additional services which require Redis on the same server, you'd better go for installing a separate Redis instance for each service. See [Creating a Redis instance dedicated to Nextcloud](#creating-a-redis-instance-dedicated-to-nextcloud). + +If you're only running Nextcloud on this server and don't need to use Redis for anything else, you can [use a single Redis instance](#using-the-shared-redis-instance-for-nextcloud). + +#### Using the shared Redis instance for Nextcloud + +To install a single (non-dedicated) Redis instance (`mash-redis`) and hook Nextcloud to it, add the following **additional** configuration: + +```yaml +######################################################################## +# # +# redis # +# # +######################################################################## + +redis_enabled: true + +######################################################################## +# # +# /redis # +# # +######################################################################## + + +######################################################################## +# # +# nextcloud # +# # +######################################################################## + +# Base configuration as shown above + +# Point Nextcloud to the shared Redis instance +nextcloud_redis_hostname: "{{ redis_identifier }}" + +# Make sure the Nextcloud service (mash-nextcloud.service) starts after the shared Redis service (mash-redis.service) +nextcloud_systemd_required_services_list_custom: + - "{{ redis_identifier }}.service" + +# Make sure the Nextcloud container is connected to the container network of the shared Redis service (mash-redis) +nextcloud_container_additional_networks_custom: + - "{{ redis_identifier }}" + +######################################################################## +# # +# /nextcloud # +# # +######################################################################## +``` +This will create a `mash-redis` Redis instance on this host. + +This is only recommended if you won't be installing other services which require Redis. Alternatively, go for [Creating a Redis instance dedicated to Nextcloud](#creating-a-redis-instance-dedicated-to-nextcloud). + +#### Creating a Redis instance dedicated to Nextcloud + +The following instructions are based on the [Running multiple instances of the same service on the same host](../running-multiple-instances.md) documentation. + +Adjust your `inventory/hosts` file as described in [Re-do your inventory to add supplementary hosts](../running-multiple-instances.md#re-do-your-inventory-to-add-supplementary-hosts), adding a new supplementary host (e.g. if `nextcloud.example.com` is your main one, create `nectcloud.example.com-deps`). + +Then, create a new `vars.yml` file for the + +`inventory/host_vars/nextcloud.example.com-deps/vars.yml`: + +```yaml +--- + +######################################################################## +# # +# Playbook # +# # +######################################################################## + +# Put a strong secret below, generated with `pwgen -s 64 1` or in another way +# Various other secrets will be derived from this secret automatically. +mash_playbook_generic_secret_key: '' + +# Override service names and directory path prefixes +mash_playbook_service_identifier_prefix: 'mash-nextcloud-' +mash_playbook_service_base_directory_name_prefix: 'nextcloud-' + +######################################################################## +# # +# /Playbook # +# # +######################################################################## + + +######################################################################## +# # +# redis # +# # +######################################################################## + +redis_enabled: true + +######################################################################## +# # +# /redis # +# # +######################################################################## +``` + +This will create a `mash-nextcloud-redis` instance on this host with its data in `/mash/nextcloud-redis`. + +Then, adjust your main inventory host's variables file (`inventory/host_vars/nextcloud.example.com/vars.yml`) like this: + +```yaml +######################################################################## +# # +# nextcloud # +# # +######################################################################## + +# Base configuration as shown above + +# Point Nextcloud to its dedicated Redis instance +nextcloud_redis_hostname: mash-nextcloud-redis + +# Make sure the Nextcloud service (mash-nextcloud.service) starts after its dedicated Redis service (mash-nextcloud-redis.service) +nextcloud_systemd_required_services_list_custom: + - "mash-nextcloud-redis.service" + +# Make sure the Nextcloud container is connected to the container network of its dedicated Redis service (mash-nextcloud-redis) +nextcloud_container_additional_networks_custom: + - "mash-nextcloud-redis" + +######################################################################## +# # +# /nextcloud # +# # +######################################################################## +``` +## Installation + +If you've decided to install a dedicated Redis instance for Nextcloud, make sure to first do [installation](../installing.md) for the supplementary inventory host (e.g. `nextcloud.example.com-deps`), before running installation for the main one (e.g. `nextcloud.example.com`). ## Usage From bbff1efb0e336df071bf4a2dac3bf7f1b49f1c9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian-Samuel=20Geb=C3=BChr?= Date: Wed, 29 Mar 2023 21:38:32 +0200 Subject: [PATCH 5/7] Change order for Agru --- requirements.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.yml b/requirements.yml index 2526b6b..215908e 100644 --- a/requirements.yml +++ b/requirements.yml @@ -106,5 +106,5 @@ version: 3a2a1e4c6b484b643a847941937a80d0efd86d6c name: firezone - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-gotosocial.git - name: gotosocial version: d608eb330af28b75d3e4881b2e8c09af64d078f1 + name: gotosocial From 965598fcf9023cf2eb4228ab0a4e0eed7abcc64f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian-Samuel=20Geb=C3=BChr?= Date: Wed, 29 Mar 2023 21:38:57 +0200 Subject: [PATCH 6/7] Typo --- group_vars/mash_servers | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/group_vars/mash_servers b/group_vars/mash_servers index f2bedc4..49661f6 100644 --- a/group_vars/mash_servers +++ b/group_vars/mash_servers @@ -1633,7 +1633,7 @@ firezone_container_labels_traefik_tls_certResolver: "{{ devture_traefik_certReso ######################################################################## # # -# gotsocial # +# gotosocial # # # ######################################################################## From b1f67d522ead91a4ab3b6ab535411648a380d9af Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Thu, 30 Mar 2023 09:01:38 +0300 Subject: [PATCH 7/7] Upgrade Woodpecker (v0.15.7-2 -> v0.15.7-3) --- requirements.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.yml b/requirements.yml index 2526b6b..4503c9d 100644 --- a/requirements.yml +++ b/requirements.yml @@ -30,7 +30,7 @@ - src: git+https://github.com/devture/com.devture.ansible.role.playbook_runtime_messages.git version: 9b4b088c62b528b73a9a7c93d3109b091dd42ec6 - src: git+https://github.com/devture/com.devture.ansible.role.woodpecker_ci_server.git - version: v0.15.7-2 + version: v0.15.7-3 - src: git+https://github.com/devture/com.devture.ansible.role.woodpecker_ci_agent.git version: v0.15.7-1 - src: git+https://gitlab.com/etke.cc/roles/miniflux.git