Fall back service_net_map to ctlplane

Render the service_net_map to fall back to the ctlplane network when
networks are disabled (or not defined) in network_data.yaml.

Also use startswith for Ceph roles which should all have 'storage'
as the HostnameResolveNetwork.

Closes-Bug: #1809313
Change-Id: I737d5656b113f7e2238fe7bb555cc2d4cb13877c
This commit is contained in:
Harald Jensås 2019-01-02 13:11:46 +01:00
parent 2ca3c7c94c
commit 3df5f8db1e

View File

@ -1,3 +1,24 @@
{%- set _service_nets = {} -%}
{%- for network in networks if network.enabled|default(true) -%}
{%- if network.name == 'InternalApi' -%}
{%- set _service_nets = _service_nets.update({'internal_api': 'internal_api'}) -%}
{%- endif -%}
{%- if network.name == 'External' -%}
{%- set _service_nets = _service_nets.update({'external': 'external'}) -%}
{%- endif -%}
{%- if network.name == 'Tenant' -%}
{%- set _service_nets = _service_nets.update({'tenant': 'tenant'}) -%}
{%- endif -%}
{%- if network.name == 'Storage' -%}
{%- set _service_nets = _service_nets.update({'storage': 'storage'}) -%}
{%- endif -%}
{%- if network.name == 'StorageMgmt' -%}
{%- set _service_nets = _service_nets.update({'storage_mgmt': 'storage_mgmt'}) -%}
{%- endif -%}
{%- if network.name == 'StorageNFS' -%}
{%- set _service_nets = _service_nets.update({'storage_nfs': 'storage_nfs'}) -%}
{%- endif -%}
{%- endfor -%}
heat_template_version: rocky
description: >
@ -24,72 +45,75 @@ parameters:
# Note the values in this map are replaced by *NetName
# to allow for sane defaults when the network names are
# overridden.
ApacheNetwork: internal_api
NeutronTenantNetwork: tenant
AodhApiNetwork: internal_api
PankoApiNetwork: internal_api
BarbicanApiNetwork: internal_api
GnocchiApiNetwork: internal_api
CinderApiNetwork: internal_api
CinderIscsiNetwork: storage
CongressApiNetwork: internal_api
GlanceApiNetwork: internal_api
ApacheNetwork: {{ _service_nets.get('internal_api', 'ctlplane') }}
NeutronTenantNetwork: {{ _service_nets.get('tenant', 'ctlplane') }}
AodhApiNetwork: {{ _service_nets.get('internal_api', 'ctlplane') }}
PankoApiNetwork: {{ _service_nets.get('internal_api', 'ctlplane') }}
BarbicanApiNetwork: {{ _service_nets.get('internal_api', 'ctlplane') }}
GnocchiApiNetwork: {{ _service_nets.get('internal_api', 'ctlplane') }}
MongodbNetwork: {{ _service_nets.get('internal_api', 'ctlplane') }}
CinderApiNetwork: {{ _service_nets.get('internal_api', 'ctlplane') }}
CinderIscsiNetwork: {{ _service_nets.get('storage', 'ctlplane') }}
CongressApiNetwork: {{ _service_nets.get('internal_api', 'ctlplane') }}
GlanceApiNetwork: {{ _service_nets.get('internal_api', 'ctlplane') }}
IronicApiNetwork: ctlplane
IronicNetwork: ctlplane
IronicInspectorNetwork: ctlplane
KeystoneAdminApiNetwork: ctlplane # allows undercloud to config endpoints
KeystonePublicApiNetwork: internal_api
ManilaApiNetwork: internal_api
MetricsQdrNetwork: internal_api
NeutronApiNetwork: internal_api
OctaviaApiNetwork: internal_api
HeatApiNetwork: internal_api
HeatApiCfnNetwork: internal_api
HeatApiCloudwatchNetwork: internal_api
NovaApiNetwork: internal_api
NovaPlacementNetwork: internal_api
NovaMetadataNetwork: internal_api
NovaVncProxyNetwork: internal_api
NovaLibvirtNetwork: internal_api
NovajoinNetwork: internal_api
Ec2ApiNetwork: internal_api
Ec2ApiMetadataNetwork: internal_api
TackerApiNetwork: internal_api
SwiftStorageNetwork: storage_mgmt
SwiftProxyNetwork: storage
SaharaApiNetwork: internal_api
HorizonNetwork: internal_api
MemcachedNetwork: internal_api
OsloMessagingRpcNetwork: internal_api
OsloMessagingNotifyNetwork: internal_api
RabbitmqNetwork: internal_api
QdrNetwork: internal_api
RedisNetwork: internal_api
GaneshaNetwork: storage_nfs
MysqlNetwork: internal_api
KeystonePublicApiNetwork: {{ _service_nets.get('internal_api', 'ctlplane') }}
ManilaApiNetwork: {{ _service_nets.get('internal_api', 'ctlplane') }}
MetricsQdrNetwork: {{ _service_nets.get('internal_api', 'ctlplane') }}
NeutronApiNetwork: {{ _service_nets.get('internal_api', 'ctlplane') }}
OctaviaApiNetwork: {{ _service_nets.get('internal_api', 'ctlplane') }}
HeatApiNetwork: {{ _service_nets.get('internal_api', 'ctlplane') }}
HeatApiCfnNetwork: {{ _service_nets.get('internal_api', 'ctlplane') }}
HeatApiCloudwatchNetwork: {{ _service_nets.get('internal_api', 'ctlplane') }}
NovaApiNetwork: {{ _service_nets.get('internal_api', 'ctlplane') }}
NovaPlacementNetwork: {{ _service_nets.get('internal_api', 'ctlplane') }}
NovaMetadataNetwork: {{ _service_nets.get('internal_api', 'ctlplane') }}
NovaVncProxyNetwork: {{ _service_nets.get('internal_api', 'ctlplane') }}
NovaLibvirtNetwork: {{ _service_nets.get('internal_api', 'ctlplane') }}
NovajoinNetwork: {{ _service_nets.get('internal_api', 'ctlplane') }}
Ec2ApiNetwork: {{ _service_nets.get('internal_api', 'ctlplane') }}
Ec2ApiMetadataNetwork: {{ _service_nets.get('internal_api', 'ctlplane') }}
TackerApiNetwork: {{ _service_nets.get('internal_api', 'ctlplane') }}
SwiftStorageNetwork: {{ _service_nets.get('storage_mgmt', 'ctlplane') }}
SwiftProxyNetwork: {{ _service_nets.get('storage', 'ctlplane') }}
SaharaApiNetwork: {{ _service_nets.get('internal_api', 'ctlplane') }}
HorizonNetwork: {{ _service_nets.get('internal_api', 'ctlplane') }}
MemcachedNetwork: {{ _service_nets.get('internal_api', 'ctlplane') }}
OsloMessagingRpcNetwork: {{ _service_nets.get('internal_api', 'ctlplane') }}
OsloMessagingNotifyNetwork: {{ _service_nets.get('internal_api', 'ctlplane') }}
RabbitmqNetwork: {{ _service_nets.get('internal_api', 'ctlplane') }}
QdrNetwork: {{ _service_nets.get('internal_api', 'ctlplane') }}
RedisNetwork: {{ _service_nets.get('internal_api', 'ctlplane') }}
GaneshaNetwork: {{ _service_nets.get('storage_nfs', 'ctlplane') }}
MysqlNetwork: {{ _service_nets.get('internal_api', 'ctlplane') }}
SnmpdNetwork: ctlplane
CephClusterNetwork: storage_mgmt
CephMonNetwork: storage
CephRgwNetwork: storage
PublicNetwork: external
OpendaylightApiNetwork: internal_api
OvnDbsNetwork: internal_api
MistralApiNetwork: internal_api
ZaqarApiNetwork: internal_api
CephClusterNetwork: {{ _service_nets.get('storage_mgmt', 'ctlplane') }}
CephMonNetwork: {{ _service_nets.get('storage', 'ctlplane') }}
CephRgwNetwork: {{ _service_nets.get('storage', 'ctlplane') }}
PublicNetwork: {{ _service_nets.get('external', 'ctlplane') }}
OpendaylightApiNetwork: {{ _service_nets.get('internal_api', 'ctlplane') }}
OvnDbsNetwork: {{ _service_nets.get('internal_api', 'ctlplane') }}
MistralApiNetwork: {{ _service_nets.get('internal_api', 'ctlplane') }}
ZaqarApiNetwork: {{ _service_nets.get('internal_api', 'ctlplane') }}
DockerRegistryNetwork: ctlplane
PacemakerRemoteNetwork: internal_api
TripleoUINetwork: internal_api
DesignateApiNetwork: internal_api
BINDNetwork: external
# We special-case the default ResolveNetwork for the CephStorage role
PacemakerRemoteNetwork: {{ _service_nets.get('internal_api', 'ctlplane') }}
TripleoUINetwork: {{ _service_nets.get('internal_api', 'ctlplane') }}
DesignateApiNetwork: {{ _service_nets.get('internal_api', 'ctlplane') }}
BINDNetwork: {{ _service_nets.get('external', 'ctlplane') }}
EtcdNetwork: {{ _service_nets.get('internal_api', 'ctlplane') }}
OpenshiftMasterNetwork: {{ _service_nets.get('internal_api', 'ctlplane') }}
OpenshiftInfraNetwork: {{ _service_nets.get('internal_api', 'ctlplane') }}
# We special-case the default ResolveNetwork for the Ceph roles
# for backwards compatibility, all other roles default to internal_api
CephStorageHostnameResolveNetwork: storage
EtcdNetwork: internal_api
OpenshiftMasterNetwork: internal_api
OpenshiftInfraNetwork: internal_api
{% for role in roles if role.name != 'CephStorage' %}
{{role.name}}HostnameResolveNetwork: internal_api
{% endfor %}
{%- for role in roles if role.name.startswith('Ceph') %}
{{role.name}}HostnameResolveNetwork: {{ _service_nets.get('storage', 'ctlplane') }}
{%- endfor %}
{%- for role in roles if not role.name.startswith('Ceph') %}
{{role.name}}HostnameResolveNetwork: {{ _service_nets.get('internal_api', 'ctlplane') }}
{%- endfor %}
description: Mapping of service_name -> network name. Typically set
via parameter_defaults in the resource registry.
type: json