aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2009-12-25 22:33:24 -0200
committerSilvio Rhatto <rhatto@riseup.net>2009-12-25 22:33:24 -0200
commita25d1e44c24ba52885a2b795387fe733798f85ed (patch)
tree50fc558b09b205ba6b2ea5bd867add6a1b8e48f0
parent0f5508374a63dbf0f7bfeb70e2e8f33bf24f891b (diff)
downloadpuppet-common-a25d1e44c24ba52885a2b795387fe733798f85ed.tar.gz
puppet-common-a25d1e44c24ba52885a2b795387fe733798f85ed.tar.bz2
Adding delete_lines
-rw-r--r--manifests/defines/delete_lines.pp5
1 files changed, 5 insertions, 0 deletions
diff --git a/manifests/defines/delete_lines.pp b/manifests/defines/delete_lines.pp
new file mode 100644
index 0000000..28d2362
--- /dev/null
+++ b/manifests/defines/delete_lines.pp
@@ -0,0 +1,5 @@
+define delete_lines($file, $pattern) {
+ exec { "/bin/sed -i -r -e '/$pattern/d' $file":
+ onlyif => "/bin/grep -E '$pattern' '$file'",
+ }
+}