OLD | NEW |
| (Empty) |
1 # == Class: adblockplus::sudo | |
2 # | |
3 # Mixin class to ensure super-user privileges can only be acquired through | |
4 # the sudo(8) system daemon. | |
5 # | |
6 # === Parameters: | |
7 # | |
8 # [*ensure*] | |
9 # Whether associated resources are meant to be 'present' or 'absent'. | |
10 # | |
11 # === Examples: | |
12 # | |
13 # class {'adblockplus::sudo': | |
14 # ensure => 'present', | |
15 # } | |
16 # | |
17 class adblockplus::sudo ( | |
18 $ensure = 'present', | |
19 ) { | |
20 | |
21 # https://forge.puppetlabs.com/puppetlabs/stdlib | |
22 include stdlib | |
23 | |
24 # Obligatory despite the package being included with all environments | |
25 ensure_packages(['sudo']) | |
26 | |
27 # User root must not be able to login via password | |
28 ensure_resource('user', 'root', {'password' => '*'}) | |
29 | |
30 # The root account must not be accessible directly via SSH | |
31 file {'/root/.ssh/authorized_keys': | |
32 ensure => 'absent', | |
33 } | |
34 | |
35 # Prerequisite for the accompanying kick.py and run.py scripts | |
36 file {'/etc/sudoers.d/puppet': | |
37 ensure => $ensure, | |
38 group => 'root', | |
39 mode => 0440, | |
40 owner => 'root', | |
41 require => Package['sudo'], | |
42 source => 'puppet:///modules/adblockplus/sudoers/puppet' | |
43 } | |
44 } | |
OLD | NEW |