From f21260370ff6f28b8d5034b239458f1eb0c98daa Mon Sep 17 00:00:00 2001 From: Marcellin Fom Tchassem Date: Tue, 7 Jun 2016 18:06:50 -0500 Subject: [PATCH] Change default service_name to 'ironic' While we were already able to pick an independent auth_name and service_name; the service_name was defaulting to auth_name. Now it has a value of its own to be consistent with other modules. Change-Id: I6fee7965ec51928df9a81cacbcf60aebadb7becf Related-Bug: #1590040 --- manifests/keystone/auth.pp | 13 ++++++------- .../notes/keystone-auth-name-8084c0621055b72a.yaml | 5 +++++ spec/classes/ironic_keystone_auth_spec.rb | 4 ++-- 3 files changed, 13 insertions(+), 9 deletions(-) create mode 100644 releasenotes/notes/keystone-auth-name-8084c0621055b72a.yaml diff --git a/manifests/keystone/auth.pp b/manifests/keystone/auth.pp index ed8845bd..b6fbc4f7 100644 --- a/manifests/keystone/auth.pp +++ b/manifests/keystone/auth.pp @@ -46,7 +46,7 @@ # # [*service_name*] # (Optional) Name of the service. -# Defaults to the value of auth_name, but must differ from the value. +# Defaults to the value of 'ironic'. # # [*service_type*] # Type of service. Defaults to 'baremetal'. @@ -86,7 +86,7 @@ class ironic::keystone::auth ( $configure_endpoint = true, $configure_user = true, $configure_user_role = true, - $service_name = undef, + $service_name = 'ironic', $service_type = 'baremetal', $service_description = 'Ironic Bare Metal Provisioning Service', $region = 'RegionOne', @@ -95,20 +95,19 @@ class ironic::keystone::auth ( $internal_url = 'http://127.0.0.1:6385', ) { - $real_service_name = pick($service_name, $auth_name) - if $configure_user_role { Keystone_user_role["${auth_name}@${tenant}"] ~> Service <| name == 'ironic-server' |> } - Keystone_endpoint["${region}/${real_service_name}::${service_type}"] ~> Service <| name == 'ironic-server' |> + Keystone_endpoint["${region}/${service_name}::${service_type}"] ~> Service <| name == 'ironic-server' |> - keystone::resource::service_identity { $auth_name: + keystone::resource::service_identity { 'ironic': configure_user => $configure_user, configure_user_role => $configure_user_role, configure_endpoint => $configure_endpoint, - service_name => $real_service_name, + service_name => $service_name, service_type => $service_type, + auth_name => $auth_name, service_description => $service_description, region => $region, password => $password, diff --git a/releasenotes/notes/keystone-auth-name-8084c0621055b72a.yaml b/releasenotes/notes/keystone-auth-name-8084c0621055b72a.yaml new file mode 100644 index 00000000..835c883b --- /dev/null +++ b/releasenotes/notes/keystone-auth-name-8084c0621055b72a.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - The keystone auth class has been updated to provide a default service_name + to allow a user to specify a custom auth_name that may not contain the + name of the service. diff --git a/spec/classes/ironic_keystone_auth_spec.rb b/spec/classes/ironic_keystone_auth_spec.rb index 6dbe235d..681e2e21 100644 --- a/spec/classes/ironic_keystone_auth_spec.rb +++ b/spec/classes/ironic_keystone_auth_spec.rb @@ -92,8 +92,8 @@ describe 'ironic::keystone::auth' do it { is_expected.to contain_keystone_user('ironicy') } it { is_expected.to contain_keystone_user_role('ironicy@services') } - it { is_expected.to contain_keystone_service('ironicy::baremetal') } - it { is_expected.to contain_keystone_endpoint('RegionOne/ironicy::baremetal') } + it { is_expected.to contain_keystone_service('ironic::baremetal') } + it { is_expected.to contain_keystone_endpoint('RegionOne/ironic::baremetal') } end describe 'when overriding service name' do