Luke Kanies wrote:
> Appending and overriding attributes can only be done in subclasses,  
> not in the same scope that the attribute is set.
> 
> I'm not actually convinced this makes a ton of sense in the current  
> parser, now that I think of it, though...
> 

FWIW, the following does not appear to work (inside a module called 
mail, it's manifests/init.pp):

class mail {
     mailalias { "root":
         ensure => absent,
         notify => Exec["newaliases"]
     }

     exec { "newaliases":
         command => "newaliases",
         refreshonly => true
     }

     class aliases inherits mail {

         define root ( $enable = true, $recipient = [ ] ) {
             Mailalias["root"] {
                 enable => $enable ? {
                     false => absent,
                     default => present
                 },
                 recipient +> $recipient
             }
         }
     }
}

(Note how by default it sets the root mailalias to absent, which is 
equivalent to the default "#root: marc" line in /etc/aliases)

I deliberately used a subclass "mail::aliases" because changing a 
parameter to a type within the same scope doesn't work; I wanted to use 
something like the following to set the root mail alias:

node 'node1.domain.tld' {
     include mail::aliases
     mail::aliases::root { "$fqdn":
         enable => true,
         recipient => [ "[EMAIL PROTECTED]" ]
     }
}

But it does not appear to work either; the error message is something 
like "Only subclasses can override ...".

Dunno whether this is expected behavour though?

Kind regards,

Jeroen van Meeuwen
-kanarip

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to