On 22 December 2010 19:38, deet <[email protected]> wrote:
>  Hello good people.
>  Env: puppet 2.6.4, facter 1.5.8
>
>  I'm trying to set a variable in a defaults resource like this.  In
> the password attribute I set the $name variable which I hoped would be
> the the user name.   I can see now that this evaluates to the class
> name.   Are their any other approaches to get the variable to evaluate
> to the user name.  I tried using an inline template and qualifying the
> variable but couldn't get the user name.  I figured it was an error in
> my inline template.

You can't do this at the moment, hopefully in the future you will be able to:
http://projects.puppetlabs.com/issues/5061

For now, you have to create a define to wrap the user in (untested):
define my_user {
  user { $name:
    ...
    password => generate('/site/bin/grabass.rb', '-u', $name),
  }
}

>  User {
>    password_min_age => "7",
>    password_max_age => "90",
>    password         => generate('/site/bin/grabass.rb', '-u',
> "$name"),
>  }
>
>  TIA.   deet.
-- 
Jonathan Barber <[email protected]>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" 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-users?hl=en.

Reply via email to