O'Reilly logo

Puppet 3 Cookbook by John Arundel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Managing users' customization files

Users, like cats, often feel the need to mark their territory. Unlike most cats, though, users tend to customize their shell environments, terminal colors, aliases, and so forth. This is usually achieved by a number of dotfiles in their home directory, for example, .bash_profile or .emacs.

You can use Puppet to synchronize and update each user's dotfiles across a number of machines by extending the virtual user setup we've developed throughout this chapter.

How to do it…

Here's what you need to do:

  1. Modify the modules/user/manifests/virtual.pp file as follows:
    class user::virtual { define user_dotfile($user) { $source = regsubst($name, "^/home/${user}/.(.*)$", "puppet:///modules/user/${user}-\\1") file { $name: source ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required