[Puppet Users] delete line in file with substring xyz

2017-05-06 Thread Khalid J Hosein
This worked for me: file_line { 'remove ': ensure => absent, path => '/path/to/file.conf', match => 'some (regexp) part of a given line', match_for_absence => true, line => '', } Note how the 'line' attribute is still there but null (nothing between 2 s

Re: [Puppet Users] delete line in file with substring xyz

2015-02-25 Thread Garrett Honeycutt
On 2/25/15 10:56 AM, Martin Alfke wrote: > The single quotes take the argument as it is. > In this case you are looking for a line with *xyz* > Maybe you want to try double quotes. > > hth, > > Martin > > On 25 Feb 2015, at 13:58, Andreas Dvorak wrote: > >> Dear all >> >> I would like to use t

Re: [Puppet Users] delete line in file with substring xyz

2015-02-25 Thread Martin Alfke
The single quotes take the argument as it is. In this case you are looking for a line with *xyz* Maybe you want to try double quotes. hth, Martin On 25 Feb 2015, at 13:58, Andreas Dvorak wrote: > Dear all > > I would like to use the stdlib Modul with file_line to delete a line that > matches

[Puppet Users] delete line in file with substring xyz

2015-02-25 Thread Andreas Dvorak
Dear all I would like to use the stdlib Modul with file_line to delete a line that matches *xyz*. But the resource file_line {'delete line': ensure => absent, path => '/etc/file', line => '*xyz*', } or file_line {'delete line': ensure => absent, path => '/etc/file', match =>