A collection of task oriented solutions in Puppet

 

Create a home directory for managed users

Challenge

You've added a user with puppet but its home directory was not created

Solution

class add_user {

  user { 'mcfakey':
    ensure     => 'present',
    managehome => true,
  }

}

Explanation

When you create a user puppet does not automatically create its home directory, because not all the providers support this functionality. If your systems provider can handle home directories (which you can check in the manages_homedir column of the user provider features table , and most Linux systems can, you can tell puppet to create the users home directory by specifying managehome => true.

See also