O'Reilly logo
  • Bill O'Neill thinks this is interesting:

class user::virtual { define user_dotfile($user) { $source = regsubst($name, "^/home/${user}/.(.*)$", "puppet:///modules/user/${user}-\\1") file { $name: source => $source, owner => $user, group => $user, } } define ssh_user($key,$dotfile='') { user { $name: ensure => present, managehome => true, shell => '/bin/bash', } file { "/home/${name}/.ssh": ensure => directory, mode => '0700', owner => $name, } ssh_authorized_key { "${name}_key": key => $key, type => 'ssh-rsa', user => $name, require => File["/home/${name}/.ssh"], } if $dotfile { $fi...

From

Cover of Puppet 3 Cookbook

Note

Manage user's dotfiles in puppet