filestore-to-bluestore: skip bluestore osd nodes

If the OSD node is already using bluestore OSDs then we should skip
all the remaining tasks to avoid purging OSD for nothing.
Instead we warn the user.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1790472

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
(cherry picked from commit 83c5a1d7a8)
pull/5038/head
Dimitri Savineau 2020-01-23 16:58:14 -05:00 committed by Guillaume Abrioux
parent 460d3557d7
commit 487be2675a
1 changed files with 234 additions and 222 deletions

View File

@ -21,6 +21,18 @@
- import_role: - import_role:
name: ceph-defaults name: ceph-defaults
- name: set_fact current_objectstore
set_fact:
current_objectstore: '{{ osd_objectstore }}'
- name: warn user about osd already using bluestore
debug:
msg: 'WARNING: {{ inventory_hostname }} is already using bluestore. Skipping all tasks.'
when: current_objectstore == 'bluestore'
- name: shrink and redeploy filestore osds
when: current_objectstore == 'filestore'
block:
- import_role: - import_role:
name: ceph-facts name: ceph-facts
@ -246,6 +258,10 @@
filter: ansible_devices filter: ansible_devices
when: osd_auto_discovery | bool when: osd_auto_discovery | bool
- name: force osd_objectstore to bluestore
set_fact:
osd_objectstore: bluestore
- import_role: - import_role:
name: ceph-defaults name: ceph-defaults
- import_role: - import_role:
@ -257,9 +273,5 @@
when: containerized_deployment | bool when: containerized_deployment | bool
- import_role: - import_role:
name: ceph-config name: ceph-config
vars:
osd_objectstore: bluestore
- import_role: - import_role:
name: ceph-osd name: ceph-osd
vars:
osd_objectstore: bluestore