Skip to content

Commit 750d378

Browse files
committed
Merge pull request 'fix: include common::system::authentication::sudo class to satisfy the require which calls the profile part' (#1373) from fix/remove-sudoers-class-invocation into master
Reviewed-on: https://gitea.obmondo.com/EnableIT/LinuxAid/pulls/1373
2 parents c6086f3 + b4f1925 commit 750d378

File tree

4 files changed

+5
-22
lines changed

4 files changed

+5
-22
lines changed

modules/enableit/common/manifests/setup.pp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
Stdlib::Absolutepath $__opt_dir = '/opt/obmondo',
1818
Stdlib::Absolutepath $__bin_dir = '/opt/obmondo/bin',
1919
) {
20-
2120
# Create Obmondo group for exporter to run under this group
2221
group { 'obmondo':
2322
ensure => present,
@@ -27,8 +26,8 @@
2726

2827
file {
2928
default:
30-
ensure => ensure_dir($::obmondo_monitor), #lint:ignore:top_scope_facts
31-
noop => $noop_value,
29+
ensure => ensure_dir($::obmondo_monitor), #lint:ignore:top_scope_facts
30+
noop => $noop_value,
3231
;
3332

3433
[
@@ -38,6 +37,7 @@
3837
"${__opt_dir}/home",
3938
"${__opt_dir}/share",
4039
"${__opt_dir}/etc",
40+
"${__conf_dir}/sudoers.d",
4141
]:
4242
;
4343
}

modules/enableit/eit_users/manifests/user.pp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
Array[Eit_types::Ssh_pubkey] $ssh_authorized_keys = [],
1717
Eit_types::Noop_Value $noop_value = undef,
1818
) {
19-
2019
# Make sure we don't try to set the homedir of root to `/home/root`, unless
2120
# the $home parameter is set
2221
$_homedir = pick($home, $name ? {

modules/enableit/profile/manifests/system/sudoers.pp

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,8 @@
44
Eit_types::Sudoers $sudoers = $common::system::authentication::sudo::sudoers,
55
Stdlib::Absolutepath $sudoers_d_dir = $common::system::authentication::sudo::sudoers_d_dir,
66
) {
7-
87
contain sudo::params
98

10-
# Setup the directory
11-
file { $sudoers_d_dir :
12-
ensure => directory,
13-
purge => true,
14-
recurse => true,
15-
noop => false,
16-
before => Class['sudo'],
17-
}
18-
199
# Some files in sudoers have wrong permissions, which can cause the execution
2010
# of `visudo -c` to fail. If this happens then sudoers rules won't be
2111
# installed, even if they're perfectly valid and the error only happens
@@ -33,7 +23,7 @@
3323
$_sudoedit_paths = [
3424
'/bin/sudoedit',
3525
'/usr/bin/sudoedit',
36-
]
26+
]
3727

3828
Package {
3929
noop => false,

modules/enableit/profile/manifests/system/sudoers/conf.pp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
Optional[String] $template = undef,
99
Eit_types::Noop_Value $noop_value = undef,
1010
) {
11-
12-
include profile::system::sudoers
13-
1411
$sudoers_d_dir = lookup('common::system::authentication::sudo::sudoers_d_dir', Stdlib::Absolutepath, 'first', '/etc/obmondo/sudoers.d')
1512

1613
$_sudo_conf_name = safe_string($name)
@@ -21,9 +18,7 @@
2118
}
2219

2320
if (!$content or $content.size == 0) and !$source {
24-
fail("Broken sudoers rule; content is empty! as well as no source file has been provided
25-
name: ${name}
26-
")
21+
fail("Broken sudoers rule; content is empty! as well as no source file has been provided name: ${name}")
2722
}
2823

2924
sudo::conf { $_sudo_conf_name:
@@ -36,5 +31,4 @@
3631
noop => $noop_value,
3732
require => File[$sudoers_d_dir],
3833
}
39-
4034
}

0 commit comments

Comments
 (0)