Files
dsk-iac/01-old/kubespray/roles/etcd/handlers/backup_cleanup.yml
dsk-minchulahn 0273450ff6 Clean Code
2023-12-19 13:03:29 +09:00

12 lines
326 B
YAML

---
- name: Cleanup etcd backups
command: /bin/true
notify:
- Remove old etcd backups
- name: Remove old etcd backups
shell:
chdir: "{{ etcd_backup_prefix }}"
cmd: "find . -name 'etcd-*' -type d | sort -n | head -n -{{ etcd_backup_retention_count }} | xargs rm -rf"
when: etcd_backup_retention_count >= 0