Merge "Configure the Curator to use the Elasticsearch VIP"

This commit is contained in:
Jenkins 2016-01-20 07:58:01 +00:00 committed by Gerrit Code Review
commit c7578e62b4
3 changed files with 12 additions and 1 deletions

View File

@ -76,6 +76,7 @@ elasticsearch::instance { $es_instance:
}
class { 'lma_logging_analytics::curator':
host => hiera('lma::elasticsearch::vip'),
retention_period => $elasticsearch_kibana['retention_period'],
prefixes => ['log', 'notification'],
}

View File

@ -13,6 +13,8 @@
# under the License.
class lma_logging_analytics::curator (
$host = 'localhost',
$port = '9200',
$retention_period = $lma_logging_analytics::params::retention_period,
$prefixes = $lma_logging_analytics::params::indexes_prefixes,
) inherits lma_logging_analytics::params {
@ -32,7 +34,7 @@ class lma_logging_analytics::curator (
$regex = join($prefixes, '|')
cron { 'es-curator':
ensure => present,
command => "/usr/local/bin/curator --host localhost --port 9200 --debug delete indices --regex '^(${regex})-.*$' --time-unit days --older-than ${real_retention_period} --timestring \"%Y.%m.%d\"",
command => "/usr/local/bin/curator --host ${host} --port ${port} --debug delete indices --regex '^(${regex})-.*$' --time-unit days --older-than ${real_retention_period} --timestring \"%Y.%m.%d\"",
minute => '0',
hour => '2',
month => '*',

View File

@ -37,4 +37,12 @@ describe 'lma_logging_analytics::curator', :type => :class do
it { is_expected.to contain_cron('es-curator') }
end
describe 'with index prefixes and retention period > 0 and host' do
let(:params) do
{:retention_period => 10, :prefixes => ['foo'], :host => 'foo.org'}
end
it { is_expected.to contain_cron('es-curator').with_command(/--host foo.org/) }
end
end