From 0d03fa1079842ae23ad85de4d3b806e2cf1d9f22 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Sun, 8 Sep 2019 12:48:59 +0200 Subject: [PATCH] do bacula backups iff we do not include the bacula::not_a_client class --- modules/bacula/manifests/client.pp | 3 +-- modules/roles/manifests/init.pp | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/bacula/manifests/client.pp b/modules/bacula/manifests/client.pp index ba0127f86..f3443e37f 100644 --- a/modules/bacula/manifests/client.pp +++ b/modules/bacula/manifests/client.pp @@ -3,8 +3,7 @@ # this mostly configures the file daemon, but also firewall rules and # fragments to sent to the other servers. class bacula::client( - Enum['present', 'absent'] $ensure = getfromhash($site::nodeinfo, 'not-bacula-client') ? { true => 'absent', default => 'present' }, - # Enum['present', 'absent'] $ensure = defined(Class["bacula::not_a_client"]) ? { true => 'absent', default => 'present' }, + Enum['present', 'absent'] $ensure = defined(Class["bacula::not_a_client"]) ? { true => 'absent', default => 'present' }, ) inherits bacula { $package_ensure = $ensure ? { 'present' => 'installed', 'absent' => 'purged' } $service_ensure = $ensure ? { 'present' => 'running', 'absent' => 'stopped' } diff --git a/modules/roles/manifests/init.pp b/modules/roles/manifests/init.pp index 6ab0e974d..87cf8e265 100644 --- a/modules/roles/manifests/init.pp +++ b/modules/roles/manifests/init.pp @@ -7,6 +7,10 @@ # include roles # class roles { + if getfromhash($site::nodeinfo, 'not-bacula-client') { + include bacula::not_a_client + } + if has_role('muninmaster') { include munin::master } -- 2.20.1