Re: [Puppet Users] file_line type issue, possible bug

Nan Liu
Sun, 10 Jun 2012 20:04:34 -0000

If you are fully managing the file use RI puppet-concat module instead of
file and file_line. I see it as

file: fully managed file or erb template.
file_line: partially managed file.
concat: fully managed file requiring per line resource injection.

Nan

On Jun 10, 2012, at 12:43, Ryan Bowlby <rbowlby83@gmail.com> wrote:

Thanks Jeff, I''ll heed that advice. Wouldn''t it make sense
though to have
the file resource "respect" changes made by file_line. Behind the
scenes,
if the file resource were able to know about the file_line additions and
could remove them before calculating the md5 then both can be used on the
same file. The current conflict doesn''t have to be a conflict, I
assumed
puppet did this already.

-Ryan

On Sunday, June 10, 2012 9:58:23 AM UTC-7, Jeff McCune
wrote:
>
> On Sun, Jun 10, 2012 at 3:56 AM, Ryan Bowlby <rbowlby83@gmail.com>
wrote:
> > Hi All,
> >
> > I am using the file_line type included in stdlib to add a line to
> > /etc/sudoers. On each run the sudo module replaces /etc/sudoers, then
> > file_line resource adds the line back. It''s happening on each
run and I
> > can''t seem to figure out to get the sudo module''s
file resource to stop
> > replacing the file on each run. I was hoping the file resource would
> ignore
> > any lines propagated by the file_line resource. Is this a bug or am I
> just
> > missing something?
>
> It''s not a bug, it''s just how things work.
>
> What''s happening is that you have two models (File_line and
> File[/etc/sudoers]) of the same resource (/etc/sudoers) and the two
> models conflict with each other.
>
> The file resource has no knowledge of the file_line resource.  I''d
use
> one or the other but not both.
>
> A file resource is most appropriate when you can manage the entire
> contents of the file.  A file_line resource is appropriate when you
> can''t manage the entire contents of the file, only portions of it.
>
> Hope this helps,
> -Jeff
>
 --
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To view this discussion on the web visit