Create subdirectories for logrotate.
This commit is contained in:
17
odroid.yaml
17
odroid.yaml
@@ -59,10 +59,25 @@
|
|||||||
- nextcloud
|
- nextcloud
|
||||||
|
|
||||||
- name: Check logrotate directories
|
- name: Check logrotate directories
|
||||||
debug: var=item
|
stat:
|
||||||
|
path: "{{ backup_dir }}/{{ item }}"
|
||||||
|
register: subdirs
|
||||||
with_nested:
|
with_nested:
|
||||||
- ['bookstack', 'kimai', 'semaphore', 'gitea', 'nextcloud']
|
- ['bookstack', 'kimai', 'semaphore', 'gitea', 'nextcloud']
|
||||||
- ['daily', 'weekly', 'monthly', 'yearly']
|
- ['daily', 'weekly', 'monthly', 'yearly']
|
||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item[0] }} {{ item[1] }}"
|
label: "{{ item[0] }} {{ item[1] }}"
|
||||||
|
|
||||||
|
- name: Create not existing logrotate directories
|
||||||
|
file:
|
||||||
|
path: "{{ backup_dir }}/{{ item.item }}"
|
||||||
|
state: directory
|
||||||
|
mode: 0755
|
||||||
|
group: chris
|
||||||
|
owner: chris
|
||||||
|
when: item.stat.exists == false
|
||||||
|
with_items: "{{ subdirs.results }}"
|
||||||
|
loop_control:
|
||||||
|
label: "{{ item.item }}"
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user