Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: modules/logrotate/manifests/config.pp

Issue 29328514: Issue 3103 - Introduce type logrotate::config (Closed)
Patch Set: Created Sept. 23, 2015, 6:47 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | modules/logrotate/manifests/init.pp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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",
+ }
+}
« no previous file with comments | « no previous file | modules/logrotate/manifests/init.pp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld