The Right Way(tm) to change password hashes on FreeBSD with Puppet
April 5, 2011 by brd · 3 Comments
Describing what I really wanted to happen a coworker of mine, Andrew Hust, was able to help me write up the ruby to get it done. So without further delay:
http://freebsd.so14k.com/puppet/pw_managespasswords.diff
I will be sending this to the FreeBSD puppet port maintainer and submitting it as a patch to the port soon. I wanted to get it out there so we could get some feedback.
Update: See the new patch I posted in the comments.
Just a minor nit: wouldn’t getting passwords be a bit more generic (not to mention portable, which is somewhat irrelevant in this situation) using getent(1)? Something like “getent passwd #{@resource[:name]}” ?
That is a good idea. We created a new patch with your suggestions.. See:
http://freebsd.so14k.com/puppet/pw_managespasswords2.diff
The patch was committed as part of this update to 2.6.7:
http://lists.freebsd.org/pipermail/cvs-ports/2011-April/215351.html