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 /README.md | |
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 'README.md')
-rw-r--r-- | README.md | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -115,6 +115,18 @@ file_line { 'bashrc_proxy': In the example above, `match` looks for a line beginning with 'export' followed by 'HTTP_PROXY' and replaces it with the value in line. +Match Example: + + file_line { 'bashrc_proxy': + ensure => present, + path => '/etc/bashrc', + line => 'export HTTP_PROXY=http://squid.puppetlabs.vm:3128', + match => '^export\ HTTP_PROXY\=', + append_on_no_match => false, + } + +In this code example, `match` looks for a line beginning with export followed by HTTP_PROXY and replaces it with the value in line. If a match is not found, then no changes are made to the file. + Match Example with `ensure => absent`: ```puppet |