diff options
Diffstat (limited to 'modules/base_installation/manifests/users.pp')
-rw-r--r-- | modules/base_installation/manifests/users.pp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/modules/base_installation/manifests/users.pp b/modules/base_installation/manifests/users.pp index 766c0f0..f893c51 100644 --- a/modules/base_installation/manifests/users.pp +++ b/modules/base_installation/manifests/users.pp | |||
@@ -26,22 +26,26 @@ class base_installation::users ( | |||
26 | ensure => "present", | 26 | ensure => "present", |
27 | groups => $user[groups], | 27 | groups => $user[groups], |
28 | managehome => true, | 28 | managehome => true, |
29 | system => !!$user[system], | ||
29 | home => "/home/${user[username]}", | 30 | home => "/home/${user[username]}", |
30 | notify => Exec["remove_password"], | 31 | notify => Exec["remove_password:${user[username]}:${user[userid]}"], |
31 | purge_ssh_keys => true | 32 | purge_ssh_keys => true |
32 | } | 33 | } |
33 | 34 | ||
34 | exec { "remove_password": | 35 | exec { "remove_password:${user[username]}:${user[userid]}": |
35 | command => "/usr/bin/chage -d 0 ${user[username]} && /usr/bin/passwd -d ${user[username]}", | 36 | command => "/usr/bin/chage -d 0 ${user[username]} && /usr/bin/passwd -d ${user[username]}", |
37 | onlyif => "/usr/bin/test -z '${user[password]}'", | ||
36 | refreshonly => true | 38 | refreshonly => true |
37 | } | 39 | } |
38 | 40 | ||
39 | $user[keys].each |$key| { | 41 | if has_key($user, "keys") { |
40 | ssh_authorized_key { "${user[username]}@${key[host]}": | 42 | $user[keys].each |$key| { |
41 | name => "${user[username]}@${key[host]}", | 43 | ssh_authorized_key { "${user[username]}@${key[host]}": |
42 | user => $user[username], | 44 | name => "${user[username]}@${key[host]}", |
43 | type => $key[key_type], | 45 | user => $user[username], |
44 | key => $key[key], | 46 | type => $key[key_type], |
47 | key => $key[key], | ||
48 | } | ||
45 | } | 49 | } |
46 | } | 50 | } |
47 | } | 51 | } |