diff --git a/README.md b/README.md index 6f94162..b268369 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ Usage devicescan => true, devicescan_options => '-H -m admin@example.com', devices => [ '/dev/sg1', '/dev/sg2' ], - device_opts => { '/dev/sg1' => '-o on -S on -a', '/dev/sg2' => '-o on -S on -a' }, + device_options => { '/dev/sg1' => '-o on -S on -a', '/dev/sg2' => '-o on -S on -a' }, mail_to => 'root', warning_schedule => 'diminishing', } diff --git a/manifests/init.pp b/manifests/init.pp index b202d56..90a8af7 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -69,7 +69,7 @@ # # defaults to: [] # -# [*device_opts*] +# [*device_options*] # Hash. # # List of options to pass to a specific device. Eg. @@ -110,7 +110,7 @@ $devicescan = $smartd::params::devicescan, $devicescan_options = $smartd::params::devicescan_options, $devices = $smartd::params::devices, - $device_opts = $smartd::params::device_opts, + $device_options = $smartd::params::device_options, $mail_to = $smartd::params::mail_to, $warning_schedule = $smartd::params::warning_schedule, ) inherits smartd::params { @@ -122,7 +122,7 @@ validate_bool($devicescan) validate_string($devicescan_options) validate_array($devices) - validate_hash($device_opts) + validate_hash($device_options) validate_string($mail_to) validate_re($warning_schedule, '^daily$|^once$|^diminishing$', '$warning_schedule must be either daily, once, or diminishing.') diff --git a/manifests/params.pp b/manifests/params.pp index 29a4c3c..0c02c0c 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -19,7 +19,7 @@ $devicescan = true $devicescan_options = undef $devices = [] - $device_opts = {} + $device_options = {} $mail_to = 'root' $warning_schedule = 'daily' # other choices: once, diminishing diff --git a/spec/classes/smartd_spec.rb b/spec/classes/smartd_spec.rb index 2e6f055..3445d46 100644 --- a/spec/classes/smartd_spec.rb +++ b/spec/classes/smartd_spec.rb @@ -221,10 +221,10 @@ end end - describe 'device_opts => "{ /dev/sg1 => -o on -S on -a, /dev/sg2 => -o on -S on -a }"' do + describe 'device_options => "{ /dev/sg1 => -o on -S on -a, /dev/sg2 => -o on -S on -a }"' do let :params do { :devices => [ '/dev/sg1', '/dev/sg2', ], - :device_opts => { '/dev/sg1' => '-o on -S on -a', '/dev/sg2' => '-o on -S on -a' } + :device_options => { '/dev/sg1' => '-o on -S on -a', '/dev/sg2' => '-o on -S on -a' } } end @@ -308,7 +308,7 @@ end let(:params) do { - :device_opts => { 'megaraid' => '-I 194'}, + :device_options => { 'megaraid' => '-I 194'}, } end diff --git a/templates/smartd.conf b/templates/smartd.conf index 9f81ab7..ceb780d 100644 --- a/templates/smartd.conf +++ b/templates/smartd.conf @@ -2,7 +2,7 @@ DEFAULT -m <%= @mail_to %> -M <%= @warning_schedule %> <% @devices.each do |device| -%> <%= device -%> -<% if @device_opts.has_key?(device) -%> <%= @device_opts[device] %><% end %> +<% if @device_options.has_key?(device) -%> <%= @device_options[device] %><% end %> <% end -%> <% # it doesn't matter which megaraid block device we use to poll as long as all @@ -16,7 +16,7 @@ if megaraid_device and megaraid_device != '' and @megaraid_adapters and @megaraid_adapters.to_i > 0 @megaraid_physical_drives.split(/,/).sort.each do |drive| -%> <%= megaraid_device %> -d sat+megaraid,<%= drive.to_i -%> -<% if @device_opts.has_key?('megaraid') %> <%= @device_opts['megaraid'] %><% end %> +<% if @device_options.has_key?('megaraid') %> <%= @device_options['megaraid'] %><% end %> <% end -%> <% end -%> <% if @devicescan -%>