Fix check for existing nvdimm namespaces

Due to the use of a folding block operator instead of the literal block
operator the check for existing namespaces does not work correct and
namespaces get created on subsequent deploy runs even if they already
exist. Now namespaces won't get created if the are already there.

Conflicts:
  tripleo_ansible/roles/tripleo_nvdimm/tasks/create_namespaces.yml

Change-Id: I7ada7a7b78b7930a68d0204e217e3640c3dd5c73
(cherry picked from commit c437eacb13)
(cherry picked from commit a250d89569)
(cherry picked from commit a9fa152205)
This commit is contained in:
Martin Schuppert 2020-12-14 11:37:13 +01:00
parent 8448dfa28e
commit 96acf31f00
2 changed files with 11 additions and 4 deletions

View File

@ -0,0 +1,7 @@
---
fixes:
- |
Due to the use of a folding block operator instead of the literal block
operator the check for existing namespaces does not work correct and
namespaces get created on subsequent deploy runs even if they already
exist. Now namespaces won't get created if the are already there.

View File

@ -15,16 +15,16 @@
# under the License.
- name: list current namespaces
shell: >-
shell: |
set -euxo pipefail
ndctl list -X | jq ".[].name"
ndctl list -X | jq -r ".[].name"
register: namespaces
changed_when: false
- name: create namespace
command: >-
ndctl create-namespace -s {{ input[0] }} -m devdax -M mem -n {{ input[1] }}
when:
- namespaces.stdout is defined
- input[1] not in namespaces.stdout
- namespaces.stdout_lines is defined
- input[1] not in namespaces.stdout_lines
register: ret
changed_when: ret.rc == 0