Merge pull request #728 from ivotron/issue727

docker: use ceph_docker_osd_devices variable for purging docker cluster
pull/752/head
Leseb 2016-05-03 22:16:18 +02:00
commit 896097e6aa
1 changed files with 15 additions and 15 deletions

View File

@ -8,8 +8,13 @@
tasks: tasks:
- name: install the latest version of gdisk
package:
name: gdisk
state: present
- name: collect ceph containers - name: collect ceph containers
shell: "docker ps | awk '/ceph.daemon/ {print $10}'" shell: docker ps -aq --filter="ancestor=ceph/daemon"
register: containers register: containers
- name: delete ceph containers - name: delete ceph containers
@ -17,27 +22,22 @@
with_items: containers.stdout_lines with_items: containers.stdout_lines
- name: purge ceph directories - name: purge ceph directories
shell: rm -rf {{ item }} file:
path: {{ item }}
state: absent
with_items: with_items:
- /etc/ceph/* - /etc/ceph/
- /var/lib/ceph/* - /var/lib/ceph/
failed_when: false
- hosts: - hosts:
- osds - osds
vars:
devices: [ '/dev/sdb', '/dev/sdc', '/dev/sdd', '/dev/sde', '/dev/sdf' ]
partitions: [ '1', '2', '3' ]
tasks: tasks:
- name: disk zap - name: disk zap
command: /usr/sbin/sgdisk --zap-all --clear --mbrtogpt -g -- {{ item }} command: sgdisk --zap-all --clear --mbrtogpt -g -- {{ item }}
with_items: devices with_items: ceph_osd_docker_devices
failed_when: false
- name: disk zap again - name: disk zap again
command: /usr/sbin/sgdisk --zap-all --clear --mbrtogpt -g -- {{ item }} command: sgdisk --zap-all --clear --mbrtogpt -g -- {{ item }}
with_items: devices with_items: ceph_osd_docker_devices
failed_when: false