Sort overcloud inventory hosts and groups

This provides a more predictable and stable ordering for the inventory
generated via 'kayobe overcloud inventory discover'.

TrivialFix

Change-Id: Ie784b7e91cd70ed5c552723789958e32724b17a8
This commit is contained in:
Mark Goddard 2019-08-12 18:14:49 +01:00
parent 5a473202b7
commit a1addc3565

View File

@ -37,10 +37,10 @@
{% set ignore_hosts = overcloud_group_hosts_map.get("ignore", []) %} {% set ignore_hosts = overcloud_group_hosts_map.get("ignore", []) %}
{# Add a section for each group. #} {# Add a section for each group. #}
{% for group in overcloud_groups %} {% for group in overcloud_groups | sort %}
[{{ group }}] [{{ group }}]
{% set group_hosts = overcloud_group_hosts_map.get(group, []) %} {% set group_hosts = overcloud_group_hosts_map.get(group, []) %}
{% for host in ironic_inventory.baremetal.hosts %} {% for host in ironic_inventory.baremetal.hosts | sort %}
{% if (host in group_hosts or {% if (host in group_hosts or
(group == overcloud_group_default and host not in all_mapped_hosts)) (group == overcloud_group_default and host not in all_mapped_hosts))
and host not in ignore_hosts %} and host not in ignore_hosts %}