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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to