From 0286f81bbd9a89548d821a564190e29f54d12b00 Mon Sep 17 00:00:00 2001 From: Gregory Ballantine Date: Sun, 2 Apr 2023 15:30:41 -0400 Subject: [PATCH] Fixed some style errors found with puppet-lint --- manifests/config.pp | 8 +++----- manifests/init.pp | 9 +++------ manifests/install.pp | 14 +++++--------- manifests/params.pp | 4 ++-- 4 files changed, 13 insertions(+), 22 deletions(-) diff --git a/manifests/config.pp b/manifests/config.pp index c02d286..29ee95a 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -2,10 +2,8 @@ # # Manages the nslcd server configuration file # -class nslcd::config inherits nslcd -{ - file - { +class nslcd::config inherits nslcd { + file { $nslcd::config: ensure => file, owner => $nslcd::config_user, @@ -13,4 +11,4 @@ class nslcd::config inherits nslcd mode => $nslcd::config_mode, content => template('nslcd/nslcd.erb'), } -} \ No newline at end of file +} diff --git a/manifests/init.pp b/manifests/init.pp index 0c0146f..f81dec9 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -98,8 +98,7 @@ # Sets the time after which the LDAP server is considered to be permanently unavailable. # Once this time is reached retries will be done only once per this time period. # -class nslcd -( +class nslcd ( Variant[Boolean,String[1]] $package_ensure = 'present', String[1] $package_name = $nslcd::params::package_name, Boolean $package_manage = true, @@ -131,13 +130,11 @@ class nslcd Optional[Integer] $idle_timelimit = undef, Integer $reconnect_sleeptime = 1, Integer $reconnect_retrytime = 10, -) -inherits nslcd::params -{ +) inherits nslcd::params { contain nslcd::install contain nslcd::config contain nslcd::service - + Class['nslcd::install'] -> Class['nslcd::config'] ~> Class['nslcd::service'] diff --git a/manifests/install.pp b/manifests/install.pp index 7008902..a4ef11b 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -2,14 +2,10 @@ # # Installs the nslcd package. # -class nslcd::install inherits nslcd -{ - if $nslcd::package_manage - { - package - { - $nslcd::package_name: - ensure => $nslcd::package_ensure, +class nslcd::install inherits nslcd { + if $nslcd::package_manage { + package { $nslcd::package_name: + ensure => $nslcd::package_ensure, } } -} \ No newline at end of file +} diff --git a/manifests/params.pp b/manifests/params.pp index 46d3696..397074c 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -3,7 +3,7 @@ # Sets the default parameters for the nslcd class. # class nslcd::params { - case $::osfamily { + case $facts['os']['family'] { 'Debian': { $package_name = 'nslcd' $gid = 'nslcd' @@ -26,7 +26,7 @@ class nslcd::params { $config_mode = '0600' } default: { - fail("The ${module_name} module is not supported on an ${::osfamily} based system.") + fail("The ${module_name} module is not supported on an ${facts['os']['family']} based system.") } } }