Clark Boylan f671fcf2c9 Pin curator to 3.5.1
elasticsearch-curator 4.0 introduced completely new everything. It will
take some work to support it and all of the new features so pin to 3.5.1
for now. This will keep index deletes working while we add the support.

Change-Id: Iea4e8794d2b953cfdd59ff7907420dffb3de4dff
2016-07-08 15:23:52 -07:00

57 lines
1.6 KiB
Puppet

# Copyright 2015 Hewlett-Packard Development Company, L.P.
#
# 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.
#
# ELK curator
#
class logstash::curator (
$cron_hour = '2',
$cron_minute = '0',
$keep_for_days = '14',
$pin_for_old_es = false,
) {
if ($pin_for_old_es) {
package { 'elasticsearch-curator':
ensure => '0.6.2',
provider => openstack_pip,
}
} else {
package { 'elasticsearch-curator':
# Pin until we add support for the new stuff in 4.0
ensure => '3.5.1',
provider => openstack_pip,
}
}
cron { 'cleanup_old_es_indices':
user => 'root',
hour => $cron_hour,
minute => $cron_minute,
environment => 'PATH=/usr/bin:/usr/local/bin',
command => "curator --logfile /var/log/curator.log delete indices --older-than ${keep_for_days} --time-unit days --timestring \%Y.\%m.\%d"
}
include ::logrotate
logrotate::file { 'curator.log':
log => '/var/log/curator.log',
options => [
'compress',
'missingok',
'rotate 31',
'daily',
'notifempty',
],
}
}