OLD | NEW |
| (Empty) |
1 class users { | |
2 define user ( | |
3 $user_name = $title, | |
4 $authorized_keys, | |
5 $password = undef, | |
6 $groups = [], | |
7 ) { | |
8 user {$user_name: | |
9 home => "/home/${user_name}", | |
10 shell => "/bin/bash", | |
11 managehome => true, | |
12 password => $password, | |
13 groups => $groups, | |
14 } | |
15 | |
16 file {"/home/${user_name}/.ssh": | |
17 ensure => directory, | |
18 owner => $user_name, | |
19 mode => 0700, | |
20 require => User[$user_name] | |
21 } | |
22 | |
23 file {"/home/${user_name}/.ssh/authorized_keys": | |
24 ensure => present, | |
25 owner => $user_name, | |
26 content => $authorized_keys | |
27 } | |
28 } | |
29 | |
30 user {'root': | |
31 password => '*' | |
32 } | |
33 | |
34 file {'/root/.ssh/authorized_keys': | |
35 ensure => absent | |
36 } | |
37 | |
38 file {'/etc/sudoers.d/puppet': | |
39 ensure => present, | |
40 owner => root, | |
41 group => root, | |
42 mode => 0440, | |
43 source => 'puppet:///modules/users/sudoers-puppet' | |
44 } | |
45 } | |
OLD | NEW |