Add RoleNetHostnameMap output

This exposes a list of hostnames similar to the RoleNetIpMap, this
will be consumed by the dynamic inventory ref
https://review.openstack.org/465558

Change-Id: I61efac5634e9b6fbb820e693c71a0adae5fa8b6a
This commit is contained in:
Steven Hardy 2017-05-17 14:34:06 +01:00
parent f60904436d
commit 3c9733f395

View File

@ -373,7 +373,13 @@ resources:
EnabledServices: {get_attr: [{{role.name}}ServiceNames, value]} EnabledServices: {get_attr: [{{role.name}}ServiceNames, value]}
ServiceNetMap: {get_attr: [ServiceNetMap, service_net_map_lower]} ServiceNetMap: {get_attr: [ServiceNetMap, service_net_map_lower]}
ServiceHostnameList: {get_attr: [{{role.name}}, hostname]} ServiceHostnameList: {get_attr: [{{role.name}}, hostname]}
NetworkHostnameMap: NetworkHostnameMap: {get_attr: [{{role.name}}NetworkHostnameMap, value]}
{{role.name}}NetworkHostnameMap:
type: OS::Heat::Value
properties:
type: json
value:
# Note (shardy) this somewhat complex yaql may be replaced # Note (shardy) this somewhat complex yaql may be replaced
# with a map_deep_merge function in ocata. It merges the # with a map_deep_merge function in ocata. It merges the
# list of maps, but appends to colliding lists so we can # list of maps, but appends to colliding lists so we can
@ -740,4 +746,10 @@ outputs:
value: value:
{% for role in roles %} {% for role in roles %}
{{role.name}}: {get_attr: [{{role.name}}IpListMap, net_ip_map]} {{role.name}}: {get_attr: [{{role.name}}IpListMap, net_ip_map]}
{% endfor %}
RoleNetHostnameMap:
description: Mapping of each network to a list of hostnames for each role
value:
{% for role in roles %}
{{role.name}}: {get_attr: [{{role.name}}NetworkHostnameMap, value]}
{% endfor %} {% endfor %}