From a91247e9d0ce361e30b24ca86018bd5d024964c8 Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Mon, 21 Dec 2015 19:33:52 +0100 Subject: [PATCH] Make Keystone_endpoint match service by name/type Since a chance in puppet-keystone (1], we now match an endpoint with a service name/type. ) [1] http://git.openstack.org/cgit/openstack/puppet-keystone/commit/?id=0a4e06abb0f5b3f324464ff5219d2885816311ce Change-Id: I69098f001feb45c10e6e604cc58f60d8485da5cc Closes-Bug: #1528308 --- .../manifests/keystone/auth.pp | 2 +- ...utter.project_name}}_keystone_auth_spec.rb | 21 ++++++++----------- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/puppet-{{cookiecutter.project_name}}/manifests/keystone/auth.pp b/puppet-{{cookiecutter.project_name}}/manifests/keystone/auth.pp index be02792..4f1635b 100644 --- a/puppet-{{cookiecutter.project_name}}/manifests/keystone/auth.pp +++ b/puppet-{{cookiecutter.project_name}}/manifests/keystone/auth.pp @@ -69,7 +69,7 @@ class {{cookiecutter.project_name}}::keystone::auth ( if $configure_user_role { Keystone_user_role["${auth_name}@${tenant}"] ~> Service <| name == '{{cookiecutter.project_name}}-server' |> } - Keystone_endpoint["${region}/${real_service_name}"] ~> Service <| name == '{{cookiecutter.project_name}}-server' |> + Keystone_endpoint["${region}/${real_service_name}::${service_type}"] ~> Service <| name == '{{cookiecutter.project_name}}-server' |> keystone::resource::service_identity { '{{cookiecutter.project_name}}': configure_user => $configure_user, diff --git a/puppet-{{cookiecutter.project_name}}/spec/classes/{{cookiecutter.project_name}}_keystone_auth_spec.rb b/puppet-{{cookiecutter.project_name}}/spec/classes/{{cookiecutter.project_name}}_keystone_auth_spec.rb index 0b215bf..49ed5fa 100644 --- a/puppet-{{cookiecutter.project_name}}/spec/classes/{{cookiecutter.project_name}}_keystone_auth_spec.rb +++ b/puppet-{{cookiecutter.project_name}}/spec/classes/{{cookiecutter.project_name}}_keystone_auth_spec.rb @@ -26,13 +26,12 @@ describe '{{cookiecutter.project_name}}::keystone::auth' do :roles => ['admin'] )} - it { is_expected.to contain_keystone_service('{{cookiecutter.project_name}}').with( + it { is_expected.to contain_keystone_service('{{cookiecutter.project_name}}::FIXME').with( :ensure => 'present', - :type => 'FIXME', :description => '{{cookiecutter.project_name}} FIXME Service' ) } - it { is_expected.to contain_keystone_endpoint('RegionOne/{{cookiecutter.project_name}}').with( + it { is_expected.to contain_keystone_endpoint('RegionOne/{{cookiecutter.project_name}}::FIXME').with( :ensure => 'present', :public_url => 'http://127.0.0.1:FIXME', :admin_url => 'http://127.0.0.1:FIXME', @@ -48,7 +47,7 @@ describe '{{cookiecutter.project_name}}::keystone::auth' do :admin_url => 'http://10.10.10.12:81', } end - it { is_expected.to contain_keystone_endpoint('RegionOne/{{cookiecutter.project_name}}').with( + it { is_expected.to contain_keystone_endpoint('RegionOne/{{cookiecutter.project_name}}::FIXME').with( :ensure => 'present', :public_url => 'https://10.10.10.10:80', :internal_url => 'http://10.10.10.11:81', @@ -64,8 +63,8 @@ describe '{{cookiecutter.project_name}}::keystone::auth' do it { is_expected.to contain_keystone_user('{{cookiecutter.project_name}}y') } it { is_expected.to contain_keystone_user_role('{{cookiecutter.project_name}}y@services') } - it { is_expected.to contain_keystone_service('{{cookiecutter.project_name}}y') } - it { is_expected.to contain_keystone_endpoint('RegionOne/{{cookiecutter.project_name}}y') } + it { is_expected.to contain_keystone_service('{{cookiecutter.project_name}}y::FIXME') } + it { is_expected.to contain_keystone_endpoint('RegionOne/{{cookiecutter.project_name}}y::FIXME') } end describe 'when overriding service name' do @@ -77,8 +76,8 @@ describe '{{cookiecutter.project_name}}::keystone::auth' do it { is_expected.to contain_keystone_user('{{cookiecutter.project_name}}') } it { is_expected.to contain_keystone_user_role('{{cookiecutter.project_name}}@services') } - it { is_expected.to contain_keystone_service('{{cookiecutter.project_name}}_service') } - it { is_expected.to contain_keystone_endpoint('RegionOne/{{cookiecutter.project_name}}_service') } + it { is_expected.to contain_keystone_service('{{cookiecutter.project_name}}_service::FIXME') } + it { is_expected.to contain_keystone_endpoint('RegionOne/{{cookiecutter.project_name}}_service::FIXME') } end describe 'when disabling user configuration' do @@ -92,9 +91,8 @@ describe '{{cookiecutter.project_name}}::keystone::auth' do it { is_expected.not_to contain_keystone_user('{{cookiecutter.project_name}}') } it { is_expected.to contain_keystone_user_role('{{cookiecutter.project_name}}@services') } - it { is_expected.to contain_keystone_service('{{cookiecutter.project_name}}').with( + it { is_expected.to contain_keystone_service('{{cookiecutter.project_name}}::FIXME').with( :ensure => 'present', - :type => 'FIXME', :description => '{{cookiecutter.project_name}} FIXME Service' ) } @@ -112,9 +110,8 @@ describe '{{cookiecutter.project_name}}::keystone::auth' do it { is_expected.not_to contain_keystone_user('{{cookiecutter.project_name}}') } it { is_expected.not_to contain_keystone_user_role('{{cookiecutter.project_name}}@services') } - it { is_expected.to contain_keystone_service('{{cookiecutter.project_name}}').with( + it { is_expected.to contain_keystone_service('{{cookiecutter.project_name}}::FIXME').with( :ensure => 'present', - :type => 'FIXME', :description => '{{cookiecutter.project_name}} FIXME Service' ) }