It is reasonably common to want to create home directories automatically when creating a user account, but at least as common to want to avoid removing them when removing a user. I see that the type reference appears to suggest that "managehome => true" would produce both behaviors, but that is not consistent with historic Puppet behavior, which is to provide only homedir creation, not removal. I don't know whether the docs are misleading, whether Puppet is buggy in this regard, or whether you're using a different version than is described by the current docs.
If you want to work around this issue, you can wrap your User declarations in a defined type that provides the desired behavior. A minimalistic version might look something like this:
modules/user/manifests/hosted_user.pp:
----------------------------------------------------------
define user::hosted_user ($ensure = 'present') {
$homedir = "/home/${name}"
user { "${name}":
ensure => "${ensure}",
home => "${homedir}",
managehome => true
}
if "${ensure}" == 'absent' {
file { "${homedir}":
ensure => absent,
recurse => true,
require => User["${name}"]
}
}
}
------
You could then use it like so:
user::hosted_user { 'eduardo': ensure => absent }
For real-world use you would probably want additional parameters, etc.
John