Add support for non vultr block devices and also check first to avoid errors

This commit is contained in:
Neil Hanlon 2022-02-13 22:51:11 -05:00
parent e5755dd3d0
commit 863c9a4068
Signed by: neil
GPG Key ID: 705BC21EC3C70F34
2 changed files with 16 additions and 1 deletions

View File

@ -59,9 +59,15 @@ fi
if [[ "${HOSTNAME}" =~ "compute" ]]; then
let hostpart='6'
fi
if [[ "${HOSTNAME}" =~ "storage" ]]; then
if [[ "${HOSTNAME}" =~ "storage1" ]]; then
let hostpart='7'
fi
if [[ "${HOSTNAME}" =~ "storage2" ]]; then
let hostpart='8'
fi
if [[ "${HOSTNAME}" =~ "storage3" ]]; then
let hostpart='9'
fi
if [[ ! -z "${iface_mgmt}" ]]; then
cat << EOF > ifcfg-br-mgmt

View File

@ -9,9 +9,18 @@
name: targetcli
notify: enable_targetd
- name: Check if cinder_pv_device is set
stat:
path: "{{ cinder_pv_device | default('/dev/vdb') }}"
register: stat_cinder_pv_dev
- name: Create volume group for cinder
lvg:
pv_options: --metadatasize=2048
pvs: "{{ cinder_pv_device | default('/dev/vdb') }}"
vg: cinder-volumes
when:
- stat_cinder_pv_dev.stat.exists
- stat.cinder_pv_device.stat.isblk
...