Skip to content

Commit

Permalink
Merge pull request jhoblitt#47 from lamawithonel/pr46_remove_shell_co…
Browse files Browse the repository at this point in the history
…nfig

Remove shell_config dependency
  • Loading branch information
jhoblitt committed Nov 24, 2015
2 parents c6f5f18 + c51abf8 commit 468b608
Show file tree
Hide file tree
Showing 6 changed files with 348 additions and 289 deletions.
1 change: 0 additions & 1 deletion .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@ fixtures:
stdlib:
repo: 'https://github.com/puppetlabs/puppetlabs-stdlib.git'
ref: '4.6.0'
shell_config: 'https://github.com/jhoblitt/shell_config.git'
symlinks:
smartd: "#{source_dir}"
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ The module includes a facter plugin to identify drives hiding behind an LSI
MegaRAID/Dell PERC/Supermicro controller on Linux systems if you have the LSI
proprietary `MegaCli` tool installed; we don't have any FreeBSD machines with
this controller so haven't written the necessary code to use FreeBSD's standard
`mfiutil(8)` utility instead. The `shell_config` module is required to edit a
Debian-specific configuration file; other OS families do not require it.
`mfiutil(8)` utility instead.

Currently, drives behind an LSI MegaRAID controller will be automatically
probed and added to the `smartd` configuration file, if the `MegaCli` utility
Expand Down
14 changes: 9 additions & 5 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,15 @@
# 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' {
shell_config { 'start_smartd':
ensure => $file_ensure,
file => '/etc/default/smartmontools',
key => 'start_smartd',
value => 'yes',
$debian_augeas_changes = $svc_enable ? {
false => 'remove start_smartd',
default => 'set start_smartd "yes"',
}

augeas { 'shell_config_start_smartd':
lens => 'Shellvars.lns',
incl => '/etc/default/smartmontools',
changes => $debian_augeas_changes,
before => Service[$service_name],
require => Package[$package_name],
}
Expand Down
7 changes: 6 additions & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,13 @@
$warning_schedule = 'daily' # other choices: once, diminishing
$default_options = undef

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

# smartd.conf < 5.43 does not support the 'DEFAULT' directive
if versioncmp($::smartmontools_version, '5.43') >= 0 {
if versioncmp($version_string, '5.43') >= 0 {
$enable_default = true
} else {
$enable_default = false
Expand Down
3 changes: 1 addition & 2 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
{ "operatingsystem": "FreeBSD" }
],
"dependencies": [
{ "name": "puppetlabs/stdlib", "version_requirement": ">= 4.6.0 < 5.0.0" },
{ "name": "csail/shell_config", "version_requirement": ">= 0.0.1" }
{ "name": "puppetlabs/stdlib", "version_requirement": ">= 4.6.0 < 5.0.0" }
]
}
Loading

0 comments on commit 468b608

Please sign in to comment.