28 lines
715 B
YAML
28 lines
715 B
YAML
---
|
|
# This playbook cleans up its own backup directory.
|
|
- name: Cleanup semaphore
|
|
hosts: all
|
|
gather_facts: true
|
|
|
|
tasks:
|
|
- include_vars: vars/semaphore/variable.yaml
|
|
|
|
- name: Search for backup directories
|
|
become: yes
|
|
find:
|
|
paths: "{{ local_backup }}"
|
|
file_type: directory
|
|
recurse: false
|
|
register: backup_dirs
|
|
|
|
- name: Create logrotate directories
|
|
debug: msg="{{ item[0].path }}/{{ item[1] }}"
|
|
# file:
|
|
# path: "{{ local_backup }}/{{ item }}"
|
|
# state: directory
|
|
with_nested:
|
|
- "{{ backup_dirs.files }}"
|
|
- ['daily', 'weekly', 'monthly', 'yearly']
|
|
loop_control:
|
|
label: "{{ item[0] }} {{ item[1] }}"
|