From 336a3320411e705b98c1ea03ec70cf282be564ea Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Sat, 21 Sep 2024 22:06:34 +0900 Subject: [PATCH] Add validations for keystone resource parameters The underlying implementation already have type validations. Inherit these and make a few adjustment so that validation failures are raised from the external interface layer instead of the internal interface. Change-Id: Ibe86ec3f2b35771cf6c5d67f8fa788c292c8a737 --- manifests/keystone/auth.pp | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/manifests/keystone/auth.pp b/manifests/keystone/auth.pp index 01a3e9c..526f938 100644 --- a/manifests/keystone/auth.pp +++ b/manifests/keystone/auth.pp @@ -75,23 +75,23 @@ # Defaults to 'http://127.0.0.1:9322' # class watcher::keystone::auth ( - $password, - $auth_name = 'watcher', - $email = 'watcher@localhost', - $tenant = 'services', - $roles = ['admin'], - $system_scope = 'all', - $system_roles = [], - $configure_endpoint = true, - $configure_user = true, - $configure_user_role = true, - $service_name = undef, - $service_description = 'Infrastructure Optimization service', - $service_type = 'infra-optim', - $region = 'RegionOne', - $public_url = 'http://127.0.0.1:9322', - $admin_url = 'http://127.0.0.1:9322', - $internal_url = 'http://127.0.0.1:9322', + String[1] $password, + String[1] $auth_name = 'watcher', + String[1] $email = 'watcher@localhost', + String[1] $tenant = 'services', + Array[String[1]] $roles = ['admin'], + String[1] $system_scope = 'all', + Array[String[1]] $system_roles = [], + Boolean $configure_endpoint = true, + Boolean $configure_user = true, + Boolean $configure_user_role = true, + Optional[String[1]] $service_name = undef, + String[1] $service_description = 'Infrastructure Optimization service', + String[1] $service_type = 'infra-optim', + String[1] $region = 'RegionOne', + Keystone::PublicEndpointUrl $public_url = 'http://127.0.0.1:9322', + Keystone::EndpointUrl $admin_url = 'http://127.0.0.1:9322', + Keystone::EndpointUrl $internal_url = 'http://127.0.0.1:9322', ) { include watcher::deps