metering_secret was renamed to telemetry_secret
Annoyingly upstream renamed this variable which is used in about two dozen places. In addition to this we'll need to fix the integration tests once this lands. Change-Id: I8c01fac2c984f39e63b116c4a6433b2009a4943c
This commit is contained in:
parent
7df4b36d30
commit
4600d4135a
@ -45,7 +45,7 @@ To utilize the ceilometer module's functionality you will need to declare multip
|
|||||||
|
|
||||||
```puppet
|
```puppet
|
||||||
class { '::ceilometer':
|
class { '::ceilometer':
|
||||||
metering_secret => 'secrete',
|
telemetry_secret => 'secrete',
|
||||||
rabbit_userid => 'ceilometer',
|
rabbit_userid => 'ceilometer',
|
||||||
rabbit_password => 'an_even_bigger_secret',
|
rabbit_password => 'an_even_bigger_secret',
|
||||||
rabbit_host => '127.0.0.1',
|
rabbit_host => '127.0.0.1',
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
class { '::ceilometer':
|
class { '::ceilometer':
|
||||||
metering_secret => 'secrete',
|
telemetry_secret => 'secrete',
|
||||||
rabbit_userid => 'ceilometer',
|
rabbit_userid => 'ceilometer',
|
||||||
rabbit_password => 'an_even_bigger_secret',
|
rabbit_password => 'an_even_bigger_secret',
|
||||||
rabbit_host => '127.0.0.1',
|
rabbit_host => '127.0.0.1',
|
||||||
}
|
}
|
||||||
class { '::ceilometer::db::mysql':
|
class { '::ceilometer::db::mysql':
|
||||||
password => 'a_big_secret',
|
password => 'a_big_secret',
|
||||||
|
@ -12,9 +12,9 @@ node default {
|
|||||||
|
|
||||||
# Add the base ceilometer class & parameters
|
# Add the base ceilometer class & parameters
|
||||||
# This class is required by ceilometer agents & api classes
|
# This class is required by ceilometer agents & api classes
|
||||||
# The metering_secret parameter is mandatory
|
# The telemetry_secret parameter is mandatory
|
||||||
class { '::ceilometer':
|
class { '::ceilometer':
|
||||||
metering_secret => 'darksecret'
|
telemetry_secret => 'darksecret'
|
||||||
}
|
}
|
||||||
|
|
||||||
# Configure the ceilometer database
|
# Configure the ceilometer database
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
# (<= 0 means forever)
|
# (<= 0 means forever)
|
||||||
# Defaults to -1.
|
# Defaults to -1.
|
||||||
#
|
#
|
||||||
# [*metering_secret*]
|
# [*telemetry_secret*]
|
||||||
# (Required) Secret key for signing messages.
|
# (Required) Secret key for signing messages.
|
||||||
#
|
#
|
||||||
# [*notification_topics*]
|
# [*notification_topics*]
|
||||||
@ -140,11 +140,15 @@
|
|||||||
# (string value)
|
# (string value)
|
||||||
# Defaults to $::os_service_default
|
# Defaults to $::os_service_default
|
||||||
#
|
#
|
||||||
# [*memcached_servers*]
|
# [*memcached_servers*]
|
||||||
# (Optional) A list of memcached server(s) to use for caching. (list value)
|
# (Optional) A list of memcached server(s) to use for caching. (list value)
|
||||||
# Defaults to $::os_service_default
|
# Defaults to $::os_service_default
|
||||||
#
|
#
|
||||||
# === DEPRECATED PARAMETERS:
|
# === DEPRECATED PARAMETERS:
|
||||||
|
# [*metering_secret*]
|
||||||
|
# (optional) Secret key for signing messages.
|
||||||
|
# This option has been renamed to telemetry_secret in Mitaka.
|
||||||
|
# Don't define this if using telemetry_secret.
|
||||||
#
|
#
|
||||||
# [*alarm_history_time_to_live*]
|
# [*alarm_history_time_to_live*]
|
||||||
#
|
#
|
||||||
@ -152,7 +156,7 @@ class ceilometer(
|
|||||||
$http_timeout = '600',
|
$http_timeout = '600',
|
||||||
$event_time_to_live = '-1',
|
$event_time_to_live = '-1',
|
||||||
$metering_time_to_live = '-1',
|
$metering_time_to_live = '-1',
|
||||||
$metering_secret = false,
|
$telemetry_secret = false,
|
||||||
$notification_topics = ['notifications'],
|
$notification_topics = ['notifications'],
|
||||||
$package_ensure = 'present',
|
$package_ensure = 'present',
|
||||||
$debug = undef,
|
$debug = undef,
|
||||||
@ -182,13 +186,26 @@ class ceilometer(
|
|||||||
$memcached_servers = $::os_service_default,
|
$memcached_servers = $::os_service_default,
|
||||||
# DEPRECATED PARAMETERS
|
# DEPRECATED PARAMETERS
|
||||||
$alarm_history_time_to_live = undef,
|
$alarm_history_time_to_live = undef,
|
||||||
|
$metering_secret = undef,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
validate_string($metering_secret)
|
|
||||||
|
|
||||||
include ::ceilometer::logging
|
include ::ceilometer::logging
|
||||||
include ::ceilometer::params
|
include ::ceilometer::params
|
||||||
|
|
||||||
|
# Cleanup in Ocata.
|
||||||
|
if $telemetry_secret {
|
||||||
|
validate_string($telemetry_secret)
|
||||||
|
if $metering_secret {
|
||||||
|
warning('Both $metering_secret and $telemetry_secret defined, using $telemetry_secret')
|
||||||
|
}
|
||||||
|
$telemetry_secret_real = $telemetry_secret
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
warning('metering_secret has been renamed to telemetry_secret. metering_secret will continue to work until Ocata.')
|
||||||
|
validate_string($metering_secret)
|
||||||
|
$telemetry_secret_real = $metering_secret
|
||||||
|
}
|
||||||
|
|
||||||
if $alarm_history_time_to_live {
|
if $alarm_history_time_to_live {
|
||||||
warning('alarm_history_time_to_live parameter is deprecated. It should be configured for Aodh.')
|
warning('alarm_history_time_to_live parameter is deprecated. It should be configured for Aodh.')
|
||||||
}
|
}
|
||||||
@ -239,7 +256,7 @@ class ceilometer(
|
|||||||
# Once we got here, we can act as an honey badger on the rpc used.
|
# Once we got here, we can act as an honey badger on the rpc used.
|
||||||
ceilometer_config {
|
ceilometer_config {
|
||||||
'DEFAULT/http_timeout' : value => $http_timeout;
|
'DEFAULT/http_timeout' : value => $http_timeout;
|
||||||
'publisher/metering_secret' : value => $metering_secret, secret => true;
|
'publisher/telemetry_secret' : value => $telemetry_secret_real, secret => true;
|
||||||
'database/event_time_to_live' : value => $event_time_to_live;
|
'database/event_time_to_live' : value => $event_time_to_live;
|
||||||
'database/metering_time_to_live' : value => $metering_time_to_live;
|
'database/metering_time_to_live' : value => $metering_time_to_live;
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
deprecations:
|
||||||
|
- The variable $metering_secret has been renamed as
|
||||||
|
$telemetry_secret to match the name of the config
|
||||||
|
option. The old variable will be removed in Ocata.
|
@ -29,7 +29,7 @@ describe 'ceilometer with mysql' do
|
|||||||
|
|
||||||
# Ceilometer resources
|
# Ceilometer resources
|
||||||
class { '::ceilometer':
|
class { '::ceilometer':
|
||||||
metering_secret => 'secrete',
|
telemetry_secret => 'secrete',
|
||||||
rabbit_userid => 'ceilometer',
|
rabbit_userid => 'ceilometer',
|
||||||
rabbit_password => 'an_even_bigger_secret',
|
rabbit_password => 'an_even_bigger_secret',
|
||||||
rabbit_host => '127.0.0.1',
|
rabbit_host => '127.0.0.1',
|
||||||
|
@ -3,7 +3,7 @@ require 'spec_helper'
|
|||||||
describe 'ceilometer::agent::auth' do
|
describe 'ceilometer::agent::auth' do
|
||||||
|
|
||||||
let :pre_condition do
|
let :pre_condition do
|
||||||
"class { 'ceilometer': metering_secret => 's3cr3t' }"
|
"class { 'ceilometer': telemetry_secret => 's3cr3t' }"
|
||||||
end
|
end
|
||||||
|
|
||||||
let :params do
|
let :params do
|
||||||
|
@ -3,7 +3,7 @@ require 'spec_helper'
|
|||||||
describe 'ceilometer::agent::central' do
|
describe 'ceilometer::agent::central' do
|
||||||
|
|
||||||
let :pre_condition do
|
let :pre_condition do
|
||||||
"class { 'ceilometer': metering_secret => 's3cr3t' }"
|
"class { 'ceilometer': telemetry_secret => 's3cr3t' }"
|
||||||
end
|
end
|
||||||
|
|
||||||
let :params do
|
let :params do
|
||||||
|
@ -5,7 +5,7 @@ describe 'ceilometer::agent::compute' do
|
|||||||
let :pre_condition do
|
let :pre_condition do
|
||||||
"include nova\n" +
|
"include nova\n" +
|
||||||
"include nova::compute\n" +
|
"include nova::compute\n" +
|
||||||
"class { 'ceilometer': metering_secret => 's3cr3t' }"
|
"class { 'ceilometer': telemetry_secret => 's3cr3t' }"
|
||||||
end
|
end
|
||||||
|
|
||||||
let :params do
|
let :params do
|
||||||
|
@ -23,7 +23,7 @@ require 'spec_helper'
|
|||||||
describe 'ceilometer::agent::notification' do
|
describe 'ceilometer::agent::notification' do
|
||||||
|
|
||||||
let :pre_condition do
|
let :pre_condition do
|
||||||
"class { 'ceilometer': metering_secret => 's3cr3t' }"
|
"class { 'ceilometer': telemetry_secret => 's3cr3t' }"
|
||||||
end
|
end
|
||||||
|
|
||||||
let :params do
|
let :params do
|
||||||
|
@ -5,7 +5,7 @@ describe 'ceilometer::agent::polling' do
|
|||||||
let :pre_condition do
|
let :pre_condition do
|
||||||
"include nova\n" +
|
"include nova\n" +
|
||||||
"include nova::compute\n" +
|
"include nova::compute\n" +
|
||||||
"class { 'ceilometer': metering_secret => 's3cr3t' }"
|
"class { 'ceilometer': telemetry_secret => 's3cr3t' }"
|
||||||
end
|
end
|
||||||
|
|
||||||
let :params do
|
let :params do
|
||||||
|
@ -3,7 +3,7 @@ require 'spec_helper'
|
|||||||
describe 'ceilometer::api' do
|
describe 'ceilometer::api' do
|
||||||
|
|
||||||
let :pre_condition do
|
let :pre_condition do
|
||||||
"class { 'ceilometer': metering_secret => 's3cr3t' }
|
"class { 'ceilometer': telemetry_secret => 's3cr3t' }
|
||||||
include ::ceilometer::db"
|
include ::ceilometer::db"
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -96,7 +96,7 @@ describe 'ceilometer::api' do
|
|||||||
let :pre_condition do
|
let :pre_condition do
|
||||||
"include ::apache
|
"include ::apache
|
||||||
include ::ceilometer::db
|
include ::ceilometer::db
|
||||||
class { 'ceilometer': metering_secret => 's3cr3t' }"
|
class { 'ceilometer': telemetry_secret => 's3cr3t' }"
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'configures ceilometer-api service with Apache' do
|
it 'configures ceilometer-api service with Apache' do
|
||||||
@ -117,7 +117,7 @@ describe 'ceilometer::api' do
|
|||||||
let :pre_condition do
|
let :pre_condition do
|
||||||
"include ::apache
|
"include ::apache
|
||||||
include ::ceilometer::db
|
include ::ceilometer::db
|
||||||
class { 'ceilometer': metering_secret => 's3cr3t' }"
|
class { 'ceilometer': telemetry_secret => 's3cr3t' }"
|
||||||
end
|
end
|
||||||
|
|
||||||
it_raises 'a Puppet::Error', /Invalid service_name/
|
it_raises 'a Puppet::Error', /Invalid service_name/
|
||||||
|
@ -3,7 +3,7 @@ require 'spec_helper'
|
|||||||
describe 'ceilometer::collector' do
|
describe 'ceilometer::collector' do
|
||||||
|
|
||||||
let :pre_condition do
|
let :pre_condition do
|
||||||
"class { 'ceilometer': metering_secret => 's3cr3t' }"
|
"class { 'ceilometer': telemetry_secret => 's3cr3t' }"
|
||||||
end
|
end
|
||||||
|
|
||||||
shared_examples_for 'ceilometer-collector' do
|
shared_examples_for 'ceilometer-collector' do
|
||||||
|
@ -3,7 +3,7 @@ require 'spec_helper'
|
|||||||
describe 'ceilometer::dispatcher::gnocchi' do
|
describe 'ceilometer::dispatcher::gnocchi' do
|
||||||
|
|
||||||
let :pre_condition do
|
let :pre_condition do
|
||||||
"class { 'ceilometer': metering_secret => 's3cr3t' }"
|
"class { 'ceilometer': telemetry_secret => 's3cr3t' }"
|
||||||
end
|
end
|
||||||
|
|
||||||
let :params do
|
let :params do
|
||||||
|
@ -23,7 +23,7 @@ require 'spec_helper'
|
|||||||
describe 'ceilometer::expirer' do
|
describe 'ceilometer::expirer' do
|
||||||
|
|
||||||
let :pre_condition do
|
let :pre_condition do
|
||||||
"class { 'ceilometer': metering_secret => 's3cr3t' }"
|
"class { 'ceilometer': telemetry_secret => 's3cr3t' }"
|
||||||
end
|
end
|
||||||
|
|
||||||
let :params do
|
let :params do
|
||||||
|
@ -7,7 +7,7 @@ describe 'ceilometer' do
|
|||||||
:http_timeout => '600',
|
:http_timeout => '600',
|
||||||
:event_time_to_live => '604800',
|
:event_time_to_live => '604800',
|
||||||
:metering_time_to_live => '604800',
|
:metering_time_to_live => '604800',
|
||||||
:metering_secret => 'metering-s3cr3t',
|
:telemetry_secret => 'metering-s3cr3t',
|
||||||
:package_ensure => 'present',
|
:package_ensure => 'present',
|
||||||
:debug => 'False',
|
:debug => 'False',
|
||||||
:log_dir => '/var/log/ceilometer',
|
:log_dir => '/var/log/ceilometer',
|
||||||
@ -102,13 +102,13 @@ describe 'ceilometer' do
|
|||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'configures required metering_secret' do
|
it 'configures required telemetry_secret' do
|
||||||
is_expected.to contain_ceilometer_config('publisher/metering_secret').with_value('metering-s3cr3t')
|
is_expected.to contain_ceilometer_config('publisher/telemetry_secret').with_value('metering-s3cr3t')
|
||||||
is_expected.to contain_ceilometer_config('publisher/metering_secret').with_value( params[:metering_secret] ).with_secret(true)
|
is_expected.to contain_ceilometer_config('publisher/telemetry_secret').with_value( params[:telemetry_secret] ).with_secret(true)
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'without the required metering_secret' do
|
context 'without the required telemetry_secret' do
|
||||||
before { params.delete(:metering_secret) }
|
before { params.delete(:telemetry_secret) }
|
||||||
it { expect { is_expected.to raise_error(Puppet::Error) } }
|
it { expect { is_expected.to raise_error(Puppet::Error) } }
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -208,6 +208,25 @@ describe 'ceilometer' do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
# Cleanup in Ocata
|
||||||
|
shared_examples_for 'using old metering_secret param' do
|
||||||
|
context "with old metering_secret param it uses telemetry_secret instead" do
|
||||||
|
before { params.merge!(
|
||||||
|
:metering_secret => 'broncos',
|
||||||
|
:telemetry_secret => 'metering-s3cr3t',
|
||||||
|
) }
|
||||||
|
it { is_expected.to contain_ceilometer_config('publisher/telemetry_secret').with_value('metering-s3cr3t') }
|
||||||
|
end
|
||||||
|
context "with old metering_secret param set and telemetry_secret unset" do
|
||||||
|
before { params.merge!(
|
||||||
|
:metering_secret => 'broncos',
|
||||||
|
:telemetry_secret => nil,
|
||||||
|
) }
|
||||||
|
it { is_expected.to contain_ceilometer_config('publisher/telemetry_secret').with_value('broncos') }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
shared_examples_for 'rabbit with SSL support' do
|
shared_examples_for 'rabbit with SSL support' do
|
||||||
context "with default parameters" do
|
context "with default parameters" do
|
||||||
it { is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('<SERVICE DEFAULT>') }
|
it { is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('<SERVICE DEFAULT>') }
|
||||||
|
@ -11,7 +11,7 @@ describe 'ceilometer::wsgi::apache' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
let :pre_condition do
|
let :pre_condition do
|
||||||
"class { 'ceilometer': metering_secret => 's3cr3t' }"
|
"class { 'ceilometer': telemetry_secret => 's3cr3t' }"
|
||||||
end
|
end
|
||||||
|
|
||||||
shared_examples_for 'apache serving ceilometer with mod_wsgi' do
|
shared_examples_for 'apache serving ceilometer with mod_wsgi' do
|
||||||
|
Loading…
Reference in New Issue
Block a user