From 703fa777e1daee97e2aea529064d773662ef1fe0 Mon Sep 17 00:00:00 2001 From: "asif.shaikh" Date: Wed, 1 Feb 2017 20:14:27 -0800 Subject: Add new file_line option append_on_no_match --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index 61318ea..5e298d5 100644 --- a/README.md +++ b/README.md @@ -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 -- cgit v1.2.3