From c01d9d8475d7b256fed944227a06f028e8d487f8 Mon Sep 17 00:00:00 2001 From: Giulio Fidente Date: Thu, 31 Jan 2019 13:31:07 +0100 Subject: [PATCH] Handle case change for dmidecode >= 3.1 in Ceph templates Forces lowercase matching of user provided node data with dmidecode output. Change-Id: I844a2f7660dff5feda8397706671ac0efd37949f Co-Authored-By: Francesco Pantano Closes-Bug: 1814070 --- docker/services/ceph-ansible/ceph-base.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docker/services/ceph-ansible/ceph-base.yaml b/docker/services/ceph-ansible/ceph-base.yaml index c9d3280736..7b96d044e6 100644 --- a/docker/services/ceph-ansible/ceph-base.yaml +++ b/docker/services/ceph-ansible/ceph-base.yaml @@ -431,7 +431,10 @@ outputs: - name: generate nodes-uuid data file copy: dest: "{{playbook_dir}}/ceph-ansible/nodes_uuid_data.json" - content: {get_param: NodeDataLookup} + content: + yaql: + expression: dict($.data.keys().select($.toLower()).zip($.data.values())) + data: {get_param: NodeDataLookup} - name: generate nodes-uuid playbook copy: dest: "{{playbook_dir}}/ceph-ansible/nodes_uuid_playbook.yml" @@ -443,7 +446,7 @@ outputs: set_fact: nodes_data: "{% raw %}{{ lookup('file','./nodes_uuid_data.json') | from_json }}{% endraw %}" - name: register machine id - command: dmidecode -s system-uuid + command: dmidecode -s system-uuid | tr A-F a-f register: machine_uuid # NOTE(tonyb): 0 == no error, 1 == -EPERM or bad data and 2 == Command not found # 1 and 2 aren't great but shouldn't cause the deploy to fail. If we're using