From de7690c4e76ddd7c1f01d81fe92c75771da47c51 Mon Sep 17 00:00:00 2001 From: David Schmitt Date: Tue, 9 Jun 2009 17:51:10 +0200 Subject: RDoc-ify documentation See http://club.black.co.at/david/puppet/doc/ for a current version of the RDoc output. --- manifests/classes/lsb_release.pp | 2 +- manifests/defines/concatenated_file.pp | 6 ++--- manifests/defines/config_file.pp | 27 ++++++++++++----------- manifests/defines/line.pp | 40 ++++++++++++++++++---------------- manifests/defines/module_dir.pp | 11 +++++----- manifests/defines/module_file.pp | 10 ++++----- manifests/defines/replace.pp | 15 ++++++++----- 7 files changed, 58 insertions(+), 53 deletions(-) (limited to 'manifests') diff --git a/manifests/classes/lsb_release.pp b/manifests/classes/lsb_release.pp index bf9baeb..5745072 100644 --- a/manifests/classes/lsb_release.pp +++ b/manifests/classes/lsb_release.pp @@ -43,7 +43,7 @@ class assert_lsbdistcodename { } -# To fail the complete compilation, include this class +# To fail the complete compilation on a missing $lsbdistcodename, include this class class require_lsbdistcodename inherits assert_lsbdistcodename { exec { "false # require_lsbdistcodename": require => Exec[require_lsbdistcodename], loglevel => err } } diff --git a/manifests/defines/concatenated_file.pp b/manifests/defines/concatenated_file.pp index c7e1f21..8ae855c 100644 --- a/manifests/defines/concatenated_file.pp +++ b/manifests/defines/concatenated_file.pp @@ -26,9 +26,9 @@ module_dir { "common/cf": } # Exec["concat_${name}"] if you want to force an update. # # Usage: -# concatenated_file { "/etc/some.conf": -# dir => "/etc/some.conf.d", -# } +# concatenated_file { "/etc/some.conf": +# dir => "/etc/some.conf.d", +# } define concatenated_file ( # where the snippets are located $dir = '', diff --git a/manifests/defines/config_file.pp b/manifests/defines/config_file.pp index 8d93e0a..59208ac 100644 --- a/manifests/defines/config_file.pp +++ b/manifests/defines/config_file.pp @@ -5,30 +5,31 @@ # A simple wrapper to give all configuration files common defaults. # # Usage: -# config_file { filename: -# content => "....\n", -# } +# 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}"]; +# 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"] -# } - +# config_file { +# "/etc/apache2/sites-available/munin-stats": +# content => template("apache/munin-stats"), +# require => Package["apache2"], +# notify => Exec["reload-apache2"]; +# } define config_file ( $content = '', $source = '', diff --git a/manifests/defines/line.pp b/manifests/defines/line.pp index fe2124d..be5ec31 100644 --- a/manifests/defines/line.pp +++ b/manifests/defines/line.pp @@ -2,36 +2,38 @@ # Copyright (C) 2007 David Schmitt # See LICENSE for the full license granted to you. -# Ensures that a specific line is present or absent in a file. This can be very -# brittle, since even small changes can throw this off. +# Ensures that a specific line is present or absent in a file. This can +# be very brittle, since even small changes can throw this off. # # If the line is not present yet, it will be appended to the file. # # The name of the define is not used. Just keep it (globally) unique and # descriptive. # -# Use this only for very trivial stuff. +# Use this only for very trivial stuff. Usually replacing the whole file +# is a more stable solution with less maintenance headaches afterwards. # # Usage: -# line { description: -# file => "filename", -# line => "content", -# ensure => {absent,*present*} -# } +# line { +# description: +# file => "filename", +# 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], -# } +# 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, diff --git a/manifests/defines/module_dir.pp b/manifests/defines/module_dir.pp index 712e611..5b2d340 100644 --- a/manifests/defines/module_dir.pp +++ b/manifests/defines/module_dir.pp @@ -4,21 +4,17 @@ # Copyright (C) 2007 David Schmitt # See LICENSE for the full license granted to you. -# Use this variable to reference the base path. Thus you are safe from any -# changes. -$module_dir_path = '/var/lib/puppet/modules' - # A module_dir is a storage place for all the stuff a module might want to # store. According to the FHS, this should go to /var/lib. Since this is a part # of puppet, the full path is /var/lib/puppet/modules/${name}. Every module # should # prefix its module_dirs with its name. # # By default, the module_dir is loaded from "puppet:///${name}/module_dir". If -# that doesn't exist an empty directory is taken as template. The directory is +# that doesn't exist an empty directory is taken as source. The directory is # purged so that modules do not have to worry about removing cruft. # # Usage: -# module_dir { ["common", "common/dir1", "common/dir2" ]: } +# module_dir { ["common", "common/dir1", "common/dir2" ]: } define module_dir ( $mode = 0644, $owner = root, @@ -41,3 +37,6 @@ define module_dir ( } } +# Use this variable to reference the base path. Thus you are safe from any +# changes. +$module_dir_path = '/var/lib/puppet/modules' diff --git a/manifests/defines/module_file.pp b/manifests/defines/module_file.pp index 6082eff..9074589 100644 --- a/manifests/defines/module_file.pp +++ b/manifests/defines/module_file.pp @@ -4,12 +4,12 @@ # Copyright (C) 2007 David Schmitt # See LICENSE for the full license granted to you. +# Put a file into module-local storage. +# # Usage: -# module_file { "module/file": -# source => "puppet://..", -# mode => 644, # default -# owner => root, # default -# group => root, # default +# module_file { +# "module/file": +# source => "puppet://..", # } define module_file ( $source, diff --git a/manifests/defines/replace.pp b/manifests/defines/replace.pp index a7a59b8..c9a98bd 100644 --- a/manifests/defines/replace.pp +++ b/manifests/defines/replace.pp @@ -8,6 +8,9 @@ # creating a template is often better than this hack. # # This define uses perl regular expressions. +# +# Use this only for very trivial stuff. Usually replacing the whole file is a +# more stable solution with less maintenance headaches afterwards. # # Usage: # @@ -20,12 +23,12 @@ # 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: -# file => "/etc/munin/munin-node.conf", -# pattern => "^port (?!$port)[0-9]*", -# replacement => "port $port" -# } - +# replace { +# set_munin_node_port: +# file => "/etc/munin/munin-node.conf", +# pattern => "^port (?!$port)[0-9]*", +# replacement => "port $port" +# } define replace($file, $pattern, $replacement) { $pattern_no_slashes = regsubst($pattern, '/', '\\/', 'G', 'U') $replacement_no_slashes = regsubst($replacement, '/', '\\/', 'G', 'U') -- cgit v1.2.3