Merge "Populate vnc_api_lib.ini on compute nodes with OpenContrail"
[apex-tripleo-heat-templates.git] / puppet / all-nodes-config.yaml
index 69bb193..c764d4e 100644 (file)
@@ -10,7 +10,7 @@ parameters:
     type: string
   cloud_name_storage_mgmt:
     type: string
-  cloud_name_management:
+  cloud_name_ctlplane:
     type: string
   hosts:
     type: comma_delimited_list
@@ -90,6 +90,33 @@ resources:
                         for_each:
                           SERVICE:
                             str_split: [',', {get_param: enabled_services}]
+                  # Dynamically generate per-service network data
+                  # This works as follows (outer->inner functions)
+                  # yaql - filters services where no mapping exists in ServiceNetMap
+                  #   map_replace: substitute e.g heat_api_network with network name from ServiceNetMap
+                  #     map_merge/repeat: generate a per-service mapping
+                  - 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(isString($[1]) and not $[1].endsWith("_network")))
+                      data:
+                        map:
+                          map_replace:
+                            - map_merge:
+                                repeat:
+                                  template:
+                                    SERVICE_network: SERVICE_network
+                                  for_each:
+                                    SERVICE:
+                                      str_split: [',', {get_param: enabled_services}]
+                            - values: {get_param: ServiceNetMap}
+                  # Keystone doesn't provide separate entries for the public
+                  # and admin endpoints, so we need to add them here manually
+                  # like we do in the vip-config below
+                  - keystone_admin_api_network: {get_param: [ServiceNetMap, keystone_admin_api_network]}
+                    keystone_public_api_network: {get_param: [ServiceNetMap, keystone_public_api_network]}
                   # provides a mapping of service_name_ips to a list of IPs
                   - {get_param: service_ips}
                   - {get_param: service_node_names}
@@ -182,7 +209,7 @@ resources:
                     cloud_name_internal_api: {get_param: cloud_name_internal_api}
                     cloud_name_storage: {get_param: cloud_name_storage}
                     cloud_name_storage_mgmt: {get_param: cloud_name_storage_mgmt}
-                    cloud_name_management: {get_param: cloud_name_management}
+                    cloud_name_ctlplane: {get_param: cloud_name_ctlplane}
 
 outputs:
   config_id: