]> gitweb.fluxo.info Git - puppet-common.git/commitdiff
Add some examples to the individual defines
authorMicah Anderson <micah@riseup.net>
Fri, 5 Oct 2007 20:04:32 +0000 (16:04 -0400)
committerDavid Schmitt <david@schmitt.edv-bus.at>
Mon, 8 Oct 2007 09:40:09 +0000 (11:40 +0200)
manifests/defines/config_file.pp
manifests/defines/line.pp
manifests/defines/replace.pp

index 44338781527be3e72d8dee84f9018c99b308e697..e539c6d97b4c854e0364071dc7f8b3b1a6f99830 100644 (file)
@@ -1,4 +1,4 @@
-# common/manifests/defines/config_file.pp -- put a config file with default permissions
+# common/manifests/defines/config_file.pp -- create a config file with default permissions
 # Copyright (C) 2007 David Schmitt <david@schmitt.edv-bus.at>
 # See LICENSE for the full license granted to you.
 
@@ -6,6 +6,27 @@
 # config_file { filename:
 #      content => "....\n",
 # }
+#
+# Examples: 
+#
+# To create the file /etc/vservers/${vs_name}/context with specific
+# content:
+#
+# config_file { "/etc/vservers/${vs_name}/context":
+#              content => "${context}\n",
+#              notify => Exec["vs_restart_${vs_name}"],
+#              require => Exec["vs_create_${vs_name}"];
+# }
+#
+# To create the file /etc/apache2/sites-available/munin-stats with the
+# content pulled from a template:
+#
+# config_file { "/etc/apache2/sites-available/munin-stats":
+#              content => template("apache/munin-stats"),
+#              require => Package["apache2"],
+#              notify => Exec["reload-apache2"]
+# }
+
 define config_file ($content) {
        file { $name:
                content => $content,
index 6026a8486483b1c4a8294bce97a9bc964674631a..42bd5a10eaf6ae1bedba7b3f9df38fde844f0633 100644 (file)
@@ -1,4 +1,4 @@
-# common/manifests/defines/line.pp -- a trivial puppet lined
+# common/manifests/defines/line.pp -- a trivial mechanism to ensure a line exists in a file
 # Copyright (C) 2007 David Schmitt <david@schmitt.edv-bus.at>
 # See LICENSE for the full license granted to you.
 
@@ -8,6 +8,21 @@
 #      line => "content",
 #      ensure => {absent,*present*}
 # }
+#
+# Example:
+# The following ensures that the line "allow ^$munin_host$" exists
+# in /etc/munin/munin-node.conf, and if there are any changes notify the service for
+# a restart
+#
+# line { allow_munin_host:
+#       file => "/etc/munin/munin-node.conf",
+#       line => "allow ^$munin_host$",
+#       ensure => present,
+#       notify => Service[munin-node],
+#       require => Package[munin-node],
+# }
+#
+#
 define line($file, $line, $ensure = 'present') {
        case $ensure {
                default : { err ( "unknown ensure value $ensure" ) }
index fcff84d75bd90422d2b1063c1457dac315066889..d1c7496dd6a0843d9558b7d4ded4925e097999ca 100644 (file)
@@ -9,7 +9,8 @@
 #           pattern => "regexp",
 #           replacement => "replacement"
 #
-# For example, to replace the current port in /etc/munin/munin-node.conf
+# Example:
+# To replace the current port in /etc/munin/munin-node.conf
 # with a new port, but only disturbing the file when needed:
 #
 # replace { set_munin_node_port: