mirror of https://github.com/ceph/ceph-ansible.git
ceph-config: use 'lvm list' to find num_osds for an existing cluster
This makes finding num_osds idempotent for clusters that were deployed using 'lvm batch'. Signed-off-by: Andrew Schoen <aschoen@redhat.com>pull/3206/head
parent
2ffad1b43a
commit
40f82319dd
|
@ -38,6 +38,7 @@
|
|||
report: true
|
||||
action: "batch"
|
||||
register: lvm_batch_report
|
||||
failed_when: false
|
||||
environment:
|
||||
CEPH_VOLUME_DEBUG: 1
|
||||
when:
|
||||
|
@ -50,6 +51,26 @@
|
|||
when:
|
||||
- devices | default([]) | length > 0
|
||||
- osd_scenario == 'lvm'
|
||||
- (lvm_batch_report.stdout | from_json).changed
|
||||
|
||||
- name: run 'ceph-volume lvm list' to see how many osds have already been created
|
||||
ceph_volume:
|
||||
action: "list"
|
||||
register: lvm_list
|
||||
environment:
|
||||
CEPH_VOLUME_DEBUG: 1
|
||||
when:
|
||||
- devices | default([]) | length > 0
|
||||
- osd_scenario == 'lvm'
|
||||
- not (lvm_batch_report.stdout | from_json).changed
|
||||
|
||||
- name: set_fact num_osds from the output of 'ceph-volume lvm list'
|
||||
set_fact:
|
||||
num_osds: "{{ lvm_list.stdout | from_json | length | int }}"
|
||||
when:
|
||||
- devices | default([]) | length > 0
|
||||
- osd_scenario == 'lvm'
|
||||
- not (lvm_batch_report.stdout | from_json).changed
|
||||
|
||||
when:
|
||||
- inventory_hostname in groups.get(osd_group_name, [])
|
||||
|
|
Loading…
Reference in New Issue