diff options
author | Steven Hardy <shardy@redhat.com> | 2016-09-28 16:19:56 +0100 |
---|---|---|
committer | Juan Antonio Osorio Robles <jaosorior@redhat.com> | 2016-10-05 16:24:54 +0300 |
commit | 6a408ff27e6fd6bff0a822f225c77a76690f805a (patch) | |
tree | 80f1c45d5e706562d7aa071d14d5954e9805325d /network | |
parent | 0e842bb82cbff42b9f3c8cefbeb152a5d15f29de (diff) |
Select per-network hostnames for service_node_names
Co-Authored-By: Juan Antonio Osorio Robles <jaosorior@redhat.com>
Depends-On: Ic6fec1057439ed9122d44ef294be890d3ff8a8ee
Change-Id: I754c4a41d8a294a4c7c18bd282ae014efd4b9b16
Closes-Bug: #1628521
Diffstat (limited to 'network')
-rw-r--r-- | network/ports/net_ip_list_map.yaml | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/network/ports/net_ip_list_map.yaml b/network/ports/net_ip_list_map.yaml index 346059f2..d7863e02 100644 --- a/network/ports/net_ip_list_map.yaml +++ b/network/ports/net_ip_list_map.yaml @@ -31,6 +31,9 @@ parameters: ServiceHostnameList: default: [] type: comma_delimited_list + NetworkHostnameMap: + default: [] + type: json resources: # This adds the extra "services" on for keystone @@ -101,6 +104,28 @@ outputs: description: > Map of enabled services to a list of hostnames where they're running value: + map_replace: + - yaql: + # This filters any entries where the value hasn't been substituted for + # a list, e.g it's still $service_network. This happens when there is + # no network defined for the service in the ServiceNetMap, which is OK + # as not all services have to be bound to a network, so we filter them + expression: dict($.data.map.items().where(not $[1].endsWith("_network"))) + data: + map: + map_replace: + - map_merge: + repeat: + template: + SERVICE_node_names: SERVICE_network + for_each: + SERVICE: {get_attr: [EnabledServicesValue, value]} + - values: {get_param: ServiceNetMap} + - values: {get_param: NetworkHostnameMap} + short_service_hostnames: + description: > + Map of enabled services to a list of hostnames where they're running regardless of the network + value: yaql: # If ServiceHostnameList is empty the role is deployed with zero nodes # therefore we don't want to add any *_node_names to the map @@ -110,6 +135,6 @@ outputs: map_merge: repeat: template: - SERVICE_node_names: {get_param: ServiceHostnameList} + SERVICE_short_node_names: {get_param: ServiceHostnameList} for_each: SERVICE: {get_attr: [EnabledServicesValue, value]} |