On Dec 28 2010, 12:31 pm, cyrus <matthewcer...@gmail.com> wrote:
> Are definitions inherited?
>
> By that I mean I have the following:
>
> class main {
>
>     ....
>
>     define luser (....) {
>         ... some code ...
>     }
>
>     ....
>
> }
>
> class inetd inherits main {
>
>      /* call luser definition */
>      luser {
>           $name:
>           ....
>      }
>
> }
>
> But Puppet complains
>
> err: Could not retrieve catalog from remote server: Error 400 on
> SERVER: Puppet::Parser::AST::Resource failed with error ArgumentError:
> Invalid resource type luser.
>
> I know this definition works since I can call it directly from within
> the class main. I even tried calling luser using main::luser but same
> error.

You could also try using ::main::luser, and perhaps even changing
"main" to something with less potential for name collision.  Better,
however, would probably be to move luser to the top level of your
module's init.pp (you are using modules, right?).

Resolution of the definition name aside, it is unlikely that "inetd
inherits main" is what you want.  It can work, but unless class inetd
is overriding properties of resources defined in class main then what
you want is probably

class inetd {
    include "main"
}

that is, unless you are using resource overrides, you should "include"
classes instead of ineriting them.

All things considered, however, I suspect that what you *really* want
is

class main {
    include "inetd"
}


Best,

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