From 27accd67e4bd995d93f1982ceb1c6a1bef6948ef Mon Sep 17 00:00:00 2001 From: Logan V Date: Fri, 14 Jul 2017 06:52:29 -0500 Subject: [PATCH] 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 --- playbooks/common-playbooks/nova.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/playbooks/common-playbooks/nova.yml b/playbooks/common-playbooks/nova.yml index fa1a3966ce..95a6ae0f87 100644 --- a/playbooks/common-playbooks/nova.yml +++ b/playbooks/common-playbooks/nova.yml @@ -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: