mirror of https://github.com/ceph/ceph-ansible.git
purge-docker: re-implement zap devices
We now run the container and waits until it dies. Prior to this we were stopping it before completion so not all the devices where zapped. Signed-off-by: Sébastien Han <seb@redhat.com>pull/1287/head
parent
b91d227b99
commit
3b633d5ddc
|
@ -283,43 +283,27 @@
|
||||||
with_items: "{{ ceph_osd_docker_devices }}"
|
with_items: "{{ ceph_osd_docker_devices }}"
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
||||||
- name: zap ceph osd disk
|
- name: zap ceph osd disks
|
||||||
docker:
|
shell: |
|
||||||
image: "{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}"
|
docker run \
|
||||||
name: "{{ ansible_hostname }}-osd-zap-{{ item | regex_replace('/', '') }}"
|
--privileged=true \
|
||||||
net: host
|
--name {{ ansible_hostname }}-osd-zap-{{ item | regex_replace('/', '') }} \
|
||||||
pid: host
|
-v /dev/:/dev/ \
|
||||||
state: started
|
-e OSD_DEVICE={{ item }} \
|
||||||
privileged: yes
|
{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} \
|
||||||
env: "CEPH_DAEMON=zap_device,OSD_DEVICE={{ item }}"
|
zap_device
|
||||||
volumes: "/var/lib/ceph:/var/lib/ceph,/etc/ceph:/etc/ceph,/dev:/dev,/run:/run"
|
|
||||||
with_items:
|
with_items:
|
||||||
- "{{ ceph_osd_docker_devices }}"
|
- "{{ ceph_osd_docker_devices }}"
|
||||||
- "{{ raw_journal_devices }}"
|
- "{{ raw_journal_devices }}"
|
||||||
|
|
||||||
- name: remove ceph osd zap disk container
|
- name: wait until the zap containers die
|
||||||
docker:
|
shell: |
|
||||||
image: "{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}"
|
docker ps | grep -sq {{ ansible_hostname }}-osd-zap
|
||||||
name: "{{ ansible_hostname }}-osd-zap-{{ item | regex_replace('/', '') }}"
|
register: zap_alive
|
||||||
state: absent
|
failed_when: false
|
||||||
with_items:
|
until: zap_alive.rc != 0
|
||||||
- "{{ ceph_osd_docker_devices }}"
|
retries: 5
|
||||||
- "{{ raw_journal_devices }}"
|
delay: 10
|
||||||
|
|
||||||
# zap twice
|
|
||||||
- name: zap ceph osd disk
|
|
||||||
docker:
|
|
||||||
image: "{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}"
|
|
||||||
name: "{{ ansible_hostname }}-osd-zap-{{ item | regex_replace('/', '') }}"
|
|
||||||
net: host
|
|
||||||
pid: host
|
|
||||||
state: started
|
|
||||||
privileged: yes
|
|
||||||
env: "CEPH_DAEMON=zap_device,OSD_DEVICE={{ item }}"
|
|
||||||
volumes: "/var/lib/ceph:/var/lib/ceph,/etc/ceph:/etc/ceph,/dev:/dev,/run:/run"
|
|
||||||
with_items:
|
|
||||||
- "{{ ceph_osd_docker_devices }}"
|
|
||||||
- "{{ raw_journal_devices }}"
|
|
||||||
|
|
||||||
- name: remove ceph osd zap disk container
|
- name: remove ceph osd zap disk container
|
||||||
docker:
|
docker:
|
||||||
|
|
Loading…
Reference in New Issue