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 ?
↧