Merge "Deprecate ceilometer::expirer"
This commit is contained in:
commit
bda58c878b
@ -11,7 +11,6 @@ class { 'ceilometer::db':
|
|||||||
class { 'ceilometer::keystone::auth':
|
class { 'ceilometer::keystone::auth':
|
||||||
password => 'a_big_secret',
|
password => 'a_big_secret',
|
||||||
}
|
}
|
||||||
class { 'ceilometer::expirer': }
|
|
||||||
class { 'ceilometer::agent::polling': }
|
class { 'ceilometer::agent::polling': }
|
||||||
class { 'ceilometer::agent::notification': }
|
class { 'ceilometer::agent::notification': }
|
||||||
|
|
||||||
|
@ -59,9 +59,6 @@ node default {
|
|||||||
ipmi_namespace => false,
|
ipmi_namespace => false,
|
||||||
}
|
}
|
||||||
|
|
||||||
# Purge old meters
|
|
||||||
class { 'ceilometer::expirer': }
|
|
||||||
|
|
||||||
# Install notification agent
|
# Install notification agent
|
||||||
class { 'ceilometer::agent::notification':
|
class { 'ceilometer::agent::notification':
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
#
|
#
|
||||||
# == Class: ceilometer::expirer
|
# == Class: ceilometer::expirer
|
||||||
#
|
#
|
||||||
|
# DEPRECATED!
|
||||||
# Setups Ceilometer Expirer service to enable TTL feature.
|
# Setups Ceilometer Expirer service to enable TTL feature.
|
||||||
#
|
#
|
||||||
# === Parameters
|
# === Parameters
|
||||||
@ -25,52 +26,30 @@
|
|||||||
# (optional) Whether to configure a crontab entry to run the expiry.
|
# (optional) Whether to configure a crontab entry to run the expiry.
|
||||||
# When set to False, Puppet will try to remove the crontab.
|
# When set to False, Puppet will try to remove the crontab.
|
||||||
# It's useful when we upgrade from Ocata to Pike and want to remove it.
|
# It's useful when we upgrade from Ocata to Pike and want to remove it.
|
||||||
# Defaults to true.
|
# Defaults to undef.
|
||||||
#
|
#
|
||||||
# [*minute*]
|
# [*minute*]
|
||||||
# (optional) Defaults to '1'.
|
# (optional) Defaults to undef.
|
||||||
#
|
#
|
||||||
# [*hour*]
|
# [*hour*]
|
||||||
# (optional) Defaults to '0'.
|
# (optional) Defaults to undef.
|
||||||
#
|
#
|
||||||
# [*monthday*]
|
# [*monthday*]
|
||||||
# (optional) Defaults to '*'.
|
# (optional) Defaults to undef.
|
||||||
#
|
#
|
||||||
# [*month*]
|
# [*month*]
|
||||||
# (optional) Defaults to '*'.
|
# (optional) Defaults to undef.
|
||||||
#
|
#
|
||||||
# [*weekday*]
|
# [*weekday*]
|
||||||
# (optional) Defaults to '*'.
|
# (optional) Defaults to undef.
|
||||||
#
|
#
|
||||||
class ceilometer::expirer (
|
class ceilometer::expirer (
|
||||||
$enable_cron = true,
|
$enable_cron = undef,
|
||||||
$minute = 1,
|
$minute = undef,
|
||||||
$hour = 0,
|
$hour = undef,
|
||||||
$monthday = '*',
|
$monthday = undef,
|
||||||
$month = '*',
|
$month = undef,
|
||||||
$weekday = '*',
|
$weekday = undef,
|
||||||
) {
|
) {
|
||||||
|
warning('The ceilometer::expirer class is deprecated and has no effect')
|
||||||
include ceilometer::params
|
|
||||||
|
|
||||||
Anchor['ceilometer::install::end'] ~> Class['ceilometer::expirer']
|
|
||||||
|
|
||||||
if $enable_cron {
|
|
||||||
$ensure = 'present'
|
|
||||||
} else {
|
|
||||||
$ensure = 'absent'
|
|
||||||
}
|
|
||||||
|
|
||||||
cron { 'ceilometer-expirer':
|
|
||||||
ensure => $ensure,
|
|
||||||
command => $ceilometer::params::expirer_command,
|
|
||||||
environment => 'PATH=/bin:/usr/bin:/usr/sbin SHELL=/bin/sh',
|
|
||||||
user => 'ceilometer',
|
|
||||||
minute => $minute,
|
|
||||||
hour => $hour,
|
|
||||||
monthday => $monthday,
|
|
||||||
month => $month,
|
|
||||||
weekday => $weekday
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,6 @@ class ceilometer::params {
|
|||||||
include openstacklib::defaults
|
include openstacklib::defaults
|
||||||
|
|
||||||
$dbsync_command = 'ceilometer-upgrade'
|
$dbsync_command = 'ceilometer-upgrade'
|
||||||
$expirer_command = 'ceilometer-expirer'
|
|
||||||
$user = 'ceilometer'
|
$user = 'ceilometer'
|
||||||
$event_pipeline = '/etc/ceilometer/event_pipeline.yaml'
|
$event_pipeline = '/etc/ceilometer/event_pipeline.yaml'
|
||||||
$pipeline = '/etc/ceilometer/pipeline.yaml'
|
$pipeline = '/etc/ceilometer/pipeline.yaml'
|
||||||
|
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
deprecations:
|
||||||
|
- |
|
||||||
|
The ``ceilometer::expirer`` class has been deprecated and has no effect,
|
||||||
|
and it will be removed in a future release.
|
@ -22,9 +22,5 @@ describe 'ceilometer with mysql' do
|
|||||||
apply_manifest(pp, :catch_changes => true)
|
apply_manifest(pp, :catch_changes => true)
|
||||||
end
|
end
|
||||||
|
|
||||||
describe cron do
|
|
||||||
it { is_expected.to have_entry('1 0 * * * ceilometer-expirer').with_user('ceilometer') }
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -1,102 +0,0 @@
|
|||||||
#
|
|
||||||
# Copyright (C) 2013 eNovance SAS <licensing@enovance.com>
|
|
||||||
#
|
|
||||||
# Author: Emilien Macchi <emilien.macchi@enovance.com>
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
||||||
# not use this file except in compliance with the License. You may obtain
|
|
||||||
# a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
||||||
# License for the specific language governing permissions and limitations
|
|
||||||
# under the License.
|
|
||||||
#
|
|
||||||
# Unit tests for ceilometer::expirer
|
|
||||||
#
|
|
||||||
|
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe 'ceilometer::expirer' do
|
|
||||||
|
|
||||||
let :pre_condition do
|
|
||||||
"class { 'ceilometer': telemetry_secret => 's3cr3t' }"
|
|
||||||
end
|
|
||||||
|
|
||||||
let :params do
|
|
||||||
{}
|
|
||||||
end
|
|
||||||
|
|
||||||
shared_examples_for 'ceilometer-expirer' do
|
|
||||||
|
|
||||||
it { is_expected.to contain_class('ceilometer::deps') }
|
|
||||||
it { is_expected.to contain_class('ceilometer::params') }
|
|
||||||
|
|
||||||
it 'installs ceilometer common package' do
|
|
||||||
is_expected.to contain_package('ceilometer-common').with(
|
|
||||||
:ensure => 'present',
|
|
||||||
:name => platform_params[:common_package_name]
|
|
||||||
)
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'configures a cron' do
|
|
||||||
is_expected.to contain_cron('ceilometer-expirer').with(
|
|
||||||
:ensure => 'present',
|
|
||||||
:command => 'ceilometer-expirer',
|
|
||||||
:environment => 'PATH=/bin:/usr/bin:/usr/sbin SHELL=/bin/sh',
|
|
||||||
:user => 'ceilometer',
|
|
||||||
:minute => 1,
|
|
||||||
:hour => 0,
|
|
||||||
:monthday => '*',
|
|
||||||
:month => '*',
|
|
||||||
:weekday => '*'
|
|
||||||
)
|
|
||||||
end
|
|
||||||
|
|
||||||
context 'with cron not enabled' do
|
|
||||||
before do
|
|
||||||
params.merge!({
|
|
||||||
:enable_cron => false })
|
|
||||||
end
|
|
||||||
it {
|
|
||||||
is_expected.to contain_cron('ceilometer-expirer').with(
|
|
||||||
:ensure => 'absent',
|
|
||||||
:command => 'ceilometer-expirer',
|
|
||||||
:environment => 'PATH=/bin:/usr/bin:/usr/sbin SHELL=/bin/sh',
|
|
||||||
:user => 'ceilometer',
|
|
||||||
:minute => 1,
|
|
||||||
:hour => 0,
|
|
||||||
:monthday => '*',
|
|
||||||
:month => '*',
|
|
||||||
:weekday => '*'
|
|
||||||
)
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
on_supported_os({
|
|
||||||
:supported_os => OSDefaults.get_supported_os
|
|
||||||
}).each do |os,facts|
|
|
||||||
context "on #{os}" do
|
|
||||||
let (:facts) do
|
|
||||||
facts.merge!(OSDefaults.get_facts())
|
|
||||||
end
|
|
||||||
|
|
||||||
let :platform_params do
|
|
||||||
case facts[:osfamily]
|
|
||||||
when 'Debian'
|
|
||||||
{ :common_package_name => 'ceilometer-common' }
|
|
||||||
when 'RedHat'
|
|
||||||
{ :common_package_name => 'openstack-ceilometer-common' }
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
it_behaves_like 'ceilometer-expirer'
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
Loading…
Reference in New Issue
Block a user