Merge "Add LVM option for ceph-loop-device role"

This commit is contained in:
Zuul 2019-02-26 01:47:56 +00:00 committed by Gerrit Code Review
commit a03bdf2204
3 changed files with 27 additions and 1 deletions

View File

@ -2,7 +2,8 @@ ceph-loop-device
================
This role creates the /dev/loop3 (default) loop device required when you have
ceph services in the deployment.
ceph services in the deployment. For Stein and newer it creates three logical
volumes for use with bluestore.
Role Variables
@ -10,6 +11,10 @@ Role Variables
ceph_loop_device: /dev/loop3
ceph_loop_device_file: /var/lib/ceph-osd.img
ceph_logical_volume_group: ceph_vg
ceph_logical_volume_wal: ceph_lv_wal
ceph_logical_volume_db: ceph_lv_db
ceph_logical_volume_data: ceph_lv_data
Requirements
------------

View File

@ -1,3 +1,7 @@
---
ceph_loop_device: /dev/loop3
ceph_loop_device_file: /var/lib/ceph-osd.img
ceph_logical_volume_group: ceph_vg
ceph_logical_volume_wal: ceph_lv_wal
ceph_logical_volume_db: ceph_lv_db
ceph_logical_volume_data: ceph_lv_data

View File

@ -21,3 +21,20 @@
dd if=/dev/zero of={{ ceph_loop_device_file }} bs=1 count=0 seek=7G
losetup {{ ceph_loop_device }} {{ ceph_loop_device_file }}
lsblk
- name: Get branch
set_fact:
ci_branch: "{{ zuul.branch | default('master') | replace('stable/','') }}"
- name: Use {pv,vg,lv}create to create logical volumes on loop device
become: true
shell: |
pvcreate {{ ceph_loop_device }}
vgcreate {{ ceph_logical_volume_group }} {{ ceph_loop_device }}
lvcreate -n {{ ceph_logical_volume_wal }} -l 375 {{ ceph_logical_volume_group }}
lvcreate -n {{ ceph_logical_volume_db }} -l 375 {{ ceph_logical_volume_group }}
lvcreate -n {{ ceph_logical_volume_data }} -l 1041 {{ ceph_logical_volume_group }}
lvs
when:
- ci_branch is defined
- ci_branch is not match('(newton|ocata|pike|queens|rocky)')