From 91259d8d44b9568967cc7773f203a7f108e4512c Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Sat, 24 Feb 2018 09:59:30 +0100 Subject: [PATCH] collect backup client list in a plain text file --- modules/bacula/manifests/client.pp | 8 ++++++++ modules/bacula/manifests/director.pp | 9 +++++++++ modules/bacula/manifests/init.pp | 3 +++ 3 files changed, 20 insertions(+) diff --git a/modules/bacula/manifests/client.pp b/modules/bacula/manifests/client.pp index d016e0d0d..f8f83f202 100644 --- a/modules/bacula/manifests/client.pp +++ b/modules/bacula/manifests/client.pp @@ -82,4 +82,12 @@ class bacula::client inherits bacula { # description => 'Allow bacula access from storage and director', # rule => "proto tcp mod state state (NEW) dport (bacula-fd) saddr (${bacula_director_ip6}) ACCEPT", #} + + @@concat::fragment { "bacula-dsa-client-list::$fqdn": + target => $bacula::bacula_dsa_client_list , + content => @("EOF"), + ${fqdn} + | EOF + tag => $bacula::tag_bacula_dsa_client_list, + } } diff --git a/modules/bacula/manifests/director.pp b/modules/bacula/manifests/director.pp index 13e759528..1ca830a1d 100644 --- a/modules/bacula/manifests/director.pp +++ b/modules/bacula/manifests/director.pp @@ -97,4 +97,13 @@ class bacula::director inherits bacula { @daily root chronic /etc/bacula/scripts/volumes-delete-old -v | EOF } + + concat { $bacula::bacula_dsa_client_list: + } + concat::fragment { 'bacula-dsa-client-list::header' : + target => $bacula::bacula_dsa_client_list, + content => "", + order => '00', + } + Concat::Fragment <<| tag == $bacula::tag_bacula_dsa_client_list |>> } diff --git a/modules/bacula/manifests/init.pp b/modules/bacula/manifests/init.pp index c536a948b..aa0c9de54 100644 --- a/modules/bacula/manifests/init.pp +++ b/modules/bacula/manifests/init.pp @@ -34,6 +34,9 @@ class bacula { $bacula_ssl_server_cert = '/etc/ssl/debian/certs/thishost-server.crt' $bacula_ssl_server_key = '/etc/ssl/private/thishost-server.key' + $bacula_dsa_client_list = '/etc/bacula/dsa-clients' + $tag_bacula_dsa_client_list = "bacula::dsa::clientlist" + file { '/usr/local/sbin/bacula-idle-restart': mode => '0555', content => template('bacula/bacula-idle-restart.erb'), -- 2.20.1