Add HostnameNetworkConfigMap output

This output will map server names to their NetworkConfig resource id.
This makes it easy to retrieve the NetworkConfig resource for each
server in the config-download code.

Change-Id: I315f2e2eb880e9f3cb67d9f4cdc789f08c6c4021
implements: blueprint reduce-deployment-resources
This commit is contained in:
James Slagle 2019-06-05 17:26:36 -04:00 committed by Emilien Macchi
parent 203418529a
commit d87c49f4d5
2 changed files with 15 additions and 0 deletions

View File

@ -1192,3 +1192,11 @@ outputs:
GlobalConfig:
description: The global_config (hieradata).
value: {get_attr: [GlobalConfig, value]}
HostnameNetworkConfigMap:
description: Mapping of hostname to NetworkConfig resource
value:
map_merge:
list_concat:
{%- for role in roles %}
- {get_attr: [{{role.name}}, hostname_network_config_map]}
{%- endfor %}

View File

@ -838,6 +838,13 @@ outputs:
{%- endfor %}
ctlplane: {get_attr: [NetHostMap, value, ctlplane, fqdn]}
canonical: {get_attr: [NetHostMap, value, canonical, fqdn]}
hostname_network_config_map:
description: Mapping of hostname to NetworkConfig resource
value:
map_replace:
- HOSTNAME: {get_resource: NetworkConfig}
- keys:
HOSTNAME: {get_attr:[{{server_resource_name}}, name]}
hosts_entry:
value:
str_replace: