This is a bash script I use on Red Hat 5 systems.
------------------------------------
#!/bin/bash
# Looking for "!!" in the second field of the user's shadow information
# This says that the password has never been set
rc=`/bin/grep $1 /etc/shadow | awk -F":" '($2 == "!!")' | wc -l`
if [ $rc -eq 0 ]
then
exit 1
else
exit 0
fi
------------------------------------
In my manifest, is this resource:
------------------------------------
exec { "${username}-password":
path => ['/bin','/usr/bin'],
command => "mkpasswd -l 30 -C 5 -d 5 -s 5 ${username}",
require => User[$username],
onlyif => "/etc/puppet/scripts/checkShadow.bash ${username}",
}
----------------------------------------------
"mkpasswd" is a nice little utility in the "expect" package.
Hope this halps
“Sometimes I think the surest sign that intelligent life exists elsewhere in the
universe is that none of it has tried to contact us.” (Bill Waterson: Calvin &
Hobbes)
On Jan 13, 2014, at 12:35 PM, house_mann <[email protected]> wrote:
HI their,
i'm very new to puppet and can't find an solutions to get this up and running...
User creation works well. But when the user "devop" (or all others) change his
password, it will overwrite after next 'puppet-run' to the hardcoded-one.
Correctly, because there is no setup/config to prevent this, when users exists
on the node.
Is there a simple setup for this case? Only set password for non-existing
users!?
Thanks.
ako
--
You received this message because you are subscribed to the Google Groups "Puppet
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/37ce1f08-879f-42d7-9466-c4eda78f8fa4%40me.com.
For more options, visit https://groups.google.com/groups/opt_out.