summaryrefslogtreecommitdiff
path: root/lib/puppet/type/file_line.rb
diff options
context:
space:
mode:
authorDan Prince <dprince@redhat.com>2013-08-29 12:19:16 -0400
committerJeff McCune <jeff@puppetlabs.com>2013-08-29 15:07:29 -0700
commit221277e8522b42bf170fded6ea23dfc526703b07 (patch)
tree51abab0793eb3ef67431889330c2e7b28383f1d1 /lib/puppet/type/file_line.rb
parent806430224ad0da860be3761ab83f1e574b64fc60 (diff)
Update file_line resource to support 'after'.
When adding new lines to a file the 'after' option can be useful when you need to insert file lines into the middle of a file. This is particularly helpful when using file_line with sectioned config files. NOTE: the after option only works when adding new lines. If you are updating an existing (matched) line it will simply modify it in place. This assumes it was in the right place to begin with.
Diffstat (limited to 'lib/puppet/type/file_line.rb')
-rw-r--r--lib/puppet/type/file_line.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/puppet/type/file_line.rb b/lib/puppet/type/file_line.rb
index 14946bb..323fc4c 100644
--- a/lib/puppet/type/file_line.rb
+++ b/lib/puppet/type/file_line.rb
@@ -42,6 +42,10 @@ Puppet::Type.newtype(:file_line) do
newvalues(true, false)
end
+ newparam(:after) 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(:line) do
desc 'The line to be appended to the file located by the path parameter.'
end