diff --git a/modules/rhizo_base/manifests/init.pp b/modules/rhizo_base/manifests/init.pp index f5851d3..bce4ea8 100644 --- a/modules/rhizo_base/manifests/init.pp +++ b/modules/rhizo_base/manifests/init.pp @@ -263,7 +263,8 @@ schedule { 'repo': notify => [ Exec['locale-gen'], Exec['notify-freeswitch'], Exec['restart-rapi'], - Exec['restart-smpp'] ], + Exec['restart-smpp'], + Exec['restart-esme'] ], } vcsrepo { '/var/meas_web': @@ -351,6 +352,10 @@ schedule { 'repo': refreshonly => true, } + exec { 'restart-esme': + command => '/usr/bin/sv restart esme', + refreshonly => true, + } if $operatingsystem == 'Ubuntu' { file { '/var/lib/locales/supported.d/local': diff --git a/modules/rhizo_base/manifests/runit.pp b/modules/rhizo_base/manifests/runit.pp index 9ad4c5e..741049c 100644 --- a/modules/rhizo_base/manifests/runit.pp +++ b/modules/rhizo_base/manifests/runit.pp @@ -11,6 +11,9 @@ # Sample Usage: # class rhizo_base::runit { + + $use_kannel = $rhizo_base::use_kannel + file { '/etc/sv': ensure => directory, source => 'puppet:///modules/rhizo_base/etc/sv', @@ -25,6 +28,12 @@ class rhizo_base::runit { source => 'puppet:///modules/rhizo_base/osmo-nitb.run.kannel', require => File['/etc/sv'], } + + service { 'kannel': + enable => true, + require => Package['kannel'], + notify => [ Exec['stop-esme'], Exec['start-kannel'] ], + } } if $use_kannel == 'no' { @@ -39,6 +48,13 @@ class rhizo_base::runit { ensure => link, target => '/etc/sv/esme', require => File['/etc/sv'], + notify => [ Exec['stop-kannel'], Exec['start-esme'] ], + } + + exec { 'disable-kannel': + notify => Exec['stop-kannel'], + command => '/usr/sbin/update-rc.d kannel disable', + require => Package['kannel'], } } @@ -88,4 +104,23 @@ class rhizo_base::runit { require => [ File['/etc/sv'], Package['websocketd'] ], } - } \ No newline at end of file + exec { 'start-esme': + command => '/usr/bin/sv start esme', + refreshonly => true, + } + + exec { 'stop-esme': + command => '/usr/bin/sv stop esme', + refreshonly => true, + } + + exec { 'start-kannel': + command => '/etc/init.d/kannel start', + refreshonly => true, + } + + exec { 'stop-kannel': + command => '/etc/init.d/kannel stop', + refreshonly => true, + } + }