Skip to content

Commit

Permalink
rename mdadm param config_options -> config_file_options
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua Hoblitt committed May 20, 2014
1 parent 844aade commit 73a1f8c
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 20 deletions.
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ include ::mdadm
```puppet
# defaults
class { '::mdadm':
config_file_manage => true,
config_options => {},
force_service => false,
service_ensure => 'running',
service_enable => true,
raid_check_options => {},
config_file_manage => true,
config_file_options => {},
force_service => false,
service_ensure => 'running',
service_enable => true,
raid_check_options => {},
}
```

Expand All @@ -69,10 +69,13 @@ class { '::mdadm':

Enables/disables management of the `mdadm.conf` configuration file.

##### `config_options`
##### `config_file_options`

`Hash` defaults to '{}'

Keyword/value pairs to be set in the `mdadm.conf` configuration file.
Currently, `mailaddr` is the only supported key.

##### `force_service`

`Bool` defaults to `false`
Expand Down
16 changes: 8 additions & 8 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
# documentation.
#
class mdadm(
$config_file_manage = $::mdadm::params::config_file_manage,
$config_options = {},
$force_service = false,
$service_ensure = 'running',
$service_enable = true,
$raid_check_options = {},
$config_file_manage = $::mdadm::params::config_file_manage,
$config_file_options = {},
$force_service = false,
$service_ensure = 'running',
$service_enable = true,
$raid_check_options = {},
) inherits mdadm::params {
validate_bool($config_file_manage)
validate_hash($config_options)
validate_hash($config_file_options)
validate_bool($force_service)
validate_re($service_ensure, '^running$|^stopped$')
validate_bool($service_enable)
Expand All @@ -36,7 +36,7 @@
if $config_file_manage {
Package[$mdadm::params::mdadm_package] ->
class { 'mdadm::config':
options => $config_options,
options => $config_file_options,
} ->
Class['mdadm::mdmonitor']
}
Expand Down
10 changes: 5 additions & 5 deletions spec/unit/classes/mdadm_config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
it { should_not contain_augeas('mdadm.conf mailaddr') }
end

# config_file_manage should have no visiable behavior without config_options
# config_file_manage should have no visiable behavior without config_file_options
context 'config_file_manage =>' do
context 'true' do
let(:params) {{ :config_file_manage => true }}
Expand All @@ -36,15 +36,15 @@
end
end # config_file_manage =>

context 'config_options =>' do
context 'config_file_options =>' do
context '{}' do
let(:params) {{ :config_options => {}}}
let(:params) {{ :config_file_options => {}}}

it { should_not contain_augeas('mdadm.conf mailaddr') }
end

context '{ mailaddr => foo }' do
let(:params) {{ :config_options => { 'mailaddr' => 'foo' } }}
let(:params) {{ :config_file_options => { 'mailaddr' => 'foo' } }}

it { should contain_augeas('mdadm.conf mailaddr') }

Expand Down Expand Up @@ -82,7 +82,7 @@
end # { mailaddr => foo }

context 'undef' do
let(:params) {{ :config_options => nil }}
let(:params) {{ :config_file_options => nil }}

it 'should fail' do
expect { should }.to raise_error(/is not a Hash/)
Expand Down

0 comments on commit 73a1f8c

Please sign in to comment.