Skip to content

Commit

Permalink
Use redhat style init on redhat. Closes #248,#249
Browse files Browse the repository at this point in the history
  • Loading branch information
solarkennedy committed May 28, 2016
1 parent 203ae8b commit 4cd8e44
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
if $consul::init_style {

case $consul::init_style {
'upstart' : {
'upstart': {
file { '/etc/init/consul.conf':
mode => '0444',
owner => 'root',
Expand All @@ -33,7 +33,7 @@
mode => '0755',
}
}
'systemd' : {
'systemd': {
file { '/lib/systemd/system/consul.service':
mode => '0644',
owner => 'root',
Expand All @@ -46,39 +46,39 @@
refreshonly => true,
}
}
'init' : {
'init','redhat': {
file { '/etc/init.d/consul':
mode => '0555',
owner => 'root',
group => 'root',
content => template('consul/consul.init.erb')
}
}
'debian' : {
'debian': {
file { '/etc/init.d/consul':
mode => '0555',
owner => 'root',
group => 'root',
content => template('consul/consul.debian.erb')
}
}
'sles' : {
'sles': {
file { '/etc/init.d/consul':
mode => '0555',
owner => 'root',
group => 'root',
content => template('consul/consul.sles.erb')
}
}
'launchd' : {
'launchd': {
file { '/Library/LaunchDaemons/io.consul.daemon.plist':
mode => '0644',
owner => 'root',
group => 'wheel',
content => template('consul/consul.launchd.erb')
}
}
default : {
default: {
fail("I don't know how to create an init script for style ${consul::init_style}")
}
}
Expand Down
2 changes: 1 addition & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
}
} elsif $::operatingsystem =~ /Scientific|CentOS|RedHat|OracleLinux/ {
if versioncmp($::operatingsystemrelease, '7.0') < 0 {
$init_style = 'init'
$init_style = 'redhat'
} else {
$init_style = 'systemd'
}
Expand Down
2 changes: 1 addition & 1 deletion spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@
:operatingsystemrelease => '6.5'
}}

it { should contain_class('consul').with_init_style('init') }
it { should contain_class('consul').with_init_style('redhat') }
it { should contain_file('/etc/init.d/consul').with_content(/daemon --user=consul/) }
end

Expand Down

0 comments on commit 4cd8e44

Please sign in to comment.