On 12/23/2010 12:42 AM, Jonathan Barber wrote: > 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
That issue is similar, but the problem here is related more strongly to http://projects.puppetlabs.com/issues/5259 So I have to say - hopefully this is *not* going to be possible any time soon. > 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), > } > } I agree with this completely. Cheers, Felix -- 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.
