From 4cd8e443d9bc854312702943c2fe8d7e9082b27c Mon Sep 17 00:00:00 2001 From: Kyle Anderson Date: Fri, 27 May 2016 21:38:16 -0700 Subject: [PATCH] Use redhat style init on redhat. Closes #248,#249 --- manifests/config.pp | 14 +++++++------- manifests/params.pp | 2 +- spec/classes/init_spec.rb | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/manifests/config.pp b/manifests/config.pp index 0e178b54..9bcf6048 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -18,7 +18,7 @@ if $consul::init_style { case $consul::init_style { - 'upstart' : { + 'upstart': { file { '/etc/init/consul.conf': mode => '0444', owner => 'root', @@ -33,7 +33,7 @@ mode => '0755', } } - 'systemd' : { + 'systemd': { file { '/lib/systemd/system/consul.service': mode => '0644', owner => 'root', @@ -46,7 +46,7 @@ refreshonly => true, } } - 'init' : { + 'init','redhat': { file { '/etc/init.d/consul': mode => '0555', owner => 'root', @@ -54,7 +54,7 @@ content => template('consul/consul.init.erb') } } - 'debian' : { + 'debian': { file { '/etc/init.d/consul': mode => '0555', owner => 'root', @@ -62,7 +62,7 @@ content => template('consul/consul.debian.erb') } } - 'sles' : { + 'sles': { file { '/etc/init.d/consul': mode => '0555', owner => 'root', @@ -70,7 +70,7 @@ content => template('consul/consul.sles.erb') } } - 'launchd' : { + 'launchd': { file { '/Library/LaunchDaemons/io.consul.daemon.plist': mode => '0644', owner => 'root', @@ -78,7 +78,7 @@ content => template('consul/consul.launchd.erb') } } - default : { + default: { fail("I don't know how to create an init script for style ${consul::init_style}") } } diff --git a/manifests/params.pp b/manifests/params.pp index b6446c55..a774dff0 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -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' } diff --git a/spec/classes/init_spec.rb b/spec/classes/init_spec.rb index 1b47483b..88b5915e 100644 --- a/spec/classes/init_spec.rb +++ b/spec/classes/init_spec.rb @@ -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