ceph-osd: use the new ceph_volume module for the lvm scenario

Signed-off-by: Andrew Schoen <aschoen@redhat.com>
pull/2245/head
Andrew Schoen 2017-12-01 07:33:16 -06:00 committed by Sébastien Han
parent 61b4a1bedc
commit 423166f671
1 changed files with 11 additions and 159 deletions

View File

@ -1,164 +1,16 @@
---
- name: list all lvm osds
command: ceph-volume lvm list
register: ceph_volume_lvm_list
failed_when: False
changed_when: False
check_mode: no
- name: use ceph-volume to create filestore osds with dedicated journals
command: "ceph-volume --cluster {{ cluster }} lvm create --filestore --data {{ item.data_vg }}/{{ item.data }} --journal {{ item.journal }}"
- name: use ceph-volume to create osds
ceph_volume:
objectstore: "{{ osd_objectstore }}"
data: "{{ item.data }}"
data_vg: "{{ item.data_vg|default(omit) }}"
journal: "{{ item.journal|default(omit) }}"
journal_vg: "{{ item.journal_vg|default(omit) }}"
db: "{{ item.db|default(omit) }}"
db_vg: "{{ item.db_vg|default(omit) }}"
wal: "{{ item.wal|default(omit) }}"
wal_vg: "{{ item.wal_vg|default(omit) }}"
environment:
CEPH_VOLUME_DEBUG: 1
with_items: "{{ lvm_volumes }}"
when:
- item.journal_vg is not defined
- item.data_vg is defined
- osd_objectstore == 'filestore'
- "'{{ item.data_vg }}/{{ item.data }}' not in ceph_volume_lvm_list.stdout"
- name: use ceph-volume to create filestore osds with dedicated lv journals
command: "ceph-volume --cluster {{ cluster }} lvm create --filestore --data {{ item.data_vg }}/{{ item.data }} --journal {{item.journal_vg }}/{{ item.journal }}"
environment:
CEPH_VOLUME_DEBUG: 1
with_items: "{{ lvm_volumes }}"
when:
- item.journal_vg is defined
- item.data_vg is defined
- osd_objectstore == 'filestore'
- "'{{ item.data_vg }}/{{ item.data }}' not in ceph_volume_lvm_list.stdout"
- name: use ceph-volume to create bluestore osds with db and wal
command: "ceph-volume --cluster {{ cluster }} lvm create --bluestore --data {{ item.data_vg }}/{{ item.data }} --block.wal {{ item.wal_vg }}/{{ item.wal }} --block.db {{ item.db_vg }}/{{ item.db }}"
environment:
CEPH_VOLUME_DEBUG: 1
with_items: "{{ lvm_volumes }}"
when:
- osd_objectstore == 'bluestore'
- item.data_vg is defined
- item.wal is defined
- item.wal_vg is defined
- item.db is defined
- item.db_vg is defined
- "'{{ item.data_vg }}/{{ item.data }}' not in ceph_volume_lvm_list.stdout"
- name: use ceph-volume to create bluestore osds with db only
command: "ceph-volume --cluster {{ cluster }} lvm create --bluestore --data {{ item.data_vg }}/{{ item.data }} --block.db {{ item.db_vg }}/{{ item.db }}"
environment:
CEPH_VOLUME_DEBUG: 1
with_items: "{{ lvm_volumes }}"
when:
- osd_objectstore == 'bluestore'
- item.data_vg is defined
- item.wal is not defined
- item.wal_vg is not defined
- item.db is defined
- item.db_vg is defined
- "'{{ item.data_vg }}/{{ item.data }}' not in ceph_volume_lvm_list.stdout"
- name: use ceph-volume to create bluestore osds with wal only
command: "ceph-volume --cluster {{ cluster }} lvm create --bluestore --data {{ item.data_vg }}/{{ item.data }} --block.wal {{ item.wal_vg }}/{{ item.wal }}"
environment:
CEPH_VOLUME_DEBUG: 1
with_items: "{{ lvm_volumes }}"
when:
- osd_objectstore == 'bluestore'
- item.wal is defined
- item.data_vg is defined
- item.wal_vg is defined
- item.db is not defined
- item.db_vg is not defined
- "'{{ item.data_vg }}/{{ item.data }}' not in ceph_volume_lvm_list.stdout"
- name: use ceph-volume to create bluestore osds with just a data device
command: "ceph-volume --cluster {{ cluster }} lvm create --bluestore --data {{ item.data_vg }}/{{ item.data }}"
environment:
CEPH_VOLUME_DEBUG: 1
with_items: "{{ lvm_volumes }}"
when:
- osd_objectstore == 'bluestore'
- item.wal is not defined
- item.data_vg is defined
- item.wal_vg is not defined
- item.db is not defined
- item.db_vg is not defined
- "'{{ item.data_vg }}/{{ item.data }}' not in ceph_volume_lvm_list.stdout"
- name: use ceph-volume to create filestore osds with dedicated journals and a raw device or partition for data
command: "ceph-volume --cluster {{ cluster }} lvm create --filestore --data {{ item.data }} --journal {{ item.journal }}"
environment:
CEPH_VOLUME_DEBUG: 1
with_items: "{{ lvm_volumes }}"
when:
- item.journal_vg is not defined
- item.data_vg is not defined
- osd_objectstore == 'filestore'
- "'{{ item.data }}' not in ceph_volume_lvm_list.stdout"
- name: use ceph-volume to create filestore osds with dedicated lv journals and a raw device or partition for data
command: "ceph-volume --cluster {{ cluster }} lvm create --filestore --data {{ item.data }} --journal {{item.journal_vg }}/{{ item.journal }}"
environment:
CEPH_VOLUME_DEBUG: 1
with_items: "{{ lvm_volumes }}"
when:
- item.journal_vg is defined
- item.data_vg is not defined
- osd_objectstore == 'filestore'
- "'{{ item.data }}' not in ceph_volume_lvm_list.stdout"
- name: use ceph-volume to create bluestore osds with db and wal and a raw device or partition for data
command: "ceph-volume --cluster {{ cluster }} lvm create --bluestore --data {{ item.data }} --block.wal {{ item.wal_vg }}/{{ item.wal }} --block.db {{ item.db_vg }}/{{ item.db }}"
environment:
CEPH_VOLUME_DEBUG: 1
with_items: "{{ lvm_volumes }}"
when:
- osd_objectstore == 'bluestore'
- item.data_vg is not defined
- item.wal is defined
- item.wal_vg is defined
- item.db is defined
- item.db_vg is defined
- "'{{ item.data }}' not in ceph_volume_lvm_list.stdout"
- name: use ceph-volume to create bluestore osds with db only and a raw device or partition for data
command: "ceph-volume --cluster {{ cluster }} lvm create --bluestore --data {{ item.data }} --block.db {{ item.db_vg }}/{{ item.db }}"
environment:
CEPH_VOLUME_DEBUG: 1
with_items: "{{ lvm_volumes }}"
when:
- osd_objectstore == 'bluestore'
- item.data_vg is not defined
- item.wal is not defined
- item.wal_vg is not defined
- item.db is defined
- item.db_vg is defined
- "'{{ item.data }}' not in ceph_volume_lvm_list.stdout"
- name: use ceph-volume to create bluestore osds with wal only and a raw device or partition for data
command: "ceph-volume --cluster {{ cluster }} lvm create --bluestore --data {{ item.data }} --block.wal {{ item.wal_vg }}/{{ item.wal }}"
environment:
CEPH_VOLUME_DEBUG: 1
with_items: "{{ lvm_volumes }}"
when:
- osd_objectstore == 'bluestore'
- item.wal is defined
- item.data_vg is not defined
- item.wal_vg is defined
- item.db is not defined
- item.db_vg is not defined
- "'{{ item.data }}' not in ceph_volume_lvm_list.stdout"
- name: use ceph-volume to create bluestore osds with just a data device and a raw device or partition for data
command: "ceph-volume --cluster {{ cluster }} lvm create --bluestore --data {{ item.data }}"
environment:
CEPH_VOLUME_DEBUG: 1
with_items: "{{ lvm_volumes }}"
when:
- osd_objectstore == 'bluestore'
- item.wal is not defined
- item.data_vg is not defined
- item.wal_vg is not defined
- item.db is not defined
- item.db_vg is not defined
- "'{{ item.data }}' not in ceph_volume_lvm_list.stdout"