# SPDX-License-Identifier: MIT
---
# Two tasks are needed due to how 'removes' works:
# * if ALL files in 'removes' exist, the command is run
# * if only one exists, the command is skipped.
# When a cluster has never started, there is no cib.xml, yet we still want to
# run 'pcs cluster destroy'.

- name: Remove cluster configuration
  command:
    cmd: pcs cluster destroy
    removes: "{{ item }}"
  loop:
    - /etc/corosync/corosync.conf
    - /var/lib/pacemaker/cib/cib.xml
