From 71b21675954a1c82924646c8034425eb53092daf Mon Sep 17 00:00:00 2001 From: Steven Hardy Date: Sun, 28 Aug 2016 13:47:56 +0100 Subject: Create NetIpListMap for all roles This allows us to create $service_node_ips and $service_node_names hiera entries for services not deployed on the Controller role. Co-Authored-By: Thomas Herve Change-Id: I688618dda05ff908293c32b9d8518697d57e9eb0 Partially-Implements: blueprint custom-roles --- network/ports/net_ip_list_map.yaml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'network/ports') diff --git a/network/ports/net_ip_list_map.yaml b/network/ports/net_ip_list_map.yaml index 430158ac..07e2de4c 100644 --- a/network/ports/net_ip_list_map.yaml +++ b/network/ports/net_ip_list_map.yaml @@ -78,9 +78,15 @@ outputs: description: > Map of enabled services to a list of hostnames where they're running value: - map_merge: - repeat: - template: - SERVICE_node_names: {get_param: ServiceHostnameList} - for_each: - SERVICE: {get_param: EnabledServices} + 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 + expression: dict($.data.map.items().where(len($[1]) > 0)) + data: + map: + map_merge: + repeat: + template: + SERVICE_node_names: {get_param: ServiceHostnameList} + for_each: + SERVICE: {get_param: EnabledServices} -- cgit 1.2.3-korg