2013-12-04 01:04:42 +01:00
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
#
|
|
|
|
# == Class: ceilometer::expirer
|
|
|
|
#
|
|
|
|
# Setups Ceilometer Expirer service to enable TTL feature.
|
|
|
|
#
|
|
|
|
# === Parameters
|
|
|
|
#
|
2015-06-25 15:28:12 +12:00
|
|
|
# [*enable_cron*]
|
|
|
|
# (optional) Whether to configure a crontab entry to run the expiry.
|
2017-05-18 16:16:40 -04:00
|
|
|
# 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.
|
2015-06-25 15:28:12 +12:00
|
|
|
# Defaults to true.
|
|
|
|
#
|
2013-12-04 01:04:42 +01:00
|
|
|
# [*minute*]
|
|
|
|
# (optional) Defaults to '1'.
|
|
|
|
#
|
|
|
|
# [*hour*]
|
|
|
|
# (optional) Defaults to '0'.
|
|
|
|
#
|
|
|
|
# [*monthday*]
|
|
|
|
# (optional) Defaults to '*'.
|
|
|
|
#
|
|
|
|
# [*month*]
|
|
|
|
# (optional) Defaults to '*'.
|
|
|
|
#
|
|
|
|
# [*weekday*]
|
|
|
|
# (optional) Defaults to '*'.
|
|
|
|
#
|
|
|
|
class ceilometer::expirer (
|
2016-05-23 20:32:14 +03:00
|
|
|
$enable_cron = true,
|
2015-12-23 23:38:23 +01:00
|
|
|
$minute = 1,
|
|
|
|
$hour = 0,
|
|
|
|
$monthday = '*',
|
|
|
|
$month = '*',
|
|
|
|
$weekday = '*',
|
2013-12-04 01:04:42 +01:00
|
|
|
) {
|
|
|
|
|
2015-02-22 22:14:37 +01:00
|
|
|
include ::ceilometer::params
|
2013-12-04 01:04:42 +01:00
|
|
|
|
2016-11-29 09:21:48 +08:00
|
|
|
Anchor['ceilometer::install::end'] ~> Class['ceilometer::expirer']
|
2013-12-04 01:04:42 +01:00
|
|
|
|
2015-06-25 15:28:12 +12:00
|
|
|
if $enable_cron {
|
2017-05-18 16:16:40 -04:00
|
|
|
$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
|
2013-12-04 01:04:42 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|