OLD | NEW |
1 class users { | 1 class users { |
2 define user ( | 2 define user ( |
3 $user_name = $title, | 3 $user_name = $title, |
4 $authorized_keys, | 4 $authorized_keys, |
5 $password = undef, | 5 $password = undef, |
6 $sudo = false | 6 $groups = [], |
7 ) { | 7 ) { |
8 user {$user_name: | 8 user {$user_name: |
9 home => "/home/${user_name}", | 9 home => "/home/${user_name}", |
10 shell => "/bin/bash", | 10 shell => "/bin/bash", |
11 managehome => true, | 11 managehome => true, |
12 password => $password, | 12 password => $password, |
13 groups => $sudo ? { | 13 groups => $groups, |
14 true => 'sudo', | |
15 default => undef | |
16 } | |
17 } | 14 } |
18 | 15 |
19 file {"/home/${user_name}/.ssh": | 16 file {"/home/${user_name}/.ssh": |
20 ensure => directory, | 17 ensure => directory, |
21 owner => $user_name, | 18 owner => $user_name, |
22 mode => 0700, | 19 mode => 0700, |
23 require => User[$user_name] | 20 require => User[$user_name] |
24 } | 21 } |
25 | 22 |
26 file {"/home/${user_name}/.ssh/authorized_keys": | 23 file {"/home/${user_name}/.ssh/authorized_keys": |
(...skipping 12 matching lines...) Expand all Loading... |
39 } | 36 } |
40 | 37 |
41 file {'/etc/sudoers.d/puppet': | 38 file {'/etc/sudoers.d/puppet': |
42 ensure => present, | 39 ensure => present, |
43 owner => root, | 40 owner => root, |
44 group => root, | 41 group => root, |
45 mode => 0440, | 42 mode => 0440, |
46 source => 'puppet:///modules/users/sudoers-puppet' | 43 source => 'puppet:///modules/users/sudoers-puppet' |
47 } | 44 } |
48 } | 45 } |
OLD | NEW |