ceph-osd skip lvm creation if they are already in use

Signed-off-by: Alfredo Deza <adeza@redhat.com>
pull/2100/head
Alfredo Deza 2017-10-26 19:05:52 -04:00
parent d3b427e169
commit 517a2b3feb
1 changed files with 14 additions and 0 deletions

View File

@ -1,4 +1,12 @@
--- ---
- 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 - 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 }}" command: "ceph-volume --cluster {{ cluster }} lvm create --filestore --data {{ item.data_vg }}/{{ item.data }} --journal {{ item.journal }}"
environment: environment:
@ -7,6 +15,7 @@
when: when:
- item.journal_vg is not defined - item.journal_vg is not defined
- osd_objectstore == 'filestore' - 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 - 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 }}" command: "ceph-volume --cluster {{ cluster }} lvm create --filestore --data {{ item.data_vg }}/{{ item.data }} --journal {{item.journal_vg }}/{{ item.journal }}"
@ -16,6 +25,7 @@
when: when:
- item.journal_vg is defined - item.journal_vg is defined
- osd_objectstore == 'filestore' - 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 - 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 }}" 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 }}"
@ -28,6 +38,7 @@
- item.wal_vg is defined - item.wal_vg is defined
- item.db is defined - item.db is defined
- item.db_vg 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 - 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 }}" command: "ceph-volume --cluster {{ cluster }} lvm create --bluestore --data {{ item.data_vg }}/{{ item.data }} --block.db {{ item.db_vg }}/{{ item.db }}"
@ -40,6 +51,7 @@
- item.wal_vg is not defined - item.wal_vg is not defined
- item.db is defined - item.db is defined
- item.db_vg 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 - 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 }}" command: "ceph-volume --cluster {{ cluster }} lvm create --bluestore --data {{ item.data_vg }}/{{ item.data }} --block.wal {{ item.wal_vg }}/{{ item.wal }}"
@ -52,6 +64,7 @@
- item.wal_vg is defined - item.wal_vg is defined
- item.db is not defined - item.db is not defined
- item.db_vg 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 - 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 }}" command: "ceph-volume --cluster {{ cluster }} lvm create --bluestore --data {{ item.data_vg }}/{{ item.data }}"
@ -64,3 +77,4 @@
- item.wal_vg is not defined - item.wal_vg is not defined
- item.db is not defined - item.db is not defined
- item.db_vg is not defined - item.db_vg is not defined
- "'{{ item.data_vg }}/{{ item.data }}' not in ceph_volume_lvm_list.stdout"