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

Paul Tötterman
Fri, 23 Mar 2012 11:10:34 -0000

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

--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To view this discussion on the web visit