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 <andreas.dvo...@gmail.com> wrote: > >> 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 => '*xyz*', >> } >> >> does not work. >> >> My current solution is with an exec resource but I don't like it. >> >> Does anymbody know how to do it with file_line? >> >> Andreas >>
Hi, The single quotes are good. The issue is with your regex. You are using wildcards '*' which is not a valid regex. Try just 'xyz' without the stars[1]. Recommend checking out Rubular[2] to test your regex's. [1] - http://rubular.com/r/RjAnADs5x3 [2] - http://rubular.com/ Best regards, -g -- Garrett Honeycutt @learnpuppet Puppet Training with LearnPuppet.com Mobile: +1.206.414.8658 -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/54EE028D.8090402%40garretthoneycutt.com. For more options, visit https://groups.google.com/d/optout.