mirror of https://github.com/ceph/ceph-ansible.git
Merge pull request #728 from ivotron/issue727
docker: use ceph_docker_osd_devices variable for purging docker clusterpull/752/head
commit
896097e6aa
|
@ -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
|
|
||||||
|
|
Loading…
Reference in New Issue