Create directories for minisforum backup.
This commit is contained in:
@@ -8,7 +8,7 @@
|
|||||||
hosts: all
|
hosts: all
|
||||||
gather_facts: false
|
gather_facts: false
|
||||||
vars:
|
vars:
|
||||||
backup_location: "/docker/backup/"
|
backup_location: "/media/backup/docker/"
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- name: Include container variables
|
- name: Include container variables
|
||||||
@@ -18,9 +18,14 @@
|
|||||||
# ansible.builtin.debug:
|
# ansible.builtin.debug:
|
||||||
# msg: '{{ containers }}'
|
# msg: '{{ containers }}'
|
||||||
|
|
||||||
- name: Check if directory for container backup exists
|
- name: Create container backup directories
|
||||||
ansible.builtin.debug:
|
file:
|
||||||
msg: "{{ item.name }}"
|
path: "{{ backup_location }}{{ item.name }}"
|
||||||
|
state: directory
|
||||||
|
mode: 0755
|
||||||
|
owner: chris
|
||||||
|
group: chris
|
||||||
|
when: item.stat.exists == false
|
||||||
loop: "{{ containers }}"
|
loop: "{{ containers }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item.name }}"
|
label: "{{ item.name }}"
|
||||||
|
|||||||
Reference in New Issue
Block a user