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
Getting puppet to manage logrotate
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
  4 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
 
kenneho  
View profile  
 More options May 20 2008, 7:46 am
From: kenneho <kenneho....@gmail.com>
Date: Tue, 20 May 2008 04:46:32 -0700 (PDT)
Local: Tues, May 20 2008 7:46 am
Subject: Getting puppet to manage logrotate
Hi.

I'm trying to configure puppet to manage logrotate, and decided to
make a definition such as this:

define logrotate(owner = root, group = root, mode = 0644, ensure =
file, size = "1MB", rotate = 5, source) {

 file { "logrotate_file":
        name => "/etc/logrotate.d/$title",
        content => template("logrotate-template.erb")
 }

}

I put this code in logrotate.pp. Next, I added this to the node
configuration:

logrotate { "test003.txt":
          source => "/home/kenneho/logtest.txt"
  }

The logrotate-template.erb file looks like this:

<%= source %> {
    missingok
    notifempty
    size <%= size %>
    rotate <%= rotate %>

}

When executing this configuration on the client I get an error message
saying:
"Tue May 20 13:06:45 +0200 2008 Puppet (err): Could not retrieve
catalog: Failed to parse template logrotate-template.erb: Could not
find value for 'source' at /etc/puppet/manifests/classes/logrotate.pp:
6 on node <node>"

I'm not sure where the error may be. Is it not allowd to call
definitions directly from a node definition? Or must the definition be
included in a class?

Regards,
kenneho


 
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.
Peter Meier  
View profile  
 More options May 20 2008, 8:03 am
From: Peter Meier <peter.me...@immerda.ch>
Date: Tue, 20 May 2008 14:03:28 +0200
Local: Tues, May 20 2008 8:03 am
Subject: Re: [Puppet Users] Getting puppet to manage logrotate
Hi

I rather supsect that your define is broken. If you didn't change your
define by pasting it to the mail, it should be:

define logrotate($owner = root, $group = root, $mode = 0644, $ensure
=file, $size = "1MB", $rotate = 5, $source) { [...] }

this might lead to the actual error you see.

greetings Pete


 
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.
Mike Renfro  
View profile  
 More options May 20 2008, 8:57 am
From: Mike Renfro <ren...@tntech.edu>
Date: Tue, 20 May 2008 07:57:38 -0500
Local: Tues, May 20 2008 8:57 am
Subject: Re: [Puppet Users] Re: Getting puppet to manage logrotate
On 5/20/2008 7:03 AM, Peter Meier wrote:

> I rather supsect that your define is broken. If you didn't change your
> define by pasting it to the mail, it should be:

> define logrotate($owner = root, $group = root, $mode = 0644, $ensure
> =file, $size = "1MB", $rotate = 5, $source) { [...] }

> this might lead to the actual error you see.

Use of 'source' may be an issue, too, or at least odd, since source is
already a built-in file attribute.
http://reductivelabs.com/trac/puppet/wiki/TypeReference#file

--
Mike Renfro  / R&D Engineer, Center for Manufacturing Research,
931 372-3601 / Tennessee Technological University


 
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.
kenneho  
View profile  
 More options May 20 2008, 9:39 am
From: kenneho <kenneho....@gmail.com>
Date: Tue, 20 May 2008 06:39:10 -0700 (PDT)
Local: Tues, May 20 2008 9:39 am
Subject: Re: Getting puppet to manage logrotate

On 20 Mai, 14:03, Peter Meier <peter.me...@immerda.ch> wrote:

> I rather supsect that your define is broken. If you didn't change your
> define by pasting it to the mail, it should be:

> define logrotate($owner = root, $group = root, $mode = 0644, $ensure
> =file, $size = "1MB", $rotate = 5, $source) { [...] }

This solved the problem. I referenced an example (page 52) in
Turnbull's Puppet book, and left out the "$" in the definition. But I
see now that this was incorrect.

In addition, I replaced the use of "source" with something else, just
in case of issues here.

Thanks for the help.

Regards,
kenneho


 
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 »