From ca9b0fecd989df4877163f718ada342d7ca8a26b Mon Sep 17 00:00:00 2001 From: Jerome Charaoui Date: Fri, 7 May 2010 17:38:15 -0400 Subject: fix whitespace (remove tabs & trailing whitespace) --- manifests/defines/replace.pp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'manifests/defines/replace.pp') diff --git a/manifests/defines/replace.pp b/manifests/defines/replace.pp index c13325e..7dabe59 100644 --- a/manifests/defines/replace.pp +++ b/manifests/defines/replace.pp @@ -4,7 +4,7 @@ # Usage: # -# replace { description: +# replace { description: # file => "filename", # pattern => "regexp", # replacement => "replacement" @@ -14,17 +14,17 @@ # 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" -# } +# 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) - exec { "replace_${pattern}_${file}": - command => "/usr/bin/perl -pi -e 's/${pattern_no_slashes}/${replacement_no_slashes}/' '${file}'", - onlyif => "/usr/bin/perl -ne 'BEGIN { \$ret = 1; } \$ret = 0 if /${pattern_no_slashes}/ && ! /\\Q${replacement_no_slashes}\\E/; END { exit \$ret; }' '${file}'", - alias => "exec_$name", - } + $pattern_no_slashes = slash_escape($pattern) + $replacement_no_slashes = slash_escape($replacement) + exec { "replace_${pattern}_${file}": + command => "/usr/bin/perl -pi -e 's/${pattern_no_slashes}/${replacement_no_slashes}/' '${file}'", + onlyif => "/usr/bin/perl -ne 'BEGIN { \$ret = 1; } \$ret = 0 if /${pattern_no_slashes}/ && ! /\\Q${replacement_no_slashes}\\E/; END { exit \$ret; }' '${file}'", + alias => "exec_$name", + } } -- cgit v1.2.3