Sanitize the uuid string for ceph-ansible
dmidecode can return some additional data if SMBIOS is updated; this ensures output matches the UUID format. Change-Id: I5c61c0049bfd16114894cf4db3b79f94b6d9291b Related-Bug: 1762460
This commit is contained in:
parent
94203f0447
commit
ad803ab716
|
@ -446,7 +446,8 @@ outputs:
|
||||||
set_fact:
|
set_fact:
|
||||||
nodes_data: "{% raw %}{{ lookup('file','./nodes_uuid_data.json') | from_json }}{% endraw %}"
|
nodes_data: "{% raw %}{{ lookup('file','./nodes_uuid_data.json') | from_json }}{% endraw %}"
|
||||||
- name: register machine id
|
- name: register machine id
|
||||||
command: dmidecode -s system-uuid | tr A-F a-f
|
# awk strips unwanted output, see LP bug #1762460
|
||||||
|
shell: 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) }' | tr A-F a-f
|
||||||
register: machine_uuid
|
register: machine_uuid
|
||||||
# NOTE(tonyb): 0 == no error, 1 == -EPERM or bad data and 2 == Command not found
|
# 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
|
# 1 and 2 aren't great but shouldn't cause the deploy to fail. If we're using
|
||||||
|
|
Loading…
Reference in New Issue