From bb317aac01c4eced7cf1cd104948d49947f494bd Mon Sep 17 00:00:00 2001 From: Pradeep Kilambi Date: Fri, 9 Dec 2016 11:31:11 -0500 Subject: Disable legacy ceilometer api by default Ceilometer api is deprectaed in Ocata. Lets disable by default. This can still be enabled by setting enable_legacy_ceilometer_api param. Change-Id: Iffb8c2cfed53d8b29e777c35cee44921194239e9 --- manifests/profile/base/ceilometer/api.pp | 7 ++++++- spec/classes/tripleo_profile_base_ceilometer_api_spec.rb | 16 ++++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/manifests/profile/base/ceilometer/api.pp b/manifests/profile/base/ceilometer/api.pp index 6ef4748..2e7986b 100644 --- a/manifests/profile/base/ceilometer/api.pp +++ b/manifests/profile/base/ceilometer/api.pp @@ -18,6 +18,10 @@ # # === Parameters # +# [*enable_legacy_api*] +# (Optional) Enable legacy ceilometer api service. +# Defaults to hiera('enable_legacy_api', false) +# # [*ceilometer_network*] # (Optional) The network name where the ceilometer endpoint is listening on. # This is set by t-h-t. @@ -53,6 +57,7 @@ # Defaults to hiera('step') # class tripleo::profile::base::ceilometer::api ( + $enable_legacy_api = hiera('enable_legacy_ceilometer_api', false), $ceilometer_network = hiera('ceilometer_api_network', undef), $certificates_specs = hiera('apache_certificates_specs', {}), $enable_internal_tls = hiera('enable_internal_tls', false), @@ -76,7 +81,7 @@ class tripleo::profile::base::ceilometer::api ( $tls_keyfile = undef } - if $step >= 4 { + if $step >= 4 and $enable_legacy_api { include ::ceilometer::api class { '::ceilometer::wsgi::apache': ssl_cert => $tls_certfile, diff --git a/spec/classes/tripleo_profile_base_ceilometer_api_spec.rb b/spec/classes/tripleo_profile_base_ceilometer_api_spec.rb index 935e9e8..2887d32 100644 --- a/spec/classes/tripleo_profile_base_ceilometer_api_spec.rb +++ b/spec/classes/tripleo_profile_base_ceilometer_api_spec.rb @@ -32,9 +32,10 @@ describe 'tripleo::profile::base::ceilometer::api' do end end - context 'with step 4' do + context 'with step 4 and enable_legacy_api' do let(:params) { { - :step => 4, + :step => 4, + :enable_legacy_api => true, } } it 'should trigger complete configuration' do @@ -42,6 +43,17 @@ describe 'tripleo::profile::base::ceilometer::api' do is_expected.to contain_class('ceilometer::wsgi::apache') end end + + context 'with step 4 and default enable_legacy_api' do + let(:params) { { + :step => 4, + } } + + it 'should do nothing' do + is_expected.to_not contain_class('ceilometer::api') + is_expected.to_not contain_class('ceilometer::wsgi::apache') + end + end end -- cgit 1.2.3-korg