diff options
Diffstat (limited to 'network')
-rw-r--r-- | network/ports/net_ip_list_map.yaml | 27 | ||||
-rw-r--r-- | network/service_net_map.j2.yaml (renamed from network/service_net_map.yaml) | 21 |
2 files changed, 41 insertions, 7 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]} diff --git a/network/service_net_map.yaml b/network/service_net_map.j2.yaml index 6e5c2449..c4d86fb9 100644 --- a/network/service_net_map.yaml +++ b/network/service_net_map.j2.yaml @@ -8,9 +8,17 @@ parameters: description: Mapping of service_name -> network name. Typically set via parameter_defaults in the resource registry. This mapping overrides those in ServiceNetMapDefaults. + Note that the key in this map must match the service_name + in the service template, e.g if the service_name is heat_api + the key must be either heat_api_network, or optionally + HeatApiNetwork (which will be internally converted to + transform captalization to underscores). default: {} type: json + # Note that the key in this map must match the service_name + # see the description above about conversion from CamelCase to + # snake_case - the names must still match when converted ServiceNetMapDefaults: default: ApacheNetwork: internal_api @@ -46,13 +54,14 @@ parameters: CephClusterNetwork: storage_mgmt CephMonNetwork: storage CephRgwNetwork: storage - ControllerHostnameResolveNetwork: internal_api - ComputeHostnameResolveNetwork: internal_api - BlockStorageHostnameResolveNetwork: internal_api - ObjectStorageHostnameResolveNetwork: internal_api - CephStorageHostnameResolveNetwork: storage PublicNetwork: external - OpenDaylightApiNetwork: internal_api + OpendaylightApiNetwork: internal_api + # We special-case the default ResolveNetwork for the CephStorage role + # for backwards compatibility, all other roles default to internal_api + CephStorageHostnameResolveNetwork: storage +{% for role in roles if role.name != 'CephStorage' %} + {{role.name}}HostnameResolveNetwork: internal_api +{% endfor %} description: Mapping of service_name -> network name. Typically set via parameter_defaults in the resource registry. type: json |