From 7403204208322ab2e46920a024e74700757c2665 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Sun, 9 Dec 2018 18:26:07 +0100 Subject: bacula-sd: Ensure /mnt/backup is mounted before creating sub-directories. --- roles/bacula-sd/tasks/main.yml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'roles/bacula-sd') diff --git a/roles/bacula-sd/tasks/main.yml b/roles/bacula-sd/tasks/main.yml index 19ae2f3..93958a8 100644 --- a/roles/bacula-sd/tasks/main.yml +++ b/roles/bacula-sd/tasks/main.yml @@ -26,6 +26,21 @@ - systemctl daemon-reload - Restart bacula-sd +# Avoid bacula creating archives under /mnt/backup/bacula when it's +# not mounted +- name: Create directory /mnt/backup + file: path=/mnt/backup + state=directory + owner=root group=root + mode=0755 + +- name: Mount /mnt/backup + mount: src=/dev/mapper/fripost-backup + path=/mnt/backup + fstype=ext4 + opts=noauto + state=mounted + - meta: flush_handlers - name: Enable bacula-sd @@ -34,9 +49,6 @@ - name: Start bacula-sd service: name=bacula-sd state=started -# To avoid bacula creating archives under /mnt/backup/bacula when it's -# not a mountpoint, use `chmod 0700 /mnt/backup; chown root:root /mnt/backup` -# before mounting the disk. - name: Create /mnt/backup/bacula file: path=/mnt/backup/bacula state=directory -- cgit v1.2.3