diff options
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/defines/delete_lines.pp | 5 |
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'", + } +} |