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.
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 totrue
, then Ansible will fail to purge the storage cluster. Therefore, comment outosd_auto_discovery
and declare the OSD devices in theosds.yml
file.
-
If the
-
Ensure that the
/var/log/ansible/ansible.log
file is writable by theansible
user account.
Procedure
Navigate to the
/usr/share/ceph-ansible/
directory:[root@admin ~]# cd /usr/share/ceph-ansible
As the
ansible
user, run the purge playbook.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
For container deployments:
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
NoteThis playbook removes all packages, containers, configuration files, and all the data created by the Ceph Ansible playbook.
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
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
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
- See the OSD Ansible settings for more details.