diff options
Diffstat (limited to 'lib/puppet/type')
-rw-r--r-- | lib/puppet/type/file_line.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/puppet/type/file_line.rb b/lib/puppet/type/file_line.rb index 14946bb..df263e6 100644 --- a/lib/puppet/type/file_line.rb +++ b/lib/puppet/type/file_line.rb @@ -21,6 +21,9 @@ Puppet::Type.newtype(:file_line) do In this example, Puppet will ensure both of the specified lines are contained in the file /etc/sudoers. + **Autorequires:** If Puppet is managing the file that will contain the line + being managed, the file_line resource will autorequire that file. + EOT ensurable do @@ -42,6 +45,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 @@ -64,12 +71,5 @@ Puppet::Type.newtype(:file_line) do unless self[:line] and self[:path] raise(Puppet::Error, "Both line and path are required attributes") end - - if (self[:match]) - unless Regexp.new(self[:match]).match(self[:line]) - raise(Puppet::Error, "When providing a 'match' parameter, the value must be a regex that matches against the value of your 'line' parameter") - end - end - end end |