I''ve been trying to get a puppet-master config together to push selected user accounts to puppet clients, but I''ve not been able to figure out how to pull their password and other data out of the password database on the server side to replicate to the clients. In short I want to do something like: user { $username: ... password => "ypmatch $username passwd | cut -f 2 -d :", ... } but that runs the "ypmatch" on the client, which isn''t useful. Then I found the "generate" function, but apparently "generate" can be called with only one argument (spaces are excluded from the characters "generate" will take). I tried: user { $username: ... password => generate("/path/getuserpasswd.sh $username"), ... } but that gets an error due to the space (getuserpaswd.sh is just a shell script that does the ypmatch expecting $1 to be the username). So in short, is there any way to do this? Using shell-like syntax I want: user { $username: ... password => `ypmatch $username passwd | cut -f 2 -d :`, ... } Any help would be most appreciated. -Jeff -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/32QVodx6mB4J. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On 01/18/2013 08:33 PM, Jeff Thomas wrote:> but that runs the "ypmatch" on the client, which isn''t useful. Then I > found the "generate" function, but apparently "generate" can be called > with only one argument (spaces are excluded from the characters > "generate" will take). I tried: > > user { $username: > ... > password => generate("/path/getuserpasswd.sh $username"), > ... > } > > but that gets an error due to the space (getuserpaswd.sh is just a shell > script that does the ypmatch expecting $1 to be the username).Have you tried: password => generate(''/path/getuserpasswd.sh'', $username), -- Jakov Sosic www.srce.unizg.hr -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Well, I thought I had, but apparently not. Yes that works, thanks. -Jeff On Saturday, January 19, 2013 4:54:21 AM UTC-8, Jakov Sosic wrote:> > On 01/18/2013 08:33 PM, Jeff Thomas wrote: > > but that runs the "ypmatch" on the client, which isn''t useful. Then I > > found the "generate" function, but apparently "generate" can be called > > with only one argument (spaces are excluded from the characters > > "generate" will take). I tried: > > > > user { $username: > > ... > > password => generate("/path/getuserpasswd.sh $username"), > > ... > > } > > > > but that gets an error due to the space (getuserpaswd.sh is just a shell > > script that does the ypmatch expecting $1 to be the username). > > Have you tried: > > password => generate(''/path/getuserpasswd.sh'', $username), > > > > -- > Jakov Sosic > www.srce.unizg.hr >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/q9OS_R1Q0bkJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.