c12s-kubespray/roles/etcd/handlers/backup_cleanup.yml

12 lines
326 B
YAML
Raw Normal View History

---
- 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