Skip to content

Commit

Permalink
Remove legacy facts.
Browse files Browse the repository at this point in the history
  • Loading branch information
bschonec committed Feb 24, 2025
1 parent cbf0838 commit ee3b2bc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
1 change: 0 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@
Optional[Variant[String, Array]] $sudoers = $nsswitch::params::sudoers_default,
Stdlib::Unixpath $file_path = '/etc/nsswitch.conf'
) inherits nsswitch::params {

file { 'nsswitch.conf':
ensure => file,
path => $file_path,
Expand Down
11 changes: 6 additions & 5 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@
# operatingsystem being used.
#
class nsswitch::params {
case $facts['operatingsystem'] {
case $facts['os']['name'] {
/AlmaLinux|CentOS|RedHat|Rocky|Amazon|OEL|OracleLinux|Scientific|CloudLinux/: {
if versioncmp($facts[operatingsystemmajrelease], '6') > 0 {
if versioncmp($facts['os']['release']['major'], '6') > 0 {
$passwd_default = ['files','sss']
$shadow_default = ['files','sss']
$group_default = ['files','sss']
$automount_default = ['files']

$services_default = ['files','sss']
$netgroup_default = ['files','sss']
}else{
}
else {
$passwd_default = ['files']
$shadow_default = ['files']
$group_default = ['files']
Expand Down Expand Up @@ -46,7 +47,7 @@
$group_default = ['files']
$gshadow_default = undef
$hosts_default = ['files',
'mdns4_minimal [NOTFOUND=return]',
'mdns4_minimal [NOTFOUND=return]',
'dns']
$netgroup_default = ['nisplus']
$netmasks_default = ['files']
Expand Down Expand Up @@ -208,7 +209,7 @@
$sudoers_default = undef
}
default: {
fail("${facts['operatingsystem']} is not a supported operating system.")
fail("${facts['os']['name']} is not a supported operating system.")
}
}
}

0 comments on commit ee3b2bc

Please sign in to comment.