Quantcast
Channel: Ask Puppet: Puppet DevOps Q&A Community - RSS feed
Viewing all articles
Browse latest Browse all 6104

update line if found in file

$
0
0
I am trying to figure out how to replace a line in a file, but only if it already exists in the file. eg, i only want to update the proxy where it is already configured in /etc/yum.conf this is what i am trying, but i cant seem to make it work file_line { 'yum_proxy': ensure => 'present', path => '/etc/yum.conf', line => 'proxy=http://new.proxy.address:8080', match => '^proxy\=', match_for_absence => 'false', } is there any way in which I can do this ?

Viewing all articles
Browse latest Browse all 6104

Trending Articles