26ff3e0a2a996238481b513e216fccc6b232ce57
[apex-tripleo-heat-templates.git] / network / service_net_map.j2.yaml
1 heat_template_version: ocata
2
3 description: >
4   Mapping of service_name_network -> network name
5
6 parameters:
7   ServiceNetMap:
8     description: Mapping of service_name -> network name. Typically set
9                  via parameter_defaults in the resource registry.  This
10                  mapping overrides those in ServiceNetMapDefaults.
11                  Note that the key in this map must match the service_name
12                  in the service template, e.g if the service_name is heat_api
13                  the key must be either heat_api_network, or optionally
14                  HeatApiNetwork (which will be internally converted to
15                  transform captalization to underscores).
16     default: {}
17     type: json
18
19   # Note that the key in this map must match the service_name
20   # see the description above about conversion from CamelCase to
21   # snake_case - the names must still match when converted
22   ServiceNetMapDefaults:
23     default:
24       # Note the values in this map are replaced by *NetName
25       # to allow for sane defaults when the network names are
26       # overridden.
27       ApacheNetwork: internal_api
28       NeutronTenantNetwork: tenant
29       CeilometerApiNetwork: internal_api
30       ContrailAnalyticsNetwork: internal_api
31       ContrailAnalyticsDatabaseNetwork: internal_api
32       ContrailConfigNetwork: internal_api
33       ContrailControlNetwork: internal_api
34       ContrailDatabaseNetwork: internal_api
35       ContrailWebuiNetwork: internal_api
36       ContrailTsnNetwork: internal_api
37       AodhApiNetwork: internal_api
38       PankoApiNetwork: internal_api
39       BarbicanApiNetwork: internal_api
40       GnocchiApiNetwork: internal_api
41       MongodbNetwork: internal_api
42       CinderApiNetwork: internal_api
43       CinderIscsiNetwork: storage
44       CongressApiNetwork: internal_api
45       GlanceApiNetwork: storage
46       IronicApiNetwork: ctlplane
47       IronicNetwork: ctlplane
48       KeystoneAdminApiNetwork: ctlplane # allows undercloud to config endpoints
49       KeystonePublicApiNetwork: internal_api
50       ManilaApiNetwork: internal_api
51       NeutronApiNetwork: internal_api
52       OctaviaApiNetwork: internal_api
53       HeatApiNetwork: internal_api
54       HeatApiCfnNetwork: internal_api
55       HeatApiCloudwatchNetwork: internal_api
56       NovaApiNetwork: internal_api
57       NovaColdMigrationNetwork: ctlplane
58       NovaPlacementNetwork: internal_api
59       NovaMetadataNetwork: internal_api
60       NovaVncProxyNetwork: internal_api
61       NovaLibvirtNetwork: internal_api
62       Ec2ApiNetwork: internal_api
63       Ec2ApiMetadataNetwork: internal_api
64       TackerApiNetwork: internal_api
65       SwiftStorageNetwork: storage_mgmt
66       SwiftProxyNetwork: storage
67       SaharaApiNetwork: internal_api
68       HorizonNetwork: internal_api
69       MemcachedNetwork: internal_api
70       RabbitmqNetwork: internal_api
71       QdrNetwork: internal_api
72       RedisNetwork: internal_api
73       MysqlNetwork: internal_api
74       CephClusterNetwork: storage_mgmt
75       CephMonNetwork: storage
76       CephRgwNetwork: storage
77       PublicNetwork: external
78       OpendaylightApiNetwork: internal_api
79       OvnDbsNetwork: internal_api
80       MistralApiNetwork: internal_api
81       ZaqarApiNetwork: internal_api
82       PacemakerRemoteNetwork: internal_api
83       # We special-case the default ResolveNetwork for the CephStorage role
84       # for backwards compatibility, all other roles default to internal_api
85       CephStorageHostnameResolveNetwork: storage
86       EtcdNetwork: internal_api
87 {% for role in roles if role.name != 'CephStorage' %}
88       {{role.name}}HostnameResolveNetwork: internal_api
89 {% endfor %}
90     description: Mapping of service_name -> network name. Typically set
91                  via parameter_defaults in the resource registry.
92     type: json
93
94   # We define mappings to work around names that break when doing the
95   # CamelCase to snake_case conversion to align with service_names
96   ServiceNetMapDeprecatedMapping:
97     default:
98       MongoDbNetwork: MongodbNetwork
99       RabbitMqNetwork: RabbitmqNetwork
100       CephPublicNetwork: CephMonNetwork
101       SwiftMgmtNetwork: SwiftStorageNetwork
102     description: Mapping older deprecated service names, intended for
103                  internal use only, this will be removed in future.
104     type: json
105
106   InternalApiNetName:
107     default: internal_api
108     description: The name of the internal API network.
109     type: string
110   ExternalNetName:
111     default: external
112     description: The name of the external network.
113     type: string
114   ManagementNetName:
115     default: management
116     description: The name of the management network.
117     type: string
118   StorageNetName:
119     default: storage
120     description: The name of the storage network.
121     type: string
122   StorageMgmtNetName:
123     default: storage_mgmt
124     description: The name of the Storage management network.
125     type: string
126   TenantNetName:
127     default: tenant
128     description: The name of the tenant network.
129     type: string
130
131
132 parameter_groups:
133 - label: deprecated
134   description: Do not use deprecated params, they will be removed.
135   parameters:
136   - ServiceNetMapDeprecatedMapping
137
138 resources:
139   ServiceNetMapValue:
140     type: OS::Heat::Value
141     properties:
142       type: json
143       value:
144         map_merge:
145           - map_replace:
146              - {get_param: ServiceNetMapDefaults}
147              - values:
148                  external: {get_param: ExternalNetName}
149                  internal_api: {get_param: InternalApiNetName}
150                  storage: {get_param: StorageNetName}
151                  storage_mgmt: {get_param: StorageMgmtNetName}
152                  tenant: {get_param: TenantNetName}
153                  management: {get_param: ManagementNetName}
154           - map_replace:
155              - {get_param: ServiceNetMap}
156              - keys: {get_param: ServiceNetMapDeprecatedMapping}
157
158
159 outputs:
160   service_net_map:
161     value: {get_attr: [ServiceNetMapValue, value]}
162
163   service_net_map_lower:
164     value:
165       # This does a conversion from CamelCase to snake_case,
166       # e.g HeatApiNetwork becomes heat_api_network so it
167       # matches the service names.
168       yaql:
169         expression: dict($.data.map.items().select([ regex(`([a-z0-9])([A-Z])`).replace($[0], '\\1_\\2').toLower(), $[1]]))
170         data:
171           map: {get_attr: [ServiceNetMapValue, value]}