|
15 | 15 | $secure_path = '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/puppetlabs/bin:/snap/bin'
|
16 | 16 | }
|
17 | 17 | default: {
|
18 |
| - if (versioncmp($facts['os']['release']['major'], '7') >= 0) or |
19 |
| - ($facts['os']['release']['major'] =~ /\/sid/) or |
20 |
| - ($facts['os']['release']['major'] =~ /Kali/) { |
21 |
| - $content_template = "${content_base}sudoers.debian.erb" |
22 |
| - $secure_path = '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/puppetlabs/bin' |
23 |
| - } else { |
24 |
| - $content_template = "${content_base}sudoers.olddebian.erb" |
25 |
| - $secure_path = undef |
26 |
| - } |
| 18 | + $content_template = "${content_base}sudoers.debian.erb" |
| 19 | + $secure_path = '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/puppetlabs/bin' |
27 | 20 | }
|
28 | 21 | }
|
29 | 22 | $package = 'sudo'
|
|
47 | 40 | # in redhat sudo package is already compiled for ldap support
|
48 | 41 | $package_ldap = $package
|
49 | 42 |
|
50 |
| - # rhel 5.0 to 5.4 use sudo 1.6.9 which does not support |
51 |
| - # includedir, so we have to make sure sudo 1.7 (comes with rhel |
52 |
| - # 5.5) is installed. |
53 |
| - $package_ensure = $facts['os']['release']['full'] ? { |
54 |
| - /^5.[01234]$/ => 'latest', |
55 |
| - default => 'present', |
56 |
| - } |
| 43 | + $package_ensure = 'present' |
57 | 44 | $package_source = undef
|
58 | 45 | $package_admin_file = undef
|
59 | 46 | $config_file = '/etc/sudoers'
|
60 | 47 | $config_dir = '/etc/sudoers.d'
|
61 |
| - case $facts['os']['release']['full'] { |
62 |
| - /^5/: { |
63 |
| - $content_template = "${content_base}sudoers.rhel5.erb" |
64 |
| - $secure_path = undef |
65 |
| - $wheel_config = 'absent' |
66 |
| - } |
67 |
| - /^6/: { |
68 |
| - $content_template = "${content_base}sudoers.rhel6.erb" |
69 |
| - $secure_path = '/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin' |
70 |
| - $wheel_config = 'absent' |
71 |
| - } |
72 |
| - /^7/: { |
73 |
| - $content_template = "${content_base}sudoers.rhel7.erb" |
74 |
| - $secure_path = '/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/puppetlabs/bin' |
75 |
| - $wheel_config = 'password' |
76 |
| - } |
77 |
| - /^8/: { |
78 |
| - $content_template = "${content_base}sudoers.rhel8.erb" |
79 |
| - $secure_path = '/sbin:/bin:/usr/sbin:/usr/bin:/opt/puppetlabs/bin' |
80 |
| - $wheel_config = 'password' |
81 |
| - } |
82 |
| - /^9/: { |
83 |
| - $content_template = "${content_base}sudoers.rhel9.erb" |
84 |
| - $secure_path = '/sbin:/bin:/usr/sbin:/usr/bin:/opt/puppetlabs/bin' |
85 |
| - $wheel_config = 'password' |
| 48 | + $content_template = "${content_base}sudoers.rhel.erb" |
| 49 | + |
| 50 | + case [$facts['os']['name'], $facts['os']['release']['major']] { |
| 51 | + ['Amazon', '2023']: { |
| 52 | + $secure_path = '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/puppetlabs/bin:/var/lib/snapd/snap/bin' |
86 | 53 | }
|
87 | 54 | default: {
|
88 |
| - $content_template = "${content_base}sudoers.rhel9.erb" |
89 |
| - $secure_path = '/sbin:/bin:/usr/sbin:/usr/bin:/opt/puppetlabs/bin' |
90 |
| - $wheel_config = 'password' |
| 55 | + $secure_path = '/sbin:/bin:/usr/sbin:/usr/bin:/opt/puppetlabs/bin' |
91 | 56 | }
|
92 | 57 | }
|
| 58 | + |
| 59 | + $wheel_config = 'password' |
93 | 60 | $config_file_group = 'root'
|
94 | 61 | $config_dir_keepme = false
|
95 | 62 | $package_provider = undef
|
|
204 | 171 | $defaults = {}
|
205 | 172 | }
|
206 | 173 | 'OpenBSD': {
|
207 |
| - if (versioncmp($facts['kernelversion'], '5.8') < 0) { |
208 |
| - $package = undef |
209 |
| - } else { |
210 |
| - $package = 'sudo' |
211 |
| - } |
| 174 | + $package = 'sudo' |
212 | 175 | $package_ldap = undef
|
213 | 176 | $package_ensure = 'present'
|
214 | 177 | $package_source = undef
|
|
290 | 253 | $wheel_config = 'absent'
|
291 | 254 | $defaults = {}
|
292 | 255 | }
|
293 |
| - 'Amazon': { |
294 |
| - $package = 'sudo' |
295 |
| - $package_ldap = $package |
296 |
| - $package_ensure = 'present' |
297 |
| - $package_source = undef |
298 |
| - $package_admin_file = undef |
299 |
| - $config_file = '/etc/sudoers' |
300 |
| - $config_dir = '/etc/sudoers.d' |
301 |
| - case $facts['os']['release']['full'] { |
302 |
| - /^5/: { |
303 |
| - $content_template = "${content_base}sudoers.rhel5.erb" |
304 |
| - $secure_path = undef |
305 |
| - } |
306 |
| - /^6/: { |
307 |
| - $content_template = "${content_base}sudoers.rhel6.erb" |
308 |
| - $secure_path = '/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin' |
309 |
| - } |
310 |
| - default: { |
311 |
| - $content_template = "${content_base}sudoers.rhel6.erb" |
312 |
| - $secure_path = '/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin' |
313 |
| - } |
314 |
| - } |
315 |
| - $config_file_group = 'root' |
316 |
| - $config_dir_keepme = false |
317 |
| - $package_provider = undef |
318 |
| - $wheel_config = 'absent' |
319 |
| - $defaults = {} |
320 |
| - } |
321 | 256 | default: {
|
322 | 257 | fail("Unsupported platform: ${facts['os']['family']}/${facts['os']['name']}")
|
323 | 258 | }
|
|
0 commit comments