From ceacf8f40ea74a76bcf32cd410f332d3a9c40030 Mon Sep 17 00:00:00 2001 From: Joshua Hoblitt Date: Sun, 13 Oct 2013 17:41:29 -0700 Subject: [PATCH] add a logrotate::rule for $log_path --- .fixtures.yml | 3 +++ Modulefile | 1 + manifests/init.pp | 11 +++++++++++ spec/classes/selenium_spec.rb | 10 ++++++++++ 4 files changed, 25 insertions(+) diff --git a/.fixtures.yml b/.fixtures.yml index c90b371..5ea5ca0 100644 --- a/.fixtures.yml +++ b/.fixtures.yml @@ -6,5 +6,8 @@ fixtures: "wget": repo: "git://github.com/maestrodev/puppet-wget.git" ref: "v1.2.2" + "logrotate": + repo: "git://github.com/rodjek/puppet-logrotate.git" + ref: "1.1.1" symlinks: "selenium": "#{source_dir}" diff --git a/Modulefile b/Modulefile index b75a668..bfa5218 100644 --- a/Modulefile +++ b/Modulefile @@ -9,3 +9,4 @@ summary 'Manages Selenium Server 2 - Standalone and Grid' description 'Manages Selenium Server 2 - Standalone and Grid' dependency 'puppetlabs/stdlib', '>= 3.0.0' dependency 'maestrodev/wget', '>= 1.2.2' +dependency 'rodjek/logrotate', '>= 1.1.1' diff --git a/manifests/init.pp b/manifests/init.pp index 29b2cda..debef69 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -132,4 +132,15 @@ require => File[$jar_path], } + logrotate::rule { 'selenium': + path => $log_path, + rotate_every => 'weekly', + missingok => true, + rotate => 4, + compress => true, + delaycompress => true, + copytruncate => true, + minsize => '100k', + } + } diff --git a/spec/classes/selenium_spec.rb b/spec/classes/selenium_spec.rb index 96e0e8c..d68f22b 100644 --- a/spec/classes/selenium_spec.rb +++ b/spec/classes/selenium_spec.rb @@ -49,6 +49,16 @@ 'timeout' => '90', 'execuser' => p[:user], }) + should contain_logrotate__rule('selenium').with({ + :path => "#{p[:install_root]}/log", + :rotate_every => 'weekly', + :missingok => true, + :rotate => 4, + :compress => true, + :delaycompress => true, + :copytruncate => true, + :minsize => '100k', + }) end end