Appendix F. Purging storage clusters deployed by Ansible

If you no longer want to use a Ceph storage cluster, then use the purge-docker-cluster.yml playbook to remove the cluster. Purging a storage cluster is also useful when the installation process failed and you want to start over.

Warning

After purging a Ceph storage cluster, all data on the OSDs is permanently lost.

Prerequisites

  • Root-level access to the Ansible administration node.
  • Access to the ansible user account.
  • For bare-metal deployments:

    • If the osd_auto_discovery option in the /usr/share/ceph-ansible/group-vars/osds.yml file is set to true, then Ansible will fail to purge the storage cluster. Therefore, comment out osd_auto_discovery and declare the OSD devices in the osds.yml file.
  • Ensure that the /var/log/ansible/ansible.log file is writable by the ansible user account.

Procedure

  1. Navigate to the /usr/share/ceph-ansible/ directory:

    [root@admin ~]# cd /usr/share/ceph-ansible
  2. As the ansible user, run the purge playbook.

    1. For bare-metal deployments, use the purge-cluster.yml playbook to purge the Ceph storage cluster:

      [ansible@admin ceph-ansible]$ ansible-playbook infrastructure-playbooks/purge-cluster.yml
    2. For container deployments:

      1. Use the purge-docker-cluster.yml playbook to purge the Ceph storage cluster:

        [ansible@admin ceph-ansible]$ ansible-playbook infrastructure-playbooks/purge-docker-cluster.yml
        Note

        This playbook removes all packages, containers, configuration files, and all the data created by the Ceph Ansible playbook.

      2. To specify a different inventory file other than the default (/etc/ansible/hosts), use -i parameter:

        Syntax

        [ansible@admin ceph-ansible]$ ansible-playbook infrastructure-playbooks/purge-docker-cluster.yml -i INVENTORY_FILE

        Replace

        INVENTORY_FILE with the path to the inventory file.

        Example

        [ansible@admin ceph-ansible]$ ansible-playbook infrastructure-playbooks/purge-docker-cluster.yml -i ~/ansible/hosts

      3. To skip the removal of the Ceph container image, use the --skip-tags=”remove_img” option:

        [ansible@admin ceph-ansible]$ ansible-playbook --skip-tags="remove_img" infrastructure-playbooks/purge-docker-cluster.yml
      4. To skip the removal of the packages that were installed during the installation, use the --skip-tags=”with_pkg” option:

        [ansible@admin ceph-ansible]$ ansible-playbook --skip-tags="with_pkg" infrastructure-playbooks/purge-docker-cluster.yml

Additional Resources