From acb1a9a723d76415110608b45799733e84d81ec4 Mon Sep 17 00:00:00 2001 From: Christian Zunker Date: Wed, 8 Mar 2017 15:09:38 +0100 Subject: [PATCH] Do a whole word grep Do a whole word grep just in case the backends name are similar which might result in only one backend getting created as volume type. Change-Id: I2d41933742cf71c9184f24533c6e7e601333ff65 Closes-Bug: 1671108 --- tasks/cinder_backends.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/cinder_backends.yml b/tasks/cinder_backends.yml index f4c555a5..a0088fd2 100644 --- a/tasks/cinder_backends.yml +++ b/tasks/cinder_backends.yml @@ -30,7 +30,7 @@ - name: Add in cinder devices types shell: | . {{ ansible_env.HOME }}/openrc - if ! {{ cinder_bin }}/cinder {{ keystone_service_adminuri_insecure | bool | ternary('--insecure','') }} type-list | grep "{{ item.key }}"; then + if ! {{ cinder_bin }}/cinder {{ keystone_service_adminuri_insecure | bool | ternary('--insecure','') }} type-list | grep " {{ item.key }} "; then {{ cinder_bin }}/cinder {{ keystone_service_adminuri_insecure | bool | ternary('--insecure','') }} type-create "{{ item.key }}" {{ cinder_bin }}/cinder {{ keystone_service_adminuri_insecure | bool | ternary('--insecure','') }} type-key "{{ item.key }}" set volume_backend_name="{{ item.value.volume_backend_name }}" fi @@ -41,7 +41,7 @@ shell: | . {{ ansible_env.HOME }}/openrc {% for evtype in item.value.extra_volume_types %} - if ! {{ cinder_bin }}/cinder {{ keystone_service_adminuri_insecure | bool | ternary('--insecure','') }} type-list | grep "{{ evtype }}"; then + if ! {{ cinder_bin }}/cinder {{ keystone_service_adminuri_insecure | bool | ternary('--insecure','') }} type-list | grep " {{ evtype }} "; then {{ cinder_bin }}/cinder {{ keystone_service_adminuri_insecure | bool | ternary('--insecure','') }} type-create "{{ evtype }}" {{ cinder_bin }}/cinder {{ keystone_service_adminuri_insecure | bool | ternary('--insecure','') }} type-key "{{ evtype }}" set volume_backend_name="{{ item.value.volume_backend_name }}" fi