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...@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
>>
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