From b029045dda807bb5b8b670cf73b1b7f089903288 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Wed, 1 Jul 2020 12:56:13 +0200 Subject: [PATCH] Fixes #19563. Add a validation check to the Keycloak DS. --- defaults/main.yml | 2 ++ templates/standalone-ha.xml.j2 | 12 +++++++++++- templates/standalone.xml.j2 | 12 +++++++++++- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 368cbe2..6b92d2d 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -12,6 +12,7 @@ keycloak_java_min_heap: '2048m' keycloak_java_max_heap: '{{ keycloak_java_min_heap }}' keycloak_use_external_db: True +# postgresql is the only supported choice for the time being keycloak_db: 'postgresql' keycloak_db_module_name: 'org.{{ keycloak_db }}' keycloak_db_module_path: 'org/{{ keycloak_db }}' @@ -24,6 +25,7 @@ keycloak_database_user: keycloak_u #keycloak_database_password: 'define it into a vault file' keycloak_database_host: 'localhost' keycloak_database_max_pool_size: '50' +keycloak_database_jboss_connection_checker: True keycloak_admin_user: kadmin #keycloak_admin_password: 'define it into a vault file' diff --git a/templates/standalone-ha.xml.j2 b/templates/standalone-ha.xml.j2 index 8e1b425..17279a6 100644 --- a/templates/standalone-ha.xml.j2 +++ b/templates/standalone-ha.xml.j2 @@ -139,7 +139,17 @@ {{ keycloak_database_max_pool_size }} - + + {% if keycloak_database_jboss_connection_checker %} + + + {% else %} + select 1 + false + true + 10000 + {% endif %} + {{ keycloak_database_user }} {{ keycloak_database_password }} diff --git a/templates/standalone.xml.j2 b/templates/standalone.xml.j2 index 59ac4e9..798e1ca 100644 --- a/templates/standalone.xml.j2 +++ b/templates/standalone.xml.j2 @@ -137,7 +137,17 @@ {{ keycloak_database_max_pool_size }} - + + {% if keycloak_database_jboss_connection_checker %} + + + {% else %} + select 1 + false + true + 10000 + {% endif %} + {{ keycloak_database_user }} {{ keycloak_database_password }}