I am creating a user as follow
user { $username:
comment => "$name",
shell => "$shell",
managehome => false,
password => "$password",
groups => $groups
}
Now as u can see I am doing a managehome is false
Now later down the lane I need to push a file to the user’s home directory.
$key = "${homedir}/${name}/file"
file { $key:
ensure => present,
owner => $username,
group => $username,
mode => 600,
content => "$keyvalue",
subscribe => User[$username],
}
How can I get the user’s home directory for this?
Best Answer
Hm, i think there you'll need a facter modul to do that and a little hacky manifest file...
facter module: This will register facter variables for all users. like "home_root" or "home_apache".
and then you can use them inside your manifest file like this:
Perhaps there is a better way, but i'm afraid not.