From bd41510ba76a85a0d3c0941002ee582fa7ef8de9 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Tue, 2 Apr 2024 14:21:21 +0200 Subject: [PATCH] Move other options from the systemd unit to the conf file. --- templates/keycloak.conf.j2 | 8 ++++++++ templates/keycloak.service.j2 | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/templates/keycloak.conf.j2 b/templates/keycloak.conf.j2 index 11e592b..27d2eed 100644 --- a/templates/keycloak.conf.j2 +++ b/templates/keycloak.conf.j2 @@ -4,6 +4,14 @@ http-enabled={{ keycloak_http_enabled }} http-host={{ keycloak_listen }} http-port={{ keycloak_http_port }} +{% if not keycloak_optimize_build_at_startup %} +optimized=true +{% endif %} + +{% if keycloak_upgrade_db_at_startup %} +spi-connections-jpa-default-migration-strategy=update +{% endif %} + # Database # The database vendor. db={{ keycloak_db_vendor }} diff --git a/templates/keycloak.service.j2 b/templates/keycloak.service.j2 index 2060803..acd35b9 100644 --- a/templates/keycloak.service.j2 +++ b/templates/keycloak.service.j2 @@ -24,7 +24,7 @@ User={{ keycloak_user }} Group={{ keycloak_user }} SuccessExitStatus=0 143 UMask=0027 -ExecStart={{ keycloak_runtime_home }}/bin/kc.sh start{% if not keycloak_optimize_build_at_startup %} --optimized{% endif %}{% if keycloak_upgrade_db_at_startup %} --spi-connections-jpa-default-migration-strategy=update{% endif %} +ExecStart={{ keycloak_runtime_home }}/bin/kc.sh start [Install] WantedBy=multi-user.target