diff --git a/roles/docker-compose/templates/base.yml.j2 b/roles/docker-compose/templates/base.yml.j2 index ab86b96f..16e90b16 100644 --- a/roles/docker-compose/templates/base.yml.j2 +++ b/roles/docker-compose/templates/base.yml.j2 @@ -5,7 +5,7 @@ services: {% include 'roles/cmp-rdbms/templates/services/main.yml.j2' %} {% endif %} {# Load Redis #} -{% if applications | is_docker_service_enabled(application_id, 'redis') %} +{% if applications | is_docker_service_enabled(application_id, 'redis') or applications | get_app_conf(application_id, 'features.oauth2', False) %} {% include 'roles/svc-db-redis/templates/service.yml.j2' %} {% endif %} {# Load OAuth2 Proxy #} diff --git a/roles/docker-compose/templates/volumes.yml.j2 b/roles/docker-compose/templates/volumes.yml.j2 index 8efc4408..50c07625 100644 --- a/roles/docker-compose/templates/volumes.yml.j2 +++ b/roles/docker-compose/templates/volumes.yml.j2 @@ -1,7 +1,11 @@ {# This template needs to be included in docker-compose.yml which contain a database and additional volumes #} volumes: -{% if not applications | get_app_conf(application_id, 'features.central_database', False) and applications | get_app_conf(application_id, 'docker.services.database.enabled', False) %} +{% if applications | is_docker_service_enabled(application_id, 'database') and not applications | get_app_conf(application_id, 'features.central_database', False) %} database: name: {{ database_volume }} {% endif %} +{% if applications | is_docker_service_enabled(application_id, 'redis') or applications | get_app_conf(application_id, 'features.oauth2', False) %} + redis: + name: {{ application_id | get_entity_name }} +{% endif %} {{ "\n" }} \ No newline at end of file diff --git a/roles/web-app-attendize/templates/docker-compose.yml.j2 b/roles/web-app-attendize/templates/docker-compose.yml.j2 index 00625a23..e8483110 100644 --- a/roles/web-app-attendize/templates/docker-compose.yml.j2 +++ b/roles/web-app-attendize/templates/docker-compose.yml.j2 @@ -24,6 +24,5 @@ - .:/var/www {% include 'roles/docker-compose/templates/volumes.yml.j2' %} - redis: {% include 'roles/docker-compose/templates/networks.yml.j2' %} \ No newline at end of file diff --git a/roles/web-app-baserow/templates/docker-compose.yml.j2 b/roles/web-app-baserow/templates/docker-compose.yml.j2 index 5e3b21f3..b3ee3cd1 100644 --- a/roles/web-app-baserow/templates/docker-compose.yml.j2 +++ b/roles/web-app-baserow/templates/docker-compose.yml.j2 @@ -14,6 +14,5 @@ {% include 'roles/docker-compose/templates/volumes.yml.j2' %} data: name: {{ baserow_volume }} - redis: {% include 'roles/docker-compose/templates/networks.yml.j2' %} \ No newline at end of file diff --git a/roles/web-app-discourse/templates/docker-compose.yml.j2 b/roles/web-app-discourse/templates/docker-compose.yml.j2 index 552af217..f1521ccb 100644 --- a/roles/web-app-discourse/templates/docker-compose.yml.j2 +++ b/roles/web-app-discourse/templates/docker-compose.yml.j2 @@ -1,7 +1,6 @@ {% include 'roles/docker-compose/templates/base.yml.j2' %} {% include 'roles/docker-compose/templates/volumes.yml.j2' %} - redis: {% include 'roles/docker-compose/templates/networks.yml.j2' %} {{ discourse_network }}: diff --git a/roles/web-app-funkwhale/templates/docker-compose.yml.j2 b/roles/web-app-funkwhale/templates/docker-compose.yml.j2 index c3008b07..82e5d8f3 100644 --- a/roles/web-app-funkwhale/templates/docker-compose.yml.j2 +++ b/roles/web-app-funkwhale/templates/docker-compose.yml.j2 @@ -63,7 +63,6 @@ {% include 'roles/docker-compose/templates/volumes.yml.j2' %} data: funkwhale_static_root: - redis: music: {% include 'roles/docker-compose/templates/networks.yml.j2' %} \ No newline at end of file diff --git a/roles/web-app-gitlab/templates/docker-compose.yml.j2 b/roles/web-app-gitlab/templates/docker-compose.yml.j2 index 4ffa7017..2a70c106 100644 --- a/roles/web-app-gitlab/templates/docker-compose.yml.j2 +++ b/roles/web-app-gitlab/templates/docker-compose.yml.j2 @@ -16,7 +16,6 @@ {% include 'roles/docker-container/templates/networks.yml.j2' %} {% include 'roles/docker-compose/templates/volumes.yml.j2' %} - redis: config: logs: data: diff --git a/roles/web-app-mailu/templates/docker-compose.yml.j2 b/roles/web-app-mailu/templates/docker-compose.yml.j2 index ff3463fb..6fa96246 100644 --- a/roles/web-app-mailu/templates/docker-compose.yml.j2 +++ b/roles/web-app-mailu/templates/docker-compose.yml.j2 @@ -100,7 +100,7 @@ - "{{docker_compose.directories.volumes}}overrides/rspamd:/overrides:ro" depends_on: - front - - redis + - redis - antivirus - resolver dns: @@ -181,8 +181,6 @@ name: {{ mailu_dkim }} dovecot_mail: name: {{ mailu_dovecot_mail }} - redis: - name: {{ mailu_redis }} {% include 'roles/docker-compose/templates/networks.yml.j2' %} radicale: diff --git a/roles/web-app-mastodon/templates/docker-compose.yml.j2 b/roles/web-app-mastodon/templates/docker-compose.yml.j2 index 4ad79605..8c3da91c 100644 --- a/roles/web-app-mastodon/templates/docker-compose.yml.j2 +++ b/roles/web-app-mastodon/templates/docker-compose.yml.j2 @@ -44,7 +44,6 @@ {% include 'roles/docker-container/templates/networks.yml.j2' %} {% include 'roles/docker-compose/templates/volumes.yml.j2' %} - redis: data: name: "{{ mastodon_volume }}" {% include 'roles/docker-compose/templates/networks.yml.j2' %} \ No newline at end of file diff --git a/roles/web-app-nextcloud/templates/docker-compose.yml.j2 b/roles/web-app-nextcloud/templates/docker-compose.yml.j2 index ab699986..2f93734c 100644 --- a/roles/web-app-nextcloud/templates/docker-compose.yml.j2 +++ b/roles/web-app-nextcloud/templates/docker-compose.yml.j2 @@ -71,6 +71,5 @@ {% include 'roles/docker-compose/templates/volumes.yml.j2' %} data: name: {{ nextcloud_volume }} - redis: {% include 'roles/docker-compose/templates/networks.yml.j2' %} diff --git a/roles/web-app-nextcloud/vars/main.yml b/roles/web-app-nextcloud/vars/main.yml index 1e9296d8..5cc66e5b 100644 --- a/roles/web-app-nextcloud/vars/main.yml +++ b/roles/web-app-nextcloud/vars/main.yml @@ -42,7 +42,7 @@ nextcloud_cron_name: "{{ applications | get_app_conf( nextcloud_talk_name: "{{ applications | get_app_conf(application_id, 'docker.services.talk.name', True) }}" nextcloud_talk_image: "{{ applications | get_app_conf(application_id, 'docker.services.talk.image', True) }}" nextcloud_talk_version: "{{ applications | get_app_conf(application_id, 'docker.services.talk.version', True) }}" -nextcloud_talk_enabled: "{{ applications | get_app_conf(application_id, 'docker.services.talk.enabled', True) }}" +nextcloud_talk_enabled: "{{ applications | is_docker_service_enabled(application_id, 'talk') }}" nextcloud_talk_stun_port: "{{ ports.public.stun[application_id] }}" # nextcloud_talk_domain: "{{ domains[application_id].talk }}" diff --git a/roles/web-app-oauth2-proxy/templates/oauth2-proxy-keycloak.cfg.j2 b/roles/web-app-oauth2-proxy/templates/oauth2-proxy-keycloak.cfg.j2 index e7b097d7..6fd06d7c 100644 --- a/roles/web-app-oauth2-proxy/templates/oauth2-proxy-keycloak.cfg.j2 +++ b/roles/web-app-oauth2-proxy/templates/oauth2-proxy-keycloak.cfg.j2 @@ -21,4 +21,7 @@ allowed_groups = {{ applications | get_app_conf(oauth2_proxy_applicat email_domains = ["*"] {% else %} email_domains = "{{ primary_domain }}" -{% endif %} \ No newline at end of file +{% endif %} + +session_store_type = "redis" +redis_connection_url = "redis://redis:6379" \ No newline at end of file diff --git a/roles/web-app-peertube/templates/docker-compose.yml.j2 b/roles/web-app-peertube/templates/docker-compose.yml.j2 index be712069..95d2f18d 100644 --- a/roles/web-app-peertube/templates/docker-compose.yml.j2 +++ b/roles/web-app-peertube/templates/docker-compose.yml.j2 @@ -19,7 +19,6 @@ assets: data: name: {{ peertube_volume }} - redis: config: {% include 'roles/docker-compose/templates/networks.yml.j2' %} \ No newline at end of file diff --git a/roles/web-app-pixelfed/templates/docker-compose.yml.j2 b/roles/web-app-pixelfed/templates/docker-compose.yml.j2 index 2f4b5e2f..2cd9982d 100644 --- a/roles/web-app-pixelfed/templates/docker-compose.yml.j2 +++ b/roles/web-app-pixelfed/templates/docker-compose.yml.j2 @@ -30,7 +30,6 @@ {% include 'roles/docker-container/templates/networks.yml.j2' %} {% include 'roles/docker-compose/templates/volumes.yml.j2' %} - redis: data: name: {{ pixelfed_volume }} diff --git a/roles/web-app-snipe-it/templates/docker-compose.yml.j2 b/roles/web-app-snipe-it/templates/docker-compose.yml.j2 index fd5fd681..e5bbeb04 100644 --- a/roles/web-app-snipe-it/templates/docker-compose.yml.j2 +++ b/roles/web-app-snipe-it/templates/docker-compose.yml.j2 @@ -18,7 +18,6 @@ # Compose Configuration {% include 'roles/docker-compose/templates/volumes.yml.j2' %} - redis: data: name: "{{ snipe_it_volume }}"