summaryrefslogtreecommitdiffstats
path: root/modules/conf
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2018-11-15 23:44:28 -0500
committerJesse Luehrs <doy@tozt.net>2018-11-15 23:44:28 -0500
commitb7fae4bde557809f0ea9bc6552e1932afd857d63 (patch)
tree2eb73bb2069cfaa55e04ca3354c32acc42e69cc5 /modules/conf
parent08318e4bb85b5e4afca1886c9c7482f02460f12f (diff)
downloadpuppet-tozt-b7fae4bde557809f0ea9bc6552e1932afd857d63.tar.gz
puppet-tozt-b7fae4bde557809f0ea9bc6552e1932afd857d63.zip
simplify home directory handling
Diffstat (limited to 'modules/conf')
-rw-r--r--modules/conf/manifests/user.pp24
1 files changed, 9 insertions, 15 deletions
diff --git a/modules/conf/manifests/user.pp b/modules/conf/manifests/user.pp
index 564f121..4ca2f02 100644
--- a/modules/conf/manifests/user.pp
+++ b/modules/conf/manifests/user.pp
@@ -1,11 +1,5 @@
-define conf::user($user=$name, $home=undef) {
- $_home = $home ? {
- undef => $user ? {
- 'root' => '/root',
- default => "/home/$user",
- },
- default => $home,
- }
+define conf::user($user=$name) {
+ $home = base::home($user)
include conf
@@ -21,11 +15,11 @@ define conf::user($user=$name, $home=undef) {
exec { "git clone doy/conf for $user":
command => "/usr/bin/git clone git://github.com/doy/conf",
user => $user,
- cwd => $_home,
- creates => "$_home/conf",
+ cwd => $home,
+ creates => "$home/conf",
require => [
User[$user],
- File[$_home],
+ File[$home],
Class['git'],
];
}
@@ -33,12 +27,12 @@ define conf::user($user=$name, $home=undef) {
exec { "conf make install for $user":
command => "/usr/bin/make install",
user => $user,
- cwd => "$_home/conf",
+ cwd => "$home/conf",
environment => [
- "HOME=$_home",
- "PWD=$_home/conf",
+ "HOME=$home",
+ "PWD=$home/conf",
],
- creates => "$_home/.vimrc",
+ creates => "$home/.vimrc",
require => [
Class['cron'],
Class['c_toolchain'],