Merge pull request #646 from ceph/fix-purge-ubuntu

Fix purge ubuntu
pull/649/head
Leseb 2016-03-24 15:14:54 +01:00
commit c691638c3e
1 changed files with 24 additions and 10 deletions

View File

@ -59,6 +59,13 @@
state: absent state: absent
tasks: tasks:
- name: check for a device list
fail:
msg: "OSD automatic discovery was detected, purge cluster does not support this scenario. If you want to purge the cluster, manually provide the list of devices in group_vars/osds using the devices variable."
when:
devices is not defined and
osd_auto_discovery
- name: get osd numbers - name: get osd numbers
shell: "if [ -d /var/lib/ceph/osd ] ; then ls /var/lib/ceph/osd | cut -d '-' -f 2 ; fi" shell: "if [ -d /var/lib/ceph/osd ] ; then ls /var/lib/ceph/osd | cut -d '-' -f 2 ; fi"
register: osd_ids register: osd_ids
@ -132,14 +139,15 @@
# Ubuntu 14.04 # Ubuntu 14.04
- name: stop ceph osds on ubuntu - name: stop ceph osds on ubuntu
command: stop ceph-osd-all command: stop ceph-osd id={{ item }}
failed_when: false failed_when: false
when: when:
ansible_distribution == 'Ubuntu' and ansible_distribution == 'Ubuntu' and
osd_group_name in group_names osd_group_name in group_names
with_items: "{{ osd_ids.stdout_lines }}"
- name: stop ceph mons on ubuntu - name: stop ceph mons on ubuntu
command: stop ceph-mon-all command: stop ceph-mon id={{ ansible_hostname }}
failed_when: false failed_when: false
when: when:
ansible_distribution == 'Ubuntu' and ansible_distribution == 'Ubuntu' and
@ -181,6 +189,12 @@
when: when:
osd_group_name in group_names osd_group_name in group_names
- name: remove monitor store and bootstrap keys
shell: rm -rf /var/lib/ceph/
failed_when: false
when:
mon_group_name in group_names
- name: is reboot needed - name: is reboot needed
local_action: shell echo requesting reboot local_action: shell echo requesting reboot
notify: notify: