Merge "loadbalancer: Use logrotate define for haproxy"

This commit is contained in:
Jenkins 2015-01-26 12:45:22 +00:00 committed by Gerrit Code Review
commit e7754b136f
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(