diff options
author | Eric Putnam <putnam.eric@gmail.com> | 2017-07-26 11:51:10 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-26 11:51:10 -0700 |
commit | d65a144aea0cd73f4aaa0cef15c74414baba5c8d (patch) | |
tree | 24e6a37d40538ad62db736c227f4f7438495d042 /lib/puppet/type/file_line.rb | |
parent | 4a658957db669efef666feb61b5d5c1406d105e9 (diff) | |
parent | 703fa777e1daee97e2aea529064d773662ef1fe0 (diff) |
Merge pull request #717 from ripclawffb/filelineoption
Add new file_line option append_on_no_match
Diffstat (limited to 'lib/puppet/type/file_line.rb')
-rw-r--r-- | lib/puppet/type/file_line.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/puppet/type/file_line.rb b/lib/puppet/type/file_line.rb index 3d691bf..b2357b8 100644 --- a/lib/puppet/type/file_line.rb +++ b/lib/puppet/type/file_line.rb @@ -58,7 +58,7 @@ Puppet::Type.newtype(:file_line) do encoding => "iso-8859-1", } - Files with special characters that are not valid UTF-8 will give the + Files with special characters that are not valid UTF-8 will give the error message "invalid byte sequence in UTF-8". In this case, determine the correct file encoding and specify the correct encoding using the encoding attribute, the value of which needs to be a valid Ruby character @@ -136,6 +136,12 @@ Puppet::Type.newtype(:file_line) do defaultto 'UTF-8' end + newparam(:append_on_no_match) do + desc 'If true, append line if match is not found. If false, do not append line if a match is not found' + newvalues(true, false) + defaultto true + end + # Autorequire the file resource if it's being managed autorequire(:file) do self[:path] |