Skip to content

Commit

Permalink
Better support for RedHat smartmontools 6.x.
Browse files Browse the repository at this point in the history
Fixing Fedora support similar to jhoblitt#36.
  • Loading branch information
razorsedge committed Sep 2, 2014
1 parent 71acbcc commit bbcae38
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
6 changes: 5 additions & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@
}
'RedHat': {
$config_file = $::operatingsystem ? {
'Fedora' => '/etc/smartd.conf',
'Fedora' => $::operatingsystemrelease ? {
# 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',
},
default => $::operatingsystemmajrelease ? {
'7' => '/etc/smartmontools/smartd.conf',
default => '/etc/smartd.conf',
Expand Down
21 changes: 16 additions & 5 deletions spec/classes/smartd_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,23 @@
end

describe 'for operatingsystem Fedora' do
let(:facts) {{ :osfamily => 'RedHat', :operatingsystem => 'Fedora', :smartmontools_version => '5.43' }}
describe 'for operatingsystemrelease 18' do
let(:facts) {{ :osfamily => 'RedHat', :operatingsystem => 'Fedora', :operatingsystemrelease => '18', :smartmontools_version => '5.43' }}

it_behaves_like 'default', {}
it { should_not contain_shell_config('start_smartd') }
it { should contain_service('smartd').with_ensure('running').with_enable(true) }
it { should contain_file('/etc/smartd.conf').with_notify('Service[smartd]') }
it_behaves_like 'default', {}
it { should_not contain_shell_config('start_smartd') }
it { should contain_service('smartd').with_ensure('running').with_enable(true) }
it { should contain_file('/etc/smartd.conf').with_notify('Service[smartd]') }
end

describe 'for operatingsystemrelease 19' do
let(:facts) {{ :osfamily => 'RedHat', :operatingsystem => 'Fedora', :operatingsystemrelease => '19', :smartmontools_version => '6.1' }}

it_behaves_like 'default', { :config_file => '/etc/smartmontools/smartd.conf' }
it { should_not contain_shell_config('start_smartd') }
it { should contain_service('smartd').with_ensure('running').with_enable(true) }
it { should contain_file('/etc/smartmontools/smartd.conf').with_notify('Service[smartd]') }
end
end
end

Expand Down

0 comments on commit bbcae38

Please sign in to comment.