Skip to content

Commit

Permalink
Merge pull request #18 from Wellspring-Worldwide/rk-20160425-better-r…
Browse files Browse the repository at this point in the history
…edhat-support

Redhat systems need to use 'redhat', not 'init'
  • Loading branch information
salimane committed May 23, 2016
2 parents 9b12f25 + dc8f535 commit 7bf9fec
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
12 changes: 12 additions & 0 deletions manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,18 @@
notify => Service['marathon']
}
}
'redhat' : {
file { 'marathon-conf':
ensure => file,
path => '/etc/init.d/marathon',
owner => $real_user,
group => $real_group,
mode => '0755',
content => template('marathon/marathon.sysv.erb'),
before => Service['marathon'],
notify => Service['marathon']
}
}
default : {
fail("I don't know how to create an init script \
for style ${marathon::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 @@ -16,7 +16,7 @@
default => undef
},
/CentOS|RedHat|OracleLinux/ => $::operatingsystemmajrelease ? {
/(4|5|6)/ => 'sysv',
/(4|5|6)/ => 'redhat',
default => 'systemd',
},
'Fedora' => $::operatingsystemmajrelease ? {
Expand Down
4 changes: 4 additions & 0 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
:ensure => 'file',
:path => '/etc/init.d/marathon'
}) }

it { should contain_service('marathon').with({
:provider => 'redhat'
}) }
end

if operatingsystem == 'Fedora'
Expand Down

0 comments on commit 7bf9fec

Please sign in to comment.