Make devices filter in lvm.conf overridable
Change-Id: I2700028965bd89abaa342df91014874c94daf06c
This commit is contained in:
parent
75019ed6c5
commit
826627c937
@ -273,6 +273,13 @@ cinder_quota_backup_gigabytes: 1000
|
||||
# - lvm_high_iops
|
||||
# - lvm_low_iops
|
||||
|
||||
# Override generated device filter in lvm.conf
|
||||
# Example:
|
||||
# cinder_lvm_devices_filter_override:
|
||||
# - '"a/sd.*/"'
|
||||
# - '"a/hd.*/"'
|
||||
cinder_lvm_devices_filter_override: []
|
||||
|
||||
# cinder_backend_lvm_inuse: True if current host has an lvm backend
|
||||
cinder_backend_lvm_inuse: '{{ (cinder_backends|default("")|to_json).find("lvm") != -1 }}'
|
||||
# cinder_backend_rbd_inuse: True if the current host has an rbd backend
|
||||
|
@ -1,17 +1,21 @@
|
||||
# {{ ansible_managed }}
|
||||
|
||||
{% set used_lvm_devices = [] %}
|
||||
{% set lv_devices = lvm_devices.stdout.split('\n') %}
|
||||
{% if lv_devices|length > 0 %}
|
||||
{% if cinder_lvm_devices_filter_override|length > 0 %}
|
||||
{% set used_lvm_devices = cinder_lvm_devices_filter_override %}
|
||||
{% else %}
|
||||
{% set lv_devices = lvm_devices.stdout.split('\n') %}
|
||||
{% if lv_devices|length > 0 %}
|
||||
{% for net in lv_devices %}
|
||||
{% if net != '' %}
|
||||
{% set lv_device = '"a/' + net + '/"' %}
|
||||
{% if used_lvm_devices.append(lv_device) %}{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
# Ansible Discovered LVM Devices {{ lv_devices }}
|
||||
{% endif %}
|
||||
|
||||
{% if used_lvm_devices|length <= 0 %}
|
||||
{# If there are no LVM devices present, allow all devices to be scanned #}
|
||||
|
Loading…
Reference in New Issue
Block a user