Simplify nova_cinder_rbd_inuse set fact

Removes the obsolete jinja loop in favor of the newer style
map-extract ansible filter.

Change-Id: Ia1d02070be2d5ab89e5ef51d96773395516d0c8d
This commit is contained in:
Logan V 2017-07-14 06:52:29 -05:00 committed by Jesse Pretorius (odyssey4me)
parent c8862e4d8f
commit 27accd67e4

View File

@ -29,14 +29,7 @@
# instances can function when RBD is the volume backend.
- name: Set cinder RBD inuse fact
set_fact:
nova_cinder_rbd_inuse: |-
{% set _var = False %}
{% for host in groups['cinder_volume'] %}
{% if hostvars[host]['cinder_backend_rbd_inuse'] | bool %}
{% set _var = True %}
{% endif %}
{% endfor %}
{{ _var }}
nova_cinder_rbd_inuse: "{{ True in groups['cinder_volume'] | map('extract', hostvars, 'cinder_backend_rbd_inuse') }}"
delegate_to: localhost
delegate_facts: True
when: