diff options
author | Micah Anderson <micah@riseup.net> | 2007-10-05 16:04:31 -0400 |
---|---|---|
committer | David Schmitt <david@schmitt.edv-bus.at> | 2007-10-08 11:40:09 +0200 |
commit | ad81b0f97758cb4948a696833581d1bd3c933e3d (patch) | |
tree | a729ae50895c26021d0f67c70a5fa6243b3608be /manifests | |
parent | 17c3eb16441c5130867aa45fdafb9c895fef4602 (diff) | |
download | puppet-common-ad81b0f97758cb4948a696833581d1bd3c933e3d.tar.gz puppet-common-ad81b0f97758cb4948a696833581d1bd3c933e3d.tar.bz2 |
Make the usage more friendly
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/defines/replace.pp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/manifests/defines/replace.pp b/manifests/defines/replace.pp index ae4498e..fcff84d 100644 --- a/manifests/defines/replace.pp +++ b/manifests/defines/replace.pp @@ -4,13 +4,20 @@ # Usage: # -# # replace the current port in /etc/munin/munin-node.conf -# # with a new, only disturbing the file when needed +# replace { description: +# file => "filename", +# pattern => "regexp", +# replacement => "replacement" +# +# For 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: # file => "/etc/munin/munin-node.conf", # pattern => "^port (?!$port)[0-9]*", # replacement => "port $port" # } + define replace($file, $pattern, $replacement) { $pattern_no_slashes = slash_escape($pattern) $replacement_no_slashes = slash_escape($replacement) @@ -20,6 +27,3 @@ define replace($file, $pattern, $replacement) { alias => "exec_$name", } } - - - |