From c22e714ec8ae16125832cbbbacaae2c3eeeac444 Mon Sep 17 00:00:00 2001 From: treydock Date: Thu, 12 May 2022 13:00:02 -0400 Subject: [PATCH] Allow changing auth URL via auth_url_path parameter (#245) Fixes #243 --- manifests/init.pp | 5 ++++- templates/kcadm-wrapper.sh.erb | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 1c2d52e9..0f1d644d 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -263,6 +263,8 @@ # The address of the syslog server. Default 'localhost'. # @param syslog_format # Syslog format. Either 'RFC3164' or 'RFC5424' Default 'RFC3164'. +# @param auth_url_path +# The URL path for /auth class keycloak ( Boolean $manage_install = true, String $version = '12.0.4', @@ -371,6 +373,7 @@ Stdlib::Port $syslog_port = 514, Stdlib::Host $syslog_server_address = 'localhost', Enum['RFC3164', 'RFC5424'] $syslog_format = 'RFC3164', + String $auth_url_path = '/auth', ) { if ! ($facts['os']['family'] in ['RedHat','Debian']) { @@ -494,7 +497,7 @@ keycloak_port => $http_port, use_ssl => false, timeout => 60, - test_url => '/auth/realms/master/.well-known/openid-configuration', + test_url => "${auth_url_path}/realms/master/.well-known/openid-configuration", require => Class['keycloak::service'], } diff --git a/templates/kcadm-wrapper.sh.erb b/templates/kcadm-wrapper.sh.erb index d3feeed0..0c9c86ee 100644 --- a/templates/kcadm-wrapper.sh.erb +++ b/templates/kcadm-wrapper.sh.erb @@ -2,4 +2,4 @@ KCADM="<%= scope['keycloak::install_base'] %>/bin/kcadm.sh" -${KCADM} "$@" --no-config --server http://localhost:<%= scope['keycloak::http_port'] %>/auth --realm master --user <%= scope['keycloak::admin_user'] %> --password <%= scope['keycloak::admin_user_password'] %> +${KCADM} "$@" --no-config --server http://localhost:<%= scope['keycloak::http_port'] %><%= scope['keycloak::auth_url_path'] %> --realm master --user <%= scope['keycloak::admin_user'] %> --password <%= scope['keycloak::admin_user_password'] %>