Skip to content

Commit

Permalink
Remove shell_config dependency
Browse files Browse the repository at this point in the history
This replaces the `shell_config` resource on Debian-based systems with
an equivalent `augeas` resource.  It also changes it to depend on the
value of the `$svc_enable` variable instead of `$file_ensure`, bringing
it in-line with its purpose.
  • Loading branch information
lamawithonel committed Nov 23, 2015
1 parent 5530876 commit c51abf8
Show file tree
Hide file tree
Showing 5 changed files with 342 additions and 288 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
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 c51abf8

Please sign in to comment.