From: Sébastien Han Date: Tue, 20 Oct 2015 22:28:35 +0000 (+0200) Subject: Add a purge playbook when running ceph in containers X-Git-Tag: v1.0.0~102^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ae5775db2793f4a5d8cf476e770d60e0f578a2e9;p=ceph-ansible.git Add a purge playbook when running ceph in containers Signed-off-by: Sébastien Han --- diff --git a/purge-docker-cluster.yml b/purge-docker-cluster.yml new file mode 100644 index 000000000..9912dbd4c --- /dev/null +++ b/purge-docker-cluster.yml @@ -0,0 +1,43 @@ +--- +# This playbook purges a containerized Ceph cluster +# It removes: packages, configuration files and ALL THE DATA + +- hosts: + - mons + - osds + + tasks: + + - name: collect ceph containers + shell: "docker ps | awk '/ceph.daemon/ {print $10}'" + register: containers + + - name: delete ceph containers + shell: docker rm -f {{ item }} + with_items: containers.stdout_lines + + - name: purge ceph directories + shell: rm -rf {{ item }} + with_items: + - /etc/ceph/* + - /var/lib/ceph/* + failed_when: false + +- hosts: + - osds + + vars: + devices: [ '/dev/sdb', '/dev/sdc', '/dev/sdd', '/dev/sde', '/dev/sdf' ] + partitions: [ '1', '2', '3' ] + + tasks: + + - name: disk zap + command: /usr/sbin/sgdisk --zap-all --clear --mbrtogpt -g -- {{ item }} + with_items: devices + failed_when: false + + - name: disk zap again + command: /usr/sbin/sgdisk --zap-all --clear --mbrtogpt -g -- {{ item }} + with_items: devices + failed_when: false