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?
Try adding managehome => true to your user resource, it should create the homedirs.