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:

    Copy to Clipboard Toggle word wrap
    [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:

      Copy to Clipboard Toggle word wrap
      [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:

        Copy to Clipboard Toggle word wrap
        [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

        Copy to Clipboard Toggle word wrap
        [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

        Copy to Clipboard Toggle word wrap
        [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:

        Copy to Clipboard Toggle word wrap
        [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:

        Copy to Clipboard Toggle word wrap
        [ansible@admin ceph-ansible]$ ansible-playbook --skip-tags="with_pkg" infrastructure-playbooks/purge-docker-cluster.yml

Additional Resources

Back to top
Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2025 Red Hat, Inc.