Add 'tenant' parameter to *::keystone::auth classe.

It was added for proper configuration to have a possibility
to override this parameter via hiera.

Change-Id: I738c849adcc924de10c5133803b314a42159adce
Closes-Bug: #1506073
This commit is contained in:
Maksym Yatsenko 2015-12-21 13:10:36 +02:00
parent d883f34981
commit d807022e71
15 changed files with 32 additions and 1 deletions

View File

@ -42,4 +42,5 @@ class { '::ceilometer::keystone::auth':
internal_url => $internal_url,
admin_url => $admin_url,
region => $region,
tenant => $tenant,
}

View File

@ -39,4 +39,5 @@ class { '::glance::keystone::auth':
internal_url => $internal_url,
admin_url => $admin_url,
region => $region,
tenant => $tenant,
}

View File

@ -22,6 +22,7 @@ $public_protocol = $public_ssl_hash['services'] ? {
}
$region = hiera('region', 'RegionOne')
$tenant = pick($ironic_hash['tenant'], 'services')
$public_url = "${public_protocol}://${public_address}:6385"
$admin_url = "http://${management_vip}:6385"
$internal_url = "http://${management_vip}:6385"
@ -29,6 +30,7 @@ $internal_url = "http://${management_vip}:6385"
class { 'ironic::keystone::auth':
password => $ironic_user_password,
region => $region,
tenant => $tenant,
public_url => $public_url,
internal_url => $internal_url,
admin_url => $admin_url,

View File

@ -49,4 +49,5 @@ class { '::cinder::keystone::auth':
internal_url_v2 => "${internal_base_url}/v2/%(tenant_id)s",
admin_url_v2 => "${admin_base_url}/v2/%(tenant_id)s",
region => $region,
tenant => $tenant,
}

View File

@ -53,6 +53,7 @@ class { '::nova::keystone::auth':
admin_url => "${admin_base_url}/v2/%(tenant_id)s",
admin_url_v3 => "${admin_base_url}/v3",
region => $region,
tenant => $tenant,
ec2_public_url => $ec2_public_url,
ec2_internal_url => $ec2_internal_url,
ec2_admin_url => $ec2_admin_url,

View File

@ -49,5 +49,6 @@ if $use_neutron {
internal_url => $internal_url,
admin_url => $admin_url,
region => $region,
tenant => $tenant,
}
}

View File

@ -42,4 +42,5 @@ class { '::swift::keystone::auth':
internal_url_s3 => $admin_url_s3,
admin_url_s3 => $admin_url_s3,
region => $region,
tenant => $tenant,
}

View File

@ -36,6 +36,7 @@ describe manifest do
configure_user_role = Noop.hiera_structure 'ceilometer/configure_user_role', true
service_name = Noop.hiera_structure 'ceilometer/service_name', 'ceilometer'
region = Noop.hiera_structure 'ceilometer/region', 'RegionOne'
tenant = Noop.hiera_structure 'ceilometer/tenant', 'services'
public_url = "#{public_protocol}://#{public_address}:8777"
internal_url = "#{internal_protocol}://#{internal_address}:8777"
@ -51,7 +52,8 @@ describe manifest do
'public_url' => public_url,
'internal_url' => internal_url,
'admin_url' => admin_url,
'region' => region
'region' => region,
'tenant' => tenant,
)
end
end

View File

@ -31,6 +31,7 @@ describe manifest do
configure_user = Noop.hiera_structure('glance/configure_user', true)
configure_user_role = Noop.hiera_structure('glance/configure_user_role', true)
region = Noop.hiera_structure('glance/region', 'RegionOne')
tenant = Noop.hiera_structure('glance/tenant', 'services')
service_name = Noop.hiera_structure('glance/service_name', 'glance')
public_url = "#{public_protocol}://#{public_address}:9292"
internal_url = "#{internal_protocol}://#{internal_address}:9292"
@ -48,6 +49,7 @@ describe manifest do
'internal_url' => internal_url,
'admin_url' => admin_url,
'region' => region,
'tenant' => tenant,
)
end
end

View File

@ -36,6 +36,7 @@ describe manifest do
public_url_cfn = "#{public_protocol}://#{public_address}:8000/v1"
internal_url_cfn = "#{internal_protocol}://#{internal_address}:8000/v1"
admin_url_cfn = "#{admin_protocol}://#{admin_address}:8000/v1"
tenant = Noop.hiera_structure 'heat/tenant', 'services'
it 'class heat::keystone::auth should contain correct *_url' do
should contain_class('heat::keystone::auth').with('public_url' => public_url)
@ -49,6 +50,10 @@ describe manifest do
should contain_class('heat::keystone::auth_cfn').with('admin_url' => admin_url_cfn)
end
it 'class heat::keystone::auth should contain tenant' do
should contain_class('heat::keystone::auth').with('tenant' => tenant)
end
end
test_ubuntu_and_centos manifest

View File

@ -25,6 +25,7 @@ describe manifest do
configure_user = Noop.hiera_structure('ironic/configure_user', true)
configure_user_role = Noop.hiera_structure('ironic/configure_user_role', true)
region = Noop.hiera_structure('ironic/region', 'RegionOne')
tenant = Noop.hiera_structure('ironic/tenant', 'services')
service_name = Noop.hiera_structure('ironic/service_name', 'ironic')
public_url = "#{public_protocol}://#{public_address}:6385"
admin_url = "http://#{admin_address}:6385"
@ -41,6 +42,7 @@ describe manifest do
'admin_url' => admin_url,
'internal_url' => admin_url,
'region' => region,
'tenant' => tenant,
)
end
end

View File

@ -41,6 +41,7 @@ describe manifest do
configure_user = Noop.hiera_structure 'cinder/configure_user_role', true
service_name = Noop.hiera_structure 'cinder/service_name', 'cinder'
region = Noop.hiera_structure 'cinder/region', 'RegionOne'
tenant = Noop.hiera_structure 'cinder/tenant', 'services'
it 'should declare cinder::keystone::auth class with propper parameters' do
should contain_class('cinder::keystone::auth').with(
@ -56,6 +57,7 @@ describe manifest do
'internal_url_v2' => internal_url_v2,
'admin_url_v2' => admin_url_v2,
'region' => region,
'tenant' => tenant,
)
end

View File

@ -14,6 +14,7 @@ describe manifest do
admin_protocol = 'http'
admin_address = internal_address
public_ssl = Noop.hiera_structure('public_ssl/services')
tenant = Noop.hiera_structure('nova/tenant', 'services')
if Noop.hiera_structure('use_ssl')
public_protocol = 'https'
@ -51,6 +52,7 @@ describe manifest do
'ec2_public_url' => ec2_public_url,
'ec2_admin_url' => ec2_admin_url,
'ec2_internal_url' => ec2_internal_url,
'tenant' => tenant,
)
end
end

View File

@ -49,6 +49,7 @@ describe manifest do
'internal_url' => internal_url,
'admin_url' => admin_url,
'region' => region,
'tenant' => tenant,
)
end
end

View File

@ -47,6 +47,8 @@ describe manifest do
public_url_s3 = "#{public_protocol}://#{public_address}:8080"
admin_url_s3 = "#{internal_protocol}://#{internal_address}:8080"
tenant = Noop.hiera_structure('swift/tenant', 'services')
it 'class swift::keystone::auth should contain correct *_url' do
should contain_class('swift::keystone::auth').with('public_url' => public_url)
should contain_class('swift::keystone::auth').with('admin_url' => admin_url)
@ -58,6 +60,11 @@ describe manifest do
should contain_class('swift::keystone::auth').with('admin_url_s3' => admin_url_s3)
should contain_class('swift::keystone::auth').with('internal_url_s3' => admin_url_s3)
end
it 'class swift::keystone::auth should contain tenant' do
should contain_class('swift::keystone::auth').with('tenant' => tenant)
end
end
test_ubuntu_and_centos manifest