Re: [Puppet Users] Re: Removing lines from a file

John Kennedy
Fri, 23 Mar 2012 11:57:58 -0000

On Fri, Mar 23, 2012 at 11:10, Paul Tötterman
<paul.totterman@gmail.com>wrote:

> Hi John
>
>
>> I can see where ''file_line'' will add a line but I
don''t know enough ruby
>> to know, will it remove a line that does exist?
>>
>
> ''ensurable'' sounds like it can manage both
''ensure => present'' and ''ensure
> => absent''. And sure enough, if you look into the provider:
>
https://github.com/puppetlabs/puppetlabs-stdlib/blob/master/lib/puppet/provider/file_line/ruby.rb
there
> is code for removing the line as well.
>
> I would also recommend that you take a look at the awesome concat module:
> https://github.com/ripienaar/puppet-concat if you cannot manage the whole
> file easily using templates.
>
> Cheers,
> Paul
>
>
> Thanks Paul. I will also look at the concat module.
One (hopefully) last question...How do I take the file_line.rb file and put
it so puppet recognises it? Do I do that with a define or can I just take
the file and place it somewhere for it to work?
I am pretty new to puppet and still working on the basics.