Created
June 14, 2014 08:09
-
-
Save 3h4x/f0e240455e66907f5008 to your computer and use it in GitHub Desktop.
Replace matching line in puppet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define replace_matching_line($file, $match, $replace) { | |
exec { "/bin/sed ${file} -i.bak -e 's/${match}/${replace}/'": | |
onlyif => "/bin/grep -E '${match}' ${file}", | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment