runit: conditionally require class based on osmo_stack hiera

This commit is contained in:
Keith Whyte 2020-09-11 22:37:40 +02:00
parent 2ac7e16908
commit 63888df023

View file

@ -12,6 +12,8 @@
#
class rhizo_base::runit {
$osmo_stack = $rhizo_base::osmo_stack
file { '/lib/systemd/system/runit.service':
ensure => present,
source => 'puppet:///modules/rhizo_base/systemd/runit.service',
@ -26,11 +28,16 @@ class rhizo_base::runit {
require => Class['rhizo_base::packages'],
}
$_req = $osmo_stack ? {
'split' => File['/etc/sv'],
'nitb' => [ File['/etc/sv'], Class['rhizo_base::openbsc'] ],
default => [ File['/etc/sv'], Class['rhizo_base::openbsc'] ],
}
file { '/etc/service/osmo-nitb':
ensure => link,
target => '/etc/sv/osmo-nitb',
require =>
[ File['/etc/sv'], Class['rhizo_base::openbsc'] ],
require => $_req,
}
if $operatingsystem != 'Debian' {