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