Skip to content

Commit

Permalink
restart services on init script or package action
Browse files Browse the repository at this point in the history
  • Loading branch information
jfryman committed Sep 19, 2015
1 parent cc105d6 commit 291a001
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions manifests/profile/server.pp
Expand Up @@ -305,12 +305,15 @@
}

if $_ng_init {
$_package_map = $::st2::params::component_map

file { '/etc/init/st2actionrunner.conf':
ensure => present,
owner => 'root',
group => 'root',
mode => '0444',
source => 'puppet:///modules/st2/etc/init/st2actionrunner.conf',
notify => Service['st2actionrunner'],
}

# Spin up any number of workers as needed
Expand All @@ -323,6 +326,10 @@
hasstatus => true,
hasrestart => true,
provider => 'upstart',
subscribe => [
Package[$_package_map['actionrunner']],
Package['st2common'],
],
}

if $auth and $manage_st2auth_service {
Expand All @@ -332,6 +339,7 @@
group => 'root',
mode => '0444',
source => 'puppet:///modules/st2/etc/init/st2auth.conf',
notify => Service['st2auth'],
}

service { 'st2auth':
Expand All @@ -340,6 +348,10 @@
hasstatus => true,
hasrestart => true,
provider => 'upstart',
subscribe => [
Package[$_package_map['auth']],
Package['st2common'],
],
}
}

Expand All @@ -350,6 +362,7 @@
group => 'root',
mode => '0444',
source => 'puppet:///modules/st2/etc/init/st2api.conf',
notify => Service['st2api'],
}

service { 'st2api':
Expand All @@ -358,6 +371,10 @@
hasstatus => true,
hasrestart => true,
provider => 'upstart',
subscribe => [
Package[$_package_map['api']],
Package['st2common'],
],
}
}

Expand All @@ -367,6 +384,7 @@
group => 'root',
mode => '0444',
source => 'puppet:///modules/st2/etc/init/st2resultstracker.conf',
notify => Service['st2resultstracker'],
}

service { 'st2resultstracker':
Expand All @@ -375,6 +393,10 @@
hasstatus => true,
hasrestart => true,
provider => 'upstart',
subscribe => [
Package[$_package_map['resultstracker']],
Package['st2common'],
],
}

file { '/etc/init/st2sensorcontainer.conf':
Expand All @@ -383,6 +405,7 @@
group => 'root',
mode => '0444',
source => 'puppet:///modules/st2/etc/init/st2sensorcontainer.conf',
notify => Service['st2sensorcontainer'],
}

service { 'st2sensorcontainer':
Expand All @@ -391,6 +414,10 @@
hasstatus => true,
hasrestart => true,
provider => 'upstart',
subscribe => [
Package[$_package_map['sensorcontainer']],
Package['st2common'],
],
}

file { '/etc/init/st2notifier.conf':
Expand All @@ -399,6 +426,7 @@
group => 'root',
mode => '0444',
source => 'puppet:///modules/st2/etc/init/st2notifier.conf',
notify => Service['st2notifier'],
}

service { 'st2notifier':
Expand All @@ -407,6 +435,10 @@
hasstatus => true,
hasrestart => true,
provider => 'upstart',
subscribe => [
Package[$_package_map['notifier']],
Package['st2common'],
],
}

file { '/etc/init/st2rulesengine.conf':
Expand All @@ -415,6 +447,7 @@
group => 'root',
mode => '0444',
source => 'puppet:///modules/st2/etc/init/st2rulesengine.conf',
notify => Service['st2rulesengine'],
}

service { 'st2rulesengine':
Expand All @@ -423,6 +456,10 @@
hasstatus => true,
hasrestart => true,
provider => 'upstart',
subscribe => [
Package[$_package_map['rulesengine']],
Package['st2common'],
],
}

if $manage_st2web_service {
Expand Down Expand Up @@ -453,6 +490,7 @@
-> Service<| tag == 'st2::profile::server' |>

Service<| tag == 'st2::profile::server' |> -> St2::Pack<||>

} else {
## Needs to have real init scripts
exec { 'start st2':
Expand Down

0 comments on commit 291a001

Please sign in to comment.