zedenator wrote:> Hello puppet-users,
>
> I am having trouble getting my manifests to apply with Puppet 0.20.
> Here''s what I''ve got:
>
> I have a generic box class to setup my home environment on a given
> machine. The class is mostly made up of file types, but I also have a
> few methods that include file and package types amongs others. eg:
>
> class box {
> $owner = "owner"
> $group = "group"
> $bg = "white"
> $fg = "black"
>
> define zsh($bg, $fg) {
> package { "zsh":
> name => zsh ,
> ensure => present ,
> provider => freebsd
> }
> file { "zshrc":
> content => template("zshrc.erb") ,
> path => "/home/$owner/.zshrc" ,
> ensure => present ,
> owner => $owner ,
> group => $group ,
> mode => 640
> }
> }
>
> Then I have another class which inherits the above box class and
> overrides some of the methods like this:
>
> class desktop inherits box {
> Zsh {
> bg => "blue" ,
> fg => "white"
> }
> }
Was this supposed to be a default or a call to ''zsh''?
I''m assuming a call.
> This worked fine with previous (0.19.x) versions of puppet, but after
> the upgrade, puppet simply seems to ignore my methods all together. I
> also tried to create methods that dont require overriding, but that
> didnt change a thing.
>
> All stand-alone types (not in a method declaration) work fine and
> puppet does not generate any warnings or errors regarding the methods,
> making me think there is something obvious I am missing.
Ah, I see. Yeah, there appears to be a bug somewhere in the
interpreter; I agree that this is not behaving as expected. I''d be
surprised if this ever worked consistently though -- I don''t think
there''s a place you can call the ''zsh'' definition
that would catch that
default, because subclasses can''t add defaults to objects defined in
their base classes (this is possibly a bug).
I think I know what''s happening, but I''m not positive and I
don''t have
the time to track it down at the moment.
--
Real freedom lies in wildness, not in civilization. -- Charles Lindbergh
---------------------------------------------------------------------
Luke Kanies | http://reductivelabs.com | http://madstop.com