From 6eaa592cd8d5af097a4624b3d1cead74408aabf2 Mon Sep 17 00:00:00 2001 From: Stephen Benjamin Date: Wed, 14 May 2014 20:33:57 +0200 Subject: (PUP-2571) add 'before' functionality to file_line file_line supports adding lines after a match, but there are use cases when having "before" would be useful. For example, in Debian-based OS's, the last line of /etc/rc.local is "exit 0" it's an incredible pain to deal with that scenario today. This commit adds a 'before' parameter to the file_line type, and implements it for the ruby provider. --- lib/puppet/type/file_line.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/puppet/type/file_line.rb') diff --git a/lib/puppet/type/file_line.rb b/lib/puppet/type/file_line.rb index 323fc4c..bc6745f 100644 --- a/lib/puppet/type/file_line.rb +++ b/lib/puppet/type/file_line.rb @@ -46,6 +46,10 @@ Puppet::Type.newtype(:file_line) do desc 'An optional value used to specify the line after which we will add any new lines. (Existing lines are added in place)' end + newparam(:before) do + desc 'An optional value used to specify the line before which we will add any new lines. (Existing lines are added in place)' + end + newparam(:line) do desc 'The line to be appended to the file located by the path parameter.' end -- cgit v1.2.3