Merge "Corrected wrong os_region_name in glance-api conf file"
[apex-tripleo-heat-templates.git] / network / ports / net_ip_list_map.yaml
index 5782bbe..a9111ed 100644 (file)
@@ -1,4 +1,4 @@
-heat_template_version: ocata
+heat_template_version: pike
 
 parameters:
   ControlPlaneIpList:
@@ -35,6 +35,32 @@ parameters:
     default: []
     type: json
 
+  InternalApiNetName:
+    default: internal_api
+    description: The name of the internal API network.
+    type: string
+  ExternalNetName:
+    default: external
+    description: The name of the external network.
+    type: string
+  ManagementNetName:
+    default: management
+    description: The name of the management network.
+    type: string
+  StorageNetName:
+    default: storage
+    description: The name of the storage network.
+    type: string
+  StorageMgmtNetName:
+    default: storage_mgmt
+    description: The name of the Storage management network.
+    type: string
+  TenantNetName:
+    default: tenant
+    description: The name of the tenant network.
+    type: string
+
+
 resources:
    # This adds the extra "services" on for keystone
    # so that keystone_admin_api_network and
@@ -58,19 +84,33 @@ resources:
                 - keystone_admin_api
                 - keystone_public_api
 
+  NetIpMapValue:
+    type: OS::Heat::Value
+    properties:
+      type: json
+      value:
+        map_replace:
+          - ctlplane: {get_param: ControlPlaneIpList}
+            external: {get_param: ExternalIpList}
+            internal_api: {get_param: InternalApiIpList}
+            storage: {get_param: StorageIpList}
+            storage_mgmt: {get_param: StorageMgmtIpList}
+            tenant: {get_param: TenantIpList}
+            management: {get_param: ManagementIpList}
+          - keys:
+              external: {get_param: ExternalNetName}
+              internal_api: {get_param: InternalApiNetName}
+              storage: {get_param: StorageNetName}
+              storage_mgmt: {get_param: StorageMgmtNetName}
+              tenant: {get_param: TenantNetName}
+              management: {get_param: ManagementNetName}
+
 outputs:
   net_ip_map:
     description: >
       A Hash containing a mapping of network names to assigned lists
       of IP addresses.
-    value:
-      ctlplane: {get_param: ControlPlaneIpList}
-      external: {get_param: ExternalIpList}
-      internal_api: {get_param: InternalApiIpList}
-      storage: {get_param: StorageIpList}
-      storage_mgmt: {get_param: StorageMgmtIpList}
-      tenant: {get_param: TenantIpList}
-      management: {get_param: ManagementIpList}
+    value: {get_attr: [NetIpMapValue, value]}
   service_ips:
     description: >
       Map of enabled services to a list of their IP addresses
@@ -92,14 +132,21 @@ outputs:
                         for_each:
                           SERVICE: {get_attr: [EnabledServicesValue, value]}
                   - values: {get_param: ServiceNetMap}
-              - values:
-                  ctlplane: {get_param: ControlPlaneIpList}
-                  external: {get_param: ExternalIpList}
-                  internal_api: {get_param: InternalApiIpList}
-                  storage: {get_param: StorageIpList}
-                  storage_mgmt: {get_param: StorageMgmtIpList}
-                  tenant: {get_param: TenantIpList}
-                  management: {get_param: ManagementIpList}
+              - values: {get_attr: [NetIpMapValue, value]}
+  ctlplane_service_ips:
+    description: >
+      Map of enabled services to a list of their ctlplane IP addresses
+    value:
+      yaql:
+        expression: dict($.data.map.items().where(len($[1]) > 0))
+        data:
+          map:
+            map_merge:
+              repeat:
+                template:
+                  SERVICE_ctlplane_node_ips: {get_param: ControlPlaneIpList}
+                for_each:
+                  SERVICE: {get_attr: [EnabledServicesValue, value]}
   service_hostnames:
     description: >
       Map of enabled services to a list of hostnames where they're running