Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm going through the Puppet 'Learning' VM. Here's my manifest:

$ensure_val = 'present'

define student($full_name) {

  user { "${title}":
    ensure => $ensure_val,
    comment => "${full_name}",
    groups => "student",
    home => "/home/${title}",
    name => "${title}",
    password => "${title}",
    shell => "/bin/bash",
  }

}

$students = {
  'elion' => {full_name => "El Lion"},
  'azee' => {full_name => "Avery Zee"}
}

create_resources(student, $students)

When I do a puppet apply manifest.pp, it says that everything is created. I do a cat /etc/shadow and indeed those users are there. But doing an 'ls /home` shows an directory.

The VM is running on Centos 5.7. Is there something wrong with the puppet VM? Or am I doing something wrong in the manifest?

share|improve this question
up vote 3 down vote accepted
  user { "${title}":
    ensure => $ensure_val,
    comment => "${full_name}",
    groups => "student",
    home => "/home/${title}",
    name => "${title}",
    password => "${title}",
    shell => "/bin/bash",
    managehome => true,
  }

Try adding managehome => true to your user resource, it should create the homedirs.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.