diff options
author | Guilhem Moulin <guilhem@fripost.org> | 2018-12-09 18:26:07 +0100 |
---|---|---|
committer | Guilhem Moulin <guilhem@fripost.org> | 2018-12-09 20:25:40 +0100 |
commit | 7403204208322ab2e46920a024e74700757c2665 (patch) | |
tree | fc9fb3009723b3363dce1d269495753866a79224 | |
parent | 730200a00bb5e300efc35a493f11ec7462d2008f (diff) |
bacula-sd: Ensure /mnt/backup is mounted before creating sub-directories.
-rw-r--r-- | roles/bacula-sd/tasks/main.yml | 18 |
1 files changed, 15 insertions, 3 deletions
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 |