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': logrotate::rule { 'haproxy':
ensure => file, path => '/var/log/haproxy.log',
source => 'puppet:///modules/cloud/logrotate/haproxy', rotate => 7,
owner => root, rotate_every => 'day',
group => root, missingok => true,
mode => '0644'; ifempty => false,
delaycompress => true,
compress => true,
} }
if $vip_monitor_ip { if $vip_monitor_ip {

View File

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