loadbalancer: Use logrotate define for haproxy

* logrotate::rule instead of file
  * remove haproxy logrotate file

Change-Id: I8294108710d6335bca871bad294ff561ccd2c47b
This commit is contained in:
Dimitri Savineau 2015-01-23 09:43:14 -05:00
parent 4cc15bf362
commit e4c746f1c0
3 changed files with 18 additions and 25 deletions

View File

@ -1,12 +0,0 @@
# Managed by Puppet
# Module cloud::loadbalancer
/var/log/haproxy.log {
rotate 7
daily
missingok
notifempty
delaycompress
compress
postrotate
endscript
}

View File

@ -563,12 +563,14 @@ class cloud::loadbalancer(
}
}
file { '/etc/logrotate.d/haproxy':
ensure => file,
source => 'puppet:///modules/cloud/logrotate/haproxy',
owner => root,
group => root,
mode => '0644';
logrotate::rule { 'haproxy':
path => '/var/log/haproxy.log',
rotate => 7,
rotate_every => 'day',
missingok => true,
ifempty => false,
delaycompress => true,
compress => true,
}
if $vip_monitor_ip {

View File

@ -195,14 +195,17 @@ describe 'cloud::loadbalancer' do
end # configure haproxy server
end # configure keepalived in master
context 'configure logrotate file' do
it { is_expected.to contain_file('/etc/logrotate.d/haproxy').with(
:source => 'puppet:///modules/cloud/logrotate/haproxy',
:mode => '0644',
:owner => 'root',
:group => 'root'
context 'configure logrotate rule' do
it { is_expected.to contain_logrotate__rule('haproxy').with(
:path => '/var/log/haproxy.log',
:rotate => 7,
:rotate_every => 'day',
:missingok => true,
:ifempty => false,
:delaycompress => true,
:compress => true
)}
end # configure logrotate file
end # configure logrotate rule
context 'configure monitor haproxy listen' do
it { is_expected.to contain_haproxy__listen('monitor').with(