From ee3b2bcd363485a482466153abac9e664e2ef41b Mon Sep 17 00:00:00 2001 From: Brian Schonecker Date: Tue, 2 Jul 2024 14:22:16 -0400 Subject: [PATCH] Remove legacy facts. --- manifests/init.pp | 1 - manifests/params.pp | 11 ++++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 2a8fcb8..1d8f335 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -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, diff --git a/manifests/params.pp b/manifests/params.pp index ce19084..ef5f5d0 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -3,9 +3,9 @@ # 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'] @@ -13,7 +13,8 @@ $services_default = ['files','sss'] $netgroup_default = ['files','sss'] - }else{ + } + else { $passwd_default = ['files'] $shadow_default = ['files'] $group_default = ['files'] @@ -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'] @@ -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.") } } }