Hi,

this type of question would be better suited for the puppet-users list.

The problem is that variable values *cannot* be overridden. You just
replace its value in the scope of the inheriting class. Only resources
can be overridden, so that is what you must do.

class generic {
    $message = 'generic'
    notify { 'test': message = $message }
}

class specific inherits generic {
    $message = 'specific'
    Notify['test'] { message => $message }  # <- override
}

Replacing the variable locally is fairly pointless.

class specific inherits generic {
    Notify['test'] { message => 'specific' } # <- exact same result
}

HTH,
Felix

On 10/05/2014 06:01 PM, Олег Сиденко wrote:
> I want to write the following structure: 
>
> class CLASSA {
> $ = "AAA" 
> notify {$:} 
> } 
> class ClassB inherits CLASSA {
> $ = "BBB" 
> } 
>
>
>
> Summoning of nodes 
> class {ClassB:} 
>
> expect to see a BBB notifah but Puppet hard shoves 
> Note: AAA 
> Note: / Stage [main] / Classa / Notify [AAA] / message: defined by
> 'message' as 'AAA' 
>
>
> What am I doing wrong?

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-dev/54319C5C.4010608%40Alumni.TU-Berlin.de.
For more options, visit https://groups.google.com/d/optout.

Reply via email to