From dc3781778e1fef0fcb0e969d821d36b0fe03a6da Mon Sep 17 00:00:00 2001 From: Alex Schultz Date: Mon, 9 Apr 2018 09:35:43 -0600 Subject: [PATCH] Sanitize the uuid string dmidecode can return some additional data if SMBIOS is updated. Let's ensure that the expected output matches the expected UUID format. The expected string from the 'dmidecode --s system-uuid' call should look like "79287E4C-2FBF-11B2-A85C-EB9FB9250CBA". Change-Id: Ib0d19e64b2f24f4a9229f8868795e8979e267f04 Closes-Bug: #1762460 --- puppet/extraconfig/pre_deploy/per_node.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/puppet/extraconfig/pre_deploy/per_node.yaml b/puppet/extraconfig/pre_deploy/per_node.yaml index c39b4857d9..885e57f325 100644 --- a/puppet/extraconfig/pre_deploy/per_node.yaml +++ b/puppet/extraconfig/pre_deploy/per_node.yaml @@ -29,7 +29,7 @@ resources: - name: node_lookup config: | #!/bin/sh - node_id=$(dmidecode --s system-uuid) + node_id=$(dmidecode --s system-uuid | awk 'match($0, /[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}/) { print substr($0, RSTART, RLENGTH) }') # Create a /etc/puppet/hieradata/UUID.json file to provide # the data of the NodeDataLookup parameter that matches the