From 0ce45e927f7b37fa7d8dde25b260748d26fd31ef Mon Sep 17 00:00:00 2001 From: Pierre Bouchez Date: Thu, 18 Apr 2024 13:09:07 -0400 Subject: [PATCH 1/3] Allow multiple sto devices, max concurrent jobs conf --- templates/bareos-dir/storage/storage.conf.j2 | 4 +++- templates/bareos-sd/device/device.conf.j2 | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/templates/bareos-dir/storage/storage.conf.j2 b/templates/bareos-dir/storage/storage.conf.j2 index a868a26..d7e60e0 100644 --- a/templates/bareos-dir/storage/storage.conf.j2 +++ b/templates/bareos-dir/storage/storage.conf.j2 @@ -4,6 +4,8 @@ Storage { Address = "{{ item.bareos_dir_ip }}" Password = "{{ bareos_storage_password }}" Media Type = {{ item.media_type | default('File') }} +{% for dev in item.device %} Device = {{ item.device }} - Maximum Concurrent Jobs = 50 +{% endfor %} + Maximum Concurrent Jobs = {{ item.conc_jobs | default('50') }} } diff --git a/templates/bareos-sd/device/device.conf.j2 b/templates/bareos-sd/device/device.conf.j2 index 4403bb4..0a13065 100644 --- a/templates/bareos-sd/device/device.conf.j2 +++ b/templates/bareos-sd/device/device.conf.j2 @@ -8,5 +8,5 @@ Device { AutomaticMount = yes; # when device opened, read it RemovableMedia = no; AlwaysOpen = no; - Maximum Concurrent Jobs = 50 + Maximum Concurrent Jobs = {{ item.conc_jobs | default('50') }} } From ccd980c861c5f9d931037f4f197d9afe5e4f17e7 Mon Sep 17 00:00:00 2001 From: Pierre Bouchez Date: Thu, 18 Apr 2024 15:05:38 -0400 Subject: [PATCH 2/3] Fix string issue, rename concurrent jobs var --- templates/bareos-dir/storage/storage.conf.j2 | 10 +++++++--- templates/bareos-sd/device/device.conf.j2 | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/templates/bareos-dir/storage/storage.conf.j2 b/templates/bareos-dir/storage/storage.conf.j2 index d7e60e0..185f1b4 100644 --- a/templates/bareos-dir/storage/storage.conf.j2 +++ b/templates/bareos-dir/storage/storage.conf.j2 @@ -4,8 +4,12 @@ Storage { Address = "{{ item.bareos_dir_ip }}" Password = "{{ bareos_storage_password }}" Media Type = {{ item.media_type | default('File') }} -{% for dev in item.device %} - Device = {{ item.device }} +{% if item.devices is defined %} +{% for device in item.devices %} + Device = {{ device }} {% endfor %} - Maximum Concurrent Jobs = {{ item.conc_jobs | default('50') }} +{% else %} + Device = {{ item.device }} +{% endif %} + Maximum Concurrent Jobs = {{ item.maximum_concurrent_jobs | default('50') }} } diff --git a/templates/bareos-sd/device/device.conf.j2 b/templates/bareos-sd/device/device.conf.j2 index 0a13065..21460fc 100644 --- a/templates/bareos-sd/device/device.conf.j2 +++ b/templates/bareos-sd/device/device.conf.j2 @@ -8,5 +8,5 @@ Device { AutomaticMount = yes; # when device opened, read it RemovableMedia = no; AlwaysOpen = no; - Maximum Concurrent Jobs = {{ item.conc_jobs | default('50') }} + Maximum Concurrent Jobs = {{ item.maximum_concurrent_jobs | default('50') }} } From 5095326363410ba81033d0d1f88e1476483827b8 Mon Sep 17 00:00:00 2001 From: Pierre Bouchez Date: Fri, 19 Apr 2024 11:36:13 -0400 Subject: [PATCH 3/3] Rename max concurrent jobs var, modify readme --- README.md | 13 +++++++++++++ templates/bareos-dir/storage/storage.conf.j2 | 2 +- templates/bareos-sd/device/device.conf.j2 | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e7699fc..2b7702b 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,18 @@ bareos_dir_storage: device: FileStorageFoo bareos_dir_ip: 10.0.0.1 media_type: File2 # optional, defaults to 'File' + max_concurrent_jobs: 42 # optional, defaults to '50' +``` +`device` can also become `devices` if you have multiple devices : +``` +bareos_dir_storage: + - name: FileFoo + devices: + - FileStorageFoo + - FileStorageBar + bareos_dir_ip: 10.0.0.1 + media_type: File2 # optional, defaults to 'File' + max_concurrent_jobs: 42 # optional, defaults to '50' ``` `bareos_devices`: List of devices in following format: @@ -99,6 +111,7 @@ bareos_devices: opts: '' # optional, for ansible.posix.mount state: 'mounted' # default, for ansible.posix.mount media_type: File2 # optional, defaults to 'File' + max_concurrent_jobs: 42 # optional, defaults to '50' ``` > [!WARNING] diff --git a/templates/bareos-dir/storage/storage.conf.j2 b/templates/bareos-dir/storage/storage.conf.j2 index 185f1b4..cea7f4b 100644 --- a/templates/bareos-dir/storage/storage.conf.j2 +++ b/templates/bareos-dir/storage/storage.conf.j2 @@ -11,5 +11,5 @@ Storage { {% else %} Device = {{ item.device }} {% endif %} - Maximum Concurrent Jobs = {{ item.maximum_concurrent_jobs | default('50') }} + Maximum Concurrent Jobs = {{ item.max_concurrent_jobs | default('50') }} } diff --git a/templates/bareos-sd/device/device.conf.j2 b/templates/bareos-sd/device/device.conf.j2 index 21460fc..1f7dab4 100644 --- a/templates/bareos-sd/device/device.conf.j2 +++ b/templates/bareos-sd/device/device.conf.j2 @@ -8,5 +8,5 @@ Device { AutomaticMount = yes; # when device opened, read it RemovableMedia = no; AlwaysOpen = no; - Maximum Concurrent Jobs = {{ item.maximum_concurrent_jobs | default('50') }} + Maximum Concurrent Jobs = {{ item.max_concurrent_jobs | default('50') }} }