Index: modules/logrotate/manifests/config.pp |
diff --git a/modules/logrotate/manifests/config.pp b/modules/logrotate/manifests/config.pp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..d1f9522fa866045f12169402cd8f749dc686cadf |
--- /dev/null |
+++ b/modules/logrotate/manifests/config.pp |
@@ -0,0 +1,57 @@ |
+# == Type: logrotate::config |
+# |
+# A shorthand wrapper that sets up a logrotate configuration file resources |
+# with the same $title, and properly configured attributes like e.g. $path. |
+# |
+# === Parameters: |
+# |
+# [*content*] |
+# Translates directly into the configuration file content. |
+# Mutually exclusive with $source. |
+# |
+# [*ensure*] |
+# Any value beside 'absent' and 'purged' will ensure the configuration |
+# file being 'present'. |
+# |
+# [*name*] |
+# The actual configuration file base name (defaults to $title). |
+# |
+# [*source*] |
+# Translates directly into the configuration file source. |
+# Mutually exclusive with $content. |
+# |
+# === Examples: |
+# |
+# logrotate::config {'gamma': |
+# ensure => 'present', |
+# source => 'puppet:///logrotate.conf', |
+# } |
+# |
+# logrotate::config {'delta': |
+# content => template('custom/logrotate.erb'), |
+# ensure => 'present', |
+# } |
+# |
+# logrotate::config {'void-alpha': |
+# ensure => 'absent', |
+# name => 'alpha', |
+# } |
+# |
+define logrotate::config ( |
+ $content = undef, |
+ $ensure = 'present', |
+ $source = undef, |
Fred
2015/09/29 11:33:51
This $source parameter is not being used any furth
|
+) { |
+ |
+ file {$title: |
+ content => $content, |
+ ensure => $ensure ? { |
+ /^(absent|purged)$/ => 'absent', |
+ default => 'present', |
+ }, |
+ group => 'root', |
+ mode => 0644, |
+ owner => 'root', |
+ path => "/etc/logrotate.d/$name", |
+ } |
+} |