From: Peter Palfrader Date: Tue, 24 Sep 2019 14:29:29 +0000 (+0200) Subject: Move device name, media type name, and archive device construction to the manifest X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=3bd8e749b9f67f269b6be35438a7b9f34fbd1e02;p=mirror%2Fdsa-puppet.git Move device name, media type name, and archive device construction to the manifest --- diff --git a/modules/bacula/manifests/storage/client.pp b/modules/bacula/manifests/storage/client.pp index 3b03a7598..7aa04287a 100644 --- a/modules/bacula/manifests/storage/client.pp +++ b/modules/bacula/manifests/storage/client.pp @@ -8,6 +8,10 @@ define bacula::storage::client( ) { include bacula::storage + $device_name = "${bacula::storage::filestor_device}-${client}" + $media_type_name = "${bacula::storage::filestor_name}-${client}" + $directory = "${bacula::storage::backup_path}/${client}" + file { "/etc/bacula/storage-conf.d/${client}.conf": content => template('bacula/storage/sd-per-client.conf.erb'), @@ -15,7 +19,7 @@ define bacula::storage::client( group => bacula, notify => Exec['bacula-sd restart-when-idle'], ; - "${bacula::storage::backup_path}/${client}": + $directory: ensure => directory, mode => '0755', owner => bacula, @@ -23,4 +27,3 @@ define bacula::storage::client( ; } } - diff --git a/modules/bacula/templates/storage/sd-per-client.conf.erb b/modules/bacula/templates/storage/sd-per-client.conf.erb index 5d6c769f9..a50cb0eae 100644 --- a/modules/bacula/templates/storage/sd-per-client.conf.erb +++ b/modules/bacula/templates/storage/sd-per-client.conf.erb @@ -4,9 +4,9 @@ ## Device { - Name = "<%= scope['bacula::storage::filestor_device'] %>-<%= @client %>" - Media Type = "<%= scope['bacula::storage::filestor_name'] %>-<%= @client %>" - Archive Device = "<%= scope['bacula::storage::backup_path'] %>/<%= @client %>" + Name = "<%= @device_name %>" + Media Type = "<%= @media_type_name %>" + Archive Device = "<%= @directory %>" LabelMedia = yes; Random Access = Yes; AutomaticMount = yes;