Skip to content

Commit

Permalink
fix puppet-lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoblitt committed Jun 23, 2023
1 parent be0fc05 commit 0c043fd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ fixtures:
repositories:
stdlib:
repo: 'https://github.com/puppetlabs/puppetlabs-stdlib.git'
ref: '4.6.0'
ref: 'v8.6.0'
6 changes: 3 additions & 3 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
validate_array($devices)
validate_string($mail_to)
validate_re($warning_schedule, '^daily$|^once$|^diminishing$|^exec$',
'$warning_schedule must be either daily, once, diminishing, or exec.')
'$warning_schedule must be either daily, once, diminishing, or exec.')
if $warning_schedule == 'exec' {
if $exec_script == false {
fail('$exec_script must be set when $warning_schedule is set to exec.')
Expand Down Expand Up @@ -194,15 +194,15 @@
file { $config_file:
ensure => $file_ensure,
owner => 'root',
group => $::gid,
group => fact('identity.group'),
mode => '0644',
content => template('smartd/smartd.conf'),
require => Package[$package_name],
}

# Special sauce for Debian where it's not enough for the rc script
# to be enabled, it also needs its own extra special config file.
if $::osfamily == 'Debian' {
if fact('os.family') == 'Debian' {
$debian_augeas_changes = $svc_enable ? {
false => 'remove start_smartd',
default => 'set start_smartd "yes"',
Expand Down
14 changes: 7 additions & 7 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
$exec_script = false
$default_options = undef

$version_string = $::smartmontools_version ? {
$version_string = fact('smartmontools_version') ? {
undef => '0.0',
default => $::smartmontools_version,
default => fact('smartmontools_version'),
}

# smartd.conf < 5.43 does not support the 'DEFAULT' directive
Expand All @@ -36,20 +36,20 @@
$enable_default = false
}

case $::osfamily {
case fact('os.family') {
'FreeBSD': {
$config_file = '/usr/local/etc/smartd.conf'
$service_name = 'smartd'
}
'RedHat': {
$config_file = $::operatingsystem ? {
$config_file = fact('os.name') ? {
# lint:ignore:80chars
'Fedora' => $::operatingsystemrelease ? {
'Fedora' => fact('os.release.full') ? {
# No, I am not going to support versions 1-9.
/10|11|12|13|14|15|16|17|18/ => '/etc/smartd.conf',
default => '/etc/smartmontools/smartd.conf',
},
/RedHat|CentOS|Scientific|SLC|OracleLinux|OEL|Rocky/ => $::operatingsystemmajrelease ? {
/RedHat|CentOS|Scientific|SLC|OracleLinux|OEL|Rocky/ => fact('os.release.major') ? {
/4|5|6/ => '/etc/smartd.conf',
default => '/etc/smartmontools/smartd.conf',
},
Expand All @@ -67,7 +67,7 @@
$service_name = 'smartmontools'
}
default: {
fail("Module ${module_name} is not supported on ${::operatingsystem}")
fail("Module ${module_name} is not supported on fact('os.name')}")
}
}
}

0 comments on commit 0c043fd

Please sign in to comment.