Browse Source

Disable keystone service/endpoint for ceilometer

Since ceilometer-api has been removed, we no longer need ceilometer
service and endpoints registered to keystone.

Change-Id: I4d8a067c02e9dc4152c7606c2865ebb9768c2fa0
changes/71/759171/5
Takashi Kajinami 2 years ago
parent
commit
be7a359ad6
  1. 93
      manifests/keystone/auth.pp
  2. 19
      releasenotes/notes/disable-keystone-endpoints-d7cbbc518942a4b4.yaml
  3. 105
      spec/classes/ceilometer_keystone_auth_spec.rb

93
manifests/keystone/auth.pp

@ -15,15 +15,6 @@
# (Optional) Username for Ceilometer service.
# Defaults to 'ceilometer'.
#
# [*configure_endpoint*]
# (Optional) Should Ceilometer endpoint be configured.
# Defaults to true.
#
# [*configure_service*]
# (Optional) Whether to create the service.
# Default to True
# Remark: will be deprecated in wallaby cycle
#
# [*configure_user*]
# (Optional) Should Ceilometer service user be configured?
# Defaults to true.
@ -32,47 +23,55 @@
# (Optional) Should roles be configured on Ceilometer service user?
# Defaults to true.
#
# [*region*]
# (Optional) Region for endpoint.
# Defaults to 'RegionOne'.
#
# [*tenant*]
# (Optional) Tenant for Ceilometer user.
# Defaults to 'services'.
#
# DEPRECATED PARAMETERS
#
# [*service_name*]
# (Optional) Name of the service.
# Defaults to 'ceilometer'.
# Defaults to undef
#
# [*service_type*]
# (Optional) Type of service. Optional.
# Defaults to 'metering'.
# Defaults to undef
#
# [*service_description*]
# (Optional) Description for keystone service.
# Defaults to 'Openstack Metering Service'.
# Defaults to undef
#
# [*region*]
# (Optional) Region for endpoint.
# Defaults to 'RegionOne'.
# [*configure_endpoint*]
# (Optional) Should Ceilometer endpoint be configured.
# Defaults to undef
#
# [*tenant*]
# (Optional) Tenant for Ceilometer user.
# Defaults to 'services'.
# [*configure_service*]
# (Optional) Whether to create the service.
# Default to undef
#
# [*public_url*]
# (Optional) The endpoint's public url.
# This url should *not* contain any trailing '/'.
# Defaults to 'http://127.0.0.1:8777'.
# Defaults to undef
#
# [*admin_url*]
# (Optional) The endpoint's admin url.
# This url should *not* contain any trailing '/'.
# Defaults to 'http://127.0.0.1:8777'.
# Defaults to undef
#
# [*internal_url*]
# (Optional) The endpoint's internal url.
# This url should *not* contain any trailing '/'.
# Defaults to 'http://127.0.0.1:8777'.
# Defaults to undef
#
# === Examples:
#
# class { 'ceilometer::keystone::auth':
# public_url => 'https://10.0.0.10:8777',
# internal_url => 'https://10.0.0.11:8777',
# admin_url => 'https://10.0.0.11:8777',
# password => 'secrete',
# }
#
class ceilometer::keystone::auth (
@ -81,39 +80,52 @@ class ceilometer::keystone::auth (
$auth_name = 'ceilometer',
$configure_user = true,
$configure_user_role = true,
$service_name = 'ceilometer',
$service_type = 'metering',
$service_description = 'Openstack Metering Service',
$region = 'RegionOne',
$tenant = 'services',
$configure_endpoint = true,
Boolean $configure_service = true,
$public_url = 'http://127.0.0.1:8777',
$admin_url = 'http://127.0.0.1:8777',
$internal_url = 'http://127.0.0.1:8777',
# DEPRECATED PARAMETERS
$service_name = undef,
$service_type = undef,
$service_description = undef,
Optional[Boolean] $configure_service = undef,
$configure_endpoint = undef,
$public_url = undef,
$admin_url = undef,
$internal_url = undef,
) {
include ceilometer::deps
validate_legacy(String, 'validate_string', $password)
if $service_name != undef or $service_type != undef or $service_description != undef {
warning('The parameters for keystone service record have been deprecated and have no effect')
}
if $configure_endpoint != undef {
warning('The configure_endpoint parameter has been deprecated and has no effect')
}
if $configure_service != undef {
warning('The configure_service parameter has been deprecated and has no effect')
}
if $public_url != undef or $admin_url != undef or $internal_url != undef {
warning('The parameters for keystone endpoint record have been deprecated and have no effect')
}
# Ceilometer rquires only its user, project, and role assignment.
# service and endpoint should be disabled since ceilometer-api has been removed.
keystone::resource::service_identity { 'ceilometer':
configure_user => $configure_user,
configure_user_role => $configure_user_role,
configure_endpoint => $configure_endpoint,
configure_service => $configure_service,
service_type => $service_type,
service_description => $service_description,
service_name => $service_name,
configure_endpoint => false,
configure_service => false,
region => $region,
auth_name => $auth_name,
password => $password,
email => $email,
tenant => $tenant,
roles => ['admin', 'ResellerAdmin'],
public_url => $public_url,
admin_url => $admin_url,
internal_url => $internal_url,
}
if $configure_user_role {
@ -126,4 +138,3 @@ class ceilometer::keystone::auth (
}
}

19
releasenotes/notes/disable-keystone-endpoints-d7cbbc518942a4b4.yaml

@ -0,0 +1,19 @@
---
features:
- |
The following parameters have been deprecated because ceilometer service
and endpoint is no longer required. These parameters will be removed in a
future release.
- ``ceilometer::keystone::auth::service_name``
- ``ceilometer::keystone::auth::service_type``
- ``ceilometer::keystone::auth::service_description``
- ``ceilometer::keystone::auth::configure_endpoint``
- ``ceilometer::keystone::auth::configure_service``
- ``ceilometer::keystone::auth::public_url``
- ``ceilometer::keystone::auth::admin_url``
- ``ceilometer::keystone::auth::internal_url``
updates:
- |
Keystone service and endpoints for ceilometer is no longer created.

105
spec/classes/ceilometer_keystone_auth_spec.rb

@ -4,17 +4,10 @@ describe 'ceilometer::keystone::auth' do
let :default_params do
{
:email => 'ceilometer@localhost',
:auth_name => 'ceilometer',
:service_name => 'ceilometer',
:configure_endpoint => true,
:configure_service => true,
:service_type => 'metering',
:region => 'RegionOne',
:tenant => 'services',
:public_url => 'http://127.0.0.1:8777',
:admin_url => 'http://127.0.0.1:8777',
:internal_url => 'http://127.0.0.1:8777',
:email => 'ceilometer@localhost',
:auth_name => 'ceilometer',
:region => 'RegionOne',
:tenant => 'services',
}
end
@ -43,22 +36,6 @@ describe 'ceilometer::keystone::auth' do
:roles => ['admin','ResellerAdmin']
)
end
it 'configures ceilometer service' do
is_expected.to contain_keystone_service("#{default_params[:service_name]}::#{default_params[:service_type]}").with(
:ensure => 'present',
:description => 'Openstack Metering Service'
)
end
it 'configure ceilometer endpoints' do
is_expected.to contain_keystone_endpoint("#{default_params[:region]}/#{default_params[:service_name]}::#{default_params[:service_type]}").with(
:ensure => 'present',
:public_url => default_params[:public_url],
:admin_url => default_params[:admin_url],
:internal_url => default_params[:internal_url]
)
end
end
context 'with overridden parameters' do
@ -69,10 +46,6 @@ describe 'ceilometer::keystone::auth' do
:service_type => 'cloud-measuring',
:region => 'RegionFortyTwo',
:tenant => 'mighty-services',
:public_url => 'https://public.host:443/ceilometer_pub',
:admin_url => 'https://admin.host/ceilometer_adm',
:internal_url => 'http://internal.host:80/ceilometer_int',
:service_name => 'bubbles',
})
end
@ -90,51 +63,6 @@ describe 'ceilometer::keystone::auth' do
:roles => ['admin','ResellerAdmin']
)
end
it 'configures ceilometer service' do
is_expected.to contain_keystone_service("#{params[:service_name]}::#{params[:service_type]}").with(
:ensure => 'present',
:description => 'Openstack Metering Service'
)
end
it 'configure ceilometer endpoints' do
is_expected.to contain_keystone_endpoint("#{params[:region]}/#{params[:service_name]}::#{params[:service_type]}").with(
:ensure => 'present',
:public_url => params[:public_url],
:admin_url => params[:admin_url],
:internal_url => params[:internal_url]
)
end
context 'with configure_endpoint = false' do
before do
params.delete!(:configure_endpoint)
it 'does not configure ceilometer endpoints' do
is_expected.to_not contain_keystone_endpoint("#{params[:region]}/#{params[:service_name]}::#{params[:service_type]}")
end
end
end
end
context 'when overriding service name' do
before do
params.merge!({
:service_name => 'ceilometer_service'
})
end
it 'configures correct user name' do
is_expected.to contain_keystone_user('ceilometer')
end
it 'configures correct user role' do
is_expected.to contain_keystone_user_role('ceilometer@services')
end
it 'configures correct service name' do
is_expected.to contain_keystone_service('ceilometer_service::metering')
end
it 'configures correct endpoint name' do
is_expected.to contain_keystone_endpoint('RegionOne/ceilometer_service::metering')
end
end
context 'when disabling user configuration' do
@ -144,11 +72,6 @@ describe 'ceilometer::keystone::auth' do
it { is_expected.to_not contain_keystone_user('ceilometer') }
it { is_expected.to contain_keystone_user_role('ceilometer@services') }
it { is_expected.to contain_keystone_service('ceilometer::metering').with(
:ensure => 'present',
:description => 'Openstack Metering Service'
)}
end
context 'when disabling user and role configuration' do
@ -161,26 +84,6 @@ describe 'ceilometer::keystone::auth' do
it { is_expected.to_not contain_keystone_user('ceilometer') }
it { is_expected.to_not contain_keystone_user_role('ceilometer@services') }
it { is_expected.to contain_keystone_service('ceilometer::metering').with(
:ensure => 'present',
:description => 'Openstack Metering Service'
)}
end
context 'when disabling service and endpoint configuration' do
before do
params.merge!(
:configure_service => false,
:configure_endpoint => false
)
end
it { is_expected.to_not contain_keystone_service('ceilometer::metering') }
it { is_expected.to_not contain_keystone_endpoint("#{default_params[:region]}/#{default_params[:service_name]}::#{default_params[:service_type]}")}
it { is_expected.to contain_keystone_user('ceilometer') }
it { is_expected.to contain_keystone_user_role('ceilometer@services') }
end
end

Loading…
Cancel
Save