Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
file_line type issue, possible bug
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  8 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Ryan Bowlby  
View profile  
 More options Jun 10 2012, 6:56 am
From: Ryan Bowlby <rbowlb...@gmail.com>
Date: Sun, 10 Jun 2012 03:56:32 -0700 (PDT)
Local: Sun, Jun 10 2012 6:56 am
Subject: file_line type issue, possible bug

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?

-Ryan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jeff McCune  
View profile  
 More options Jun 10 2012, 12:58 pm
From: Jeff McCune <j...@puppetlabs.com>
Date: Sun, 10 Jun 2012 09:58:23 -0700
Local: Sun, Jun 10 2012 12:58 pm
Subject: Re: [Puppet Users] file_line type issue, possible bug

On Sun, Jun 10, 2012 at 3:56 AM, Ryan Bowlby <rbowlb...@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 must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ryan Bowlby  
View profile  
 More options Jun 10 2012, 3:43 pm
From: Ryan Bowlby <rbowlb...@gmail.com>
Date: Sun, 10 Jun 2012 12:43:06 -0700 (PDT)
Local: Sun, Jun 10 2012 3:43 pm
Subject: Re: [Puppet Users] file_line type issue, possible bug

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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nan Liu  
View profile  
 More options Jun 10 2012, 4:04 pm
From: Nan Liu <n...@puppetlabs.com>
Date: Sun, 10 Jun 2012 13:04:34 -0700
Local: Sun, Jun 10 2012 4:04 pm
Subject: Re: [Puppet Users] file_line type issue, possible bug

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

 --
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/puppet-users/-/NcyEJNStTq4J.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to
puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jeff McCune  
View profile  
 More options Jun 10 2012, 11:54 pm
From: Jeff McCune <j...@puppetlabs.com>
Date: Sun, 10 Jun 2012 20:54:14 -0700
Local: Sun, Jun 10 2012 11:54 pm
Subject: Re: [Puppet Users] file_line type issue, possible bug

On Sun, Jun 10, 2012 at 12:43 PM, Ryan Bowlby <rbowlb...@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.

It totally makes sense, it's just a bit difficult to implement.  At
least the implementations I'm imagining are.  Surely there's a simple
solution, I'm just not seeing it right now.

We only recently built the next generation of our persistent storage
system, but I'm not sure it's ready to store things like partial
resource attributes.  I'll ask them tomorrow.

-Jeff


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jeff McCune  
View profile  
 More options Jun 10 2012, 11:55 pm
From: Jeff McCune <j...@puppetlabs.com>
Date: Sun, 10 Jun 2012 20:55:22 -0700
Local: Sun, Jun 10 2012 11:55 pm
Subject: Re: [Puppet Users] file_line type issue, possible bug

On Sun, Jun 10, 2012 at 1:04 PM, Nan Liu <n...@puppetlabs.com> wrote:
> 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.

Yes, the concat module [1] is pretty awesome.  I've been working with
it in the dhcp module recently and it works really well.

[1] http://forge.puppetlabs.com/ripienaar/concat

-Jeff


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Aaron Grewell  
View profile  
 More options Jun 11 2012, 11:48 am
From: Aaron Grewell <aaron.grew...@gmail.com>
Date: Mon, 11 Jun 2012 08:48:00 -0700
Subject: Re: [Puppet Users] file_line type issue, possible bug

Depending on your sudo version you could also put snippets in
/etc/sudoers.d. This has the advantage of allowing each class to manage its
own sudoers file without any Puppet conflicts.
On Jun 10, 2012 3:56 AM, "Ryan Bowlby" <rbowlb...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Paul Tötterman  
View profile  
 More options Jun 12 2012, 3:37 am
From: Paul Tötterman <paul.totter...@gmail.com>
Date: Tue, 12 Jun 2012 00:37:07 -0700 (PDT)
Local: Tues, Jun 12 2012 3:37 am
Subject: Re: [Puppet Users] file_line type issue, possible bug

> Depending on your sudo version you could also put snippets in
> /etc/sudoers.d. This has the advantage of allowing each class to manage its
> own sudoers file without any Puppet conflicts.

Make sure to implement some kind of ordering for the snippets. From the
man-page: "Where there are multiple matches, the last match is used (which
is not necessarily the most specific match)". This has bitten me more than
once.

Cheers,
Paul


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »