Let's say I'm administering an Ubuntu setup with multiple users for my organization.
We have a standard .bash_profile
and .bashrc
with aliases, prompt settings, PATH
declarations, etc... that we want all users to use. When a server is spun up it will be initialized with chef, which will be used to install these dotfiles on the system.
What's the best way to go about doing this? I see a few options, but they all have their downsides -
Install them under
/etc
(e.g./etc/profile
).Pros: Every user will read from this system-wide location. Cons: It overwrites any existing version of those flies that come pre-installed. We could always copy those into ours to begin with, but then we have to update and maintain them. May not be a problem depending on how often versions of Ubuntu end up changing the default dotfilesInstall them under
/etc
, but with another names (e.g./etc/bash_configs
) and then append a line to the stockprofile
andbashrc
files to source our new files. Pros: It will also work and our settings will be sources. Cons: Seems really hack, and relies on programmatically appending a line to the end of the stock files tosource
our additional custom files.Install them under
/etc/skel
so that every time a new user is created, those templates will get copied to their home directory. Pros: Each user will get their copy of the files correctly. Cons: What if we update the files, will they get updated in each individual directory? I'm guessing now. It would be better if there a way to symlink the files so all users point to the same files.
I might be over-complicating it, but it just feels like there has to be a cleaner way to do this that I'm missing. I'd be most interested in if there's a way to implement #3 with some sort of auto-update mechanism.
Thanks!