remove duplicate code between linux and freebsd
now everything is managed through parameters we still don't install the package on platforms other than freebsd and linux to respect the current policy, so this actually is just a refactoring
This commit is contained in:
parent
92073a7370
commit
6b8fb05ac9
4 changed files with 23 additions and 37 deletions
|
@ -1,18 +0,0 @@
|
|||
class sudo::base {
|
||||
if $sudo::deploy_sudoers {
|
||||
file {
|
||||
$sudo::path:
|
||||
source => [ "puppet:///modules/site_sudo/sudoers/${::fqdn}/sudoers",
|
||||
"puppet:///modules/site_sudo/sudoers/sudoers",
|
||||
"puppet:///modules/sudo/sudoers/${::operatingsystem}/sudoers",
|
||||
"puppet:///modules/sudo/sudoers/sudoers" ],
|
||||
owner => root, group => 0, mode => 0440;
|
||||
}
|
||||
}
|
||||
file {
|
||||
$sudo::dir:
|
||||
ensure => directory,
|
||||
owner => root, group => 0, mode => 0550;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
class sudo::freebsd inherits sudo::base {
|
||||
package{'sudo':
|
||||
ensure => installed,
|
||||
}
|
||||
}
|
|
@ -8,8 +8,28 @@ class sudo(
|
|||
$dir = $sudo::params::dir
|
||||
) inherits sudo::params {
|
||||
case $::kernel {
|
||||
linux: { include sudo::linux }
|
||||
freebsd: { include sudo::freebsd }
|
||||
default: { include sudo::base }
|
||||
# XXX: why don't we install the package everywhere?
|
||||
linux,freebsd: {
|
||||
package {'sudo':
|
||||
ensure => installed,
|
||||
}
|
||||
}
|
||||
}
|
||||
if $sudo::deploy_sudoers {
|
||||
file {
|
||||
$sudo::path:
|
||||
source => [ "puppet:///modules/site_sudo/sudoers/${::fqdn}/sudoers",
|
||||
"puppet:///modules/site_sudo/sudoers/sudoers",
|
||||
"puppet:///modules/sudo/sudoers/${::operatingsystem}/sudoers",
|
||||
"puppet:///modules/sudo/sudoers/sudoers" ],
|
||||
require => Package['sudo'],
|
||||
owner => root, group => 0, mode => 0440;
|
||||
}
|
||||
}
|
||||
file {
|
||||
$sudo::dir:
|
||||
ensure => directory,
|
||||
require => Package['sudo'],
|
||||
owner => root, group => 0, mode => 0550;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
class sudo::linux inherits sudo::base {
|
||||
package{'sudo':
|
||||
ensure => installed,
|
||||
}
|
||||
|
||||
if $sudo_deploy_sudoers {
|
||||
File['/etc/sudoers']{
|
||||
require => Package['sudo'],
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue