On Wed, Oct 27, 2010 at 12:53 PM, Jeff McCune <[email protected]> wrote:

> On Wed, Oct 27, 2010 at 2:16 PM, Dan Bode <[email protected]> wrote:
> > From: Dan Bode <[email protected]>
> >
> > I have always been annoyed that special variables for defines and
> hostclasses can not be evaluated as param defaults. Special variables are:
> $name, $title, $module_name.
> >
> > Code example:
> > class x (
> >  foo = $name
> >  ) { notice($name)}
> >
> > should print x, and with my patch, it does.
>
> Do you mean notice($foo) should print x rather than notice($name) ?
>

yes,

also to show a more useful example:

define manage_user (
  $gid = "$name"
) {
  group { $gid:
    ensure => present,
  }
  user { $name:
    gid => $gid,
  }
}
manage_user { 'test':}

-Dan

--
> Jeff McCune
> http://www.puppetlabs.com/
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Developers" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<puppet-dev%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/puppet-dev?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to