From 2d7af7af21f2b6d1f27adb0799c396652b165d5a Mon Sep 17 00:00:00 2001 From: Christian Steinle Date: Thu, 24 Apr 2025 10:29:53 +0200 Subject: [PATCH] Create directories for minisforum backup. --- minisforum.yaml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/minisforum.yaml b/minisforum.yaml index 0464870..b222c21 100644 --- a/minisforum.yaml +++ b/minisforum.yaml @@ -8,7 +8,7 @@ hosts: all gather_facts: false vars: - backup_location: "/docker/backup/" + backup_location: "/media/backup/docker/" tasks: - name: Include container variables @@ -18,9 +18,14 @@ # ansible.builtin.debug: # msg: '{{ containers }}' - - name: Check if directory for container backup exists - ansible.builtin.debug: - msg: "{{ item.name }}" + - name: Create container backup directories + file: + path: "{{ backup_location }}{{ item.name }}" + state: directory + mode: 0755 + owner: chris + group: chris + when: item.stat.exists == false loop: "{{ containers }}" loop_control: label: "{{ item.name }}"