Switch to net-config-multinode
[apex-tripleo-heat-templates.git] / network / ports / net_ip_list_map.yaml
index 346059f..5782bbe 100644 (file)
@@ -1,4 +1,4 @@
-heat_template_version: 2016-10-14
+heat_template_version: ocata
 
 parameters:
   ControlPlaneIpList:
@@ -31,6 +31,9 @@ parameters:
   ServiceHostnameList:
     default: []
     type: comma_delimited_list
+  NetworkHostnameMap:
+    default: []
+    type: json
 
 resources:
    # This adds the extra "services" on for keystone
@@ -100,6 +103,45 @@ outputs:
   service_hostnames:
     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
+        expression: dict($.data.map.items().where(len($[1]) > 0))
+        data:
+          map:
+            map_merge:
+              repeat:
+                template:
+                  SERVICE_short_node_names: {get_param: ServiceHostnameList}
+                for_each:
+                    SERVICE: {get_attr: [EnabledServicesValue, value]}
+  short_service_bootstrap_hostnames:
+    description: >
+      Map of enabled services to a list of hostnames where they're running regardless of the network
+      Used for bootstrap purposes
     value:
       yaql:
         # If ServiceHostnameList is empty the role is deployed with zero nodes
@@ -110,6 +152,6 @@ outputs:
             map_merge:
               repeat:
                 template:
-                  SERVICE_node_names: {get_param: ServiceHostnameList}
+                  SERVICE_short_bootstrap_node_name: {get_param: ServiceHostnameList}
                 for_each:
                     SERVICE: {get_attr: [EnabledServicesValue, value]}