Skip to content

Commit

Permalink
Debian service name is slightly different
Browse files Browse the repository at this point in the history
  • Loading branch information
petems committed Jun 30, 2016
1 parent 7a19bd4 commit 352ba6d
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
5 changes: 3 additions & 2 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@
include ::ipmi::config

class { 'ipmi::service::ipmi':
ensure => $service_ensure,
enable => $enable_ipmi,
ensure => $service_ensure,
enable => $enable_ipmi,
ipmi_service_name => $ipmi::params::ipmi_service_name,
}

class { 'ipmi::service::ipmievd':
Expand Down
4 changes: 4 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
'5': {
$ipmi_package = ['OpenIPMI', 'OpenIPMI-tools']
$config_location = '/etc/sysconfig/ipmi'
$ipmi_service_name = 'ipmi'
}
'6', '7': {
$ipmi_package = ['OpenIPMI', 'ipmitool']
$config_location = '/etc/sysconfig/ipmi'
$ipmi_service_name = 'ipmi'
}
default: {
fail("Module ${module_name} is not supported on operatingsystemmajrelease ${::operatingsystemmajrelease}")
Expand All @@ -24,10 +26,12 @@
'ubuntu': {
$ipmi_package = ['openipmi', 'ipmitool']
$config_location = '/etc/default/openipmi'
$ipmi_service_name = 'openipmi'
}
'debian': {
$ipmi_package = ['openipmi', 'ipmitool']
$config_location = '/etc/default/openipmi'
$ipmi_service_name = 'openipmi'
}
default: {
fail("Module ${module_name} is not supported on operatingsystem ${::operatingsystem}")
Expand Down
3 changes: 2 additions & 1 deletion manifests/service/ipmi.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
class ipmi::service::ipmi (
$ensure = 'running',
$enable = true,
$ipmi_service_name = 'ipmi',
) {
validate_re($ensure, '^running$|^stopped$')
validate_bool($enable)

service{ 'ipmi':
service{ $ipmi_service_name:
ensure => $ensure,
hasstatus => true,
hasrestart => true,
Expand Down
8 changes: 8 additions & 0 deletions spec/classes/ipmi_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
:ensure => 'running',
:enable => true,
})
should contain_service('ipmi').with({
:ensure => 'running',
:enable => true,
})
end
it do
should contain_class('ipmi::service::ipmievd').with({
Expand Down Expand Up @@ -267,6 +271,10 @@
:ensure => 'running',
:enable => true,
})
should contain_service('openipmi').with({
:ensure => 'running',
:enable => true,
})
end
it do
should contain_class('ipmi::service::ipmievd').with({
Expand Down

0 comments on commit 352ba6d

Please sign in to comment.