Managing users' customization files

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

You can add this to your Puppet-based user management by modifying the user::virtual::ssh_user class, so that it can optionally include any dotfiles that are present in the Puppet repository.

How to do it…

  1. Modify the user::virtual class as follows:
    class user::virtual { define user_dotfile( $username ) { file { "/home/${username}/.${name}": source => "puppet:///modules/user/${username}-${name}", owner => $username, group => $username, } } define ssh_user( ...

Get Puppet 2.7 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.