On Dec 1, 9:19 am, Peter Berghold <salty.cowd...@gmail.com> wrote:
> Here is a module layout:
>
> tomcat
> |-- facter
> |-- files
> |   `-- cleanTomcatLogs.pl
> |-- lib
> |   `-- puppet
> |       |-- parser
> |       |-- provider
> |       `-- type
> |-- manifests
> |   |-- classes
> |   |-- defines
> |   |-- init.pp
> |   |-- scripts
> |   |   `-- cleanlogs.pp
> |   `-- scripts.pp
> `-- templates
>
> the content of the init.pp is such:
> class tomcat {
>         notify {"class tomcat":}
>
> }
>
> This class is a placeholder for a much more complete class later on.
>
> I have a class tomcat::scripts such that:
>
> class tomcat::scripts {
>
> }
>
> which is another placeholder, but the real meat of all this (for now) is:
>
> class tomcat::scripts::cleanlogs inherits tomcat::scripts {
>         @file {
>                 clean-tomcat-logs-script:
>                         path=>"/usr/local/sbin/cleanTomcatLogs.pl",
>
> source=>"puppet://puppet/modules/tomcat/cleanTomcatLogs.pl",
>                         owner => root, group=> root, mode => 0755,
>         }
>
>         realize File[clean-tomcat-logs-script]
>
>         cron {
>                 clean-tomcat-logs-crontab:
>                         minute => 15,
>                         hour => 23,
>                         command => "/usr/local/sbin/cleanTomcatLogs.pl"
>         }
>
> }
>
> which is the tomcat/manifests/scripts/cleanlogs.pp
>
> I have a pair of nodes that use this, I'll pick the lesser complicated of
> the two:
>
> node "chicweb1.chi.sharkrivertech.com" {
>         include tomcat::scripts::cleanlogs
>
> }
>
> Whenpuppet agent is run we get:
>
> ]# puppetd --test
> err: Could not retrieve catalog from remote server: Error 400 on SERVER:
> Could not find class tomcat::scripts::cleanlogs for
> chicweb1.chi.sharkrivertech.com at
> /etc/puppet/manifests/nodes/chicweb1.pp:2 on node
> chicweb1.chi.sharkrivertech.com
> warning: Not using cache on failed catalog
> err: Could not retrieve catalog; skipping run
>
> So.. what gives?   Unless my aged tired weak eyes are missing a typo, this
> should work... no?
>
> Thoughts?


It looks like it should work.  Is the master's log any more
illuminating than the client's?

Does it work if you remove "inherits tomcat::scripts"?  In principle
that shouldn't be a problem, but perhaps there's a bug in that area.
Moreover, inheritance doesn't appear to be what you want anyway, for
the subclass is not overriding any of the superclass's resource
properties.  It looks like you really want that class to "include
'tomcat::scripts'" instead, but even that can be omitted if, as
currently, tomcat::scripts::cleanlogs doesn't depend on anything in
tomcat::scripts.


John

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

Reply via email to