On 02/10/2014 09:15 AM, Rafael Cristaldo wrote: > Hi All! > > Has anybody already needed to manage HOMES on desktops computers with > puppet ? > > I have create a class to manage the /etc/skel directory...so the problem is > that after thet the user loggin ... the home has been created em copied all > /etc/skel files.. > > But NOW i need to put another LINK for exemplo.... > > The class create the new LINK at /etc/skel ...but how to create the link > into /home/$USER ??
<trim>
>
> This works fine..but how to create this like a class in PUPPET?
>
> Thanks!!
>
I'm not sure if our use case is similar to yours or not. However, I
added the following to our user management module to ensure that the
user's home directory regardless of how it's created or managed, has all
the appropriate files from the local system's /etc/skel. The 'touch
/dev/null' is so that don't have to do "provider => 'shell'," in the
exec (which we had a reason for at the time, but I'm not recalling it
right now):
#Copy base profile from /etc/skel, update only but make backup if we
happen to overwrite an existing file
#Made as portable as possible because CentOS 5 doesn't support the
'-n' option for cp.
exec {"${username}_copy_skel":
command => "touch /dev/null; for i in `ls -A /etc/skel`; do /bin/cp
-R -u --backup=numbered /etc/skel/\$i ${homedir_real}; done; /bin/chown
-R ${username}:${username} ${homedir_real}",
unless => "test \"\$(j=0;for i in `ls -A /etc/skel`; do test -e
${homedir_real}/\$i; if [ \"\$?\" -ne \"0\" ]; then j=1;fi; done;echo
\$j)\" = \"0\"",
}
It may not be all that efficient for a system that has a lot of users on
it. Hope that helps.
--
Joseph Swick <[email protected]>
Operations Engineer
Meltwater Group
signature.asc
Description: OpenPGP digital signature
