From 63888df0233ba7010b312bffd369ebd79acb15a4 Mon Sep 17 00:00:00 2001 From: Keith Whyte Date: Fri, 11 Sep 2020 22:37:40 +0200 Subject: [PATCH] runit: conditionally require class based on osmo_stack hiera --- modules/rhizo_base/manifests/runit.pp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/modules/rhizo_base/manifests/runit.pp b/modules/rhizo_base/manifests/runit.pp index 291a220..14b30d7 100644 --- a/modules/rhizo_base/manifests/runit.pp +++ b/modules/rhizo_base/manifests/runit.pp @@ -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' {