> 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?
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
> 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