On Fri, Dec 10, 2010 at 11:31:18AM +0100, Arnau Bria wrote:
> Hi all,
> 
> We'd like to share a class, and do something like:
> 
> class common_defaults {
> [...]
>      user { 'root':
>            ensure          => present,
>            password        => $root_password ? {
>               'serviceA'    => 'passwdA',
>               default   => 'passwdB',
>      },
> [...]
> }
> 
> $root_passwd  only has value if someone has defined it. So, i.e:
> 
> nodes.pp 
> nodea {
>       $root_passwd=serviceA
>       include common_defaults
> }
> 
> nodeb {
>       include common_defaults
> }
> 

Maybe its just a typo in your mail, but you set $root_passwd and test
$root_password.

> When I run the client in nodeb, and add a notify of root_password, I see
> that nodeb's root_password has a value and it's serviceA!?!?

This can happen when you have set the var in top scope (nodes.pp
directly or in site.pp) or you have some missing bracket somewhere and
your nodedefinition still works magically while scope is totally mixed up
(happened to me a few times)

-Stefan

Attachment: pgpO3eYLkW4Qd.pgp
Description: PGP signature

Reply via email to