Merge "Re-organizes Contrail services to the correct roles"
[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       GlanceApiNetwork: storage
45       IronicApiNetwork: ctlplane
46       IronicNetwork: ctlplane
47       KeystoneAdminApiNetwork: ctlplane # allows undercloud to config endpoints
48       KeystonePublicApiNetwork: internal_api
49       ManilaApiNetwork: internal_api
50       NeutronApiNetwork: internal_api
51       OctaviaApiNetwork: internal_api
52       HeatApiNetwork: internal_api
53       HeatApiCfnNetwork: internal_api
54       HeatApiCloudwatchNetwork: internal_api
55       NovaApiNetwork: internal_api
56       NovaPlacementNetwork: internal_api
57       NovaMetadataNetwork: internal_api
58       NovaVncProxyNetwork: internal_api
59       NovaLibvirtNetwork: internal_api
60       Ec2ApiNetwork: internal_api
61       Ec2ApiMetadataNetwork: internal_api
62       SwiftStorageNetwork: storage_mgmt
63       SwiftProxyNetwork: storage
64       SaharaApiNetwork: internal_api
65       HorizonNetwork: internal_api
66       MemcachedNetwork: internal_api
67       RabbitmqNetwork: internal_api
68       RedisNetwork: internal_api
69       MysqlNetwork: internal_api
70       CephClusterNetwork: storage_mgmt
71       CephMonNetwork: storage
72       CephRgwNetwork: storage
73       PublicNetwork: external
74       OpendaylightApiNetwork: internal_api
75       OvnDbsNetwork: internal_api
76       MistralApiNetwork: internal_api
77       ZaqarApiNetwork: internal_api
78       PacemakerRemoteNetwork: internal_api
79       # We special-case the default ResolveNetwork for the CephStorage role
80       # for backwards compatibility, all other roles default to internal_api
81       CephStorageHostnameResolveNetwork: storage
82       EtcdNetwork: internal_api
83 {% for role in roles if role.name != 'CephStorage' %}
84       {{role.name}}HostnameResolveNetwork: internal_api
85 {% endfor %}
86     description: Mapping of service_name -> network name. Typically set
87                  via parameter_defaults in the resource registry.
88     type: json
89
90   # We define mappings to work around names that break when doing the
91   # CamelCase to snake_case conversion to align with service_names
92   ServiceNetMapDeprecatedMapping:
93     default:
94       MongoDbNetwork: MongodbNetwork
95       RabbitMqNetwork: RabbitmqNetwork
96       CephPublicNetwork: CephMonNetwork
97       SwiftMgmtNetwork: SwiftStorageNetwork
98     description: Mapping older deprecated service names, intended for
99                  internal use only, this will be removed in future.
100     type: json
101
102   InternalApiNetName:
103     default: internal_api
104     description: The name of the internal API network.
105     type: string
106   ExternalNetName:
107     default: external
108     description: The name of the external network.
109     type: string
110   ManagementNetName:
111     default: management
112     description: The name of the management network.
113     type: string
114   StorageNetName:
115     default: storage
116     description: The name of the storage network.
117     type: string
118   StorageMgmtNetName:
119     default: storage_mgmt
120     description: The name of the Storage management network.
121     type: string
122   TenantNetName:
123     default: tenant
124     description: The name of the tenant network.
125     type: string
126
127
128 parameter_groups:
129 - label: deprecated
130   description: Do not use deprecated params, they will be removed.
131   parameters:
132   - ServiceNetMapDeprecatedMapping
133
134 resources:
135   ServiceNetMapValue:
136     type: OS::Heat::Value
137     properties:
138       type: json
139       value:
140         map_merge:
141           - map_replace:
142              - {get_param: ServiceNetMapDefaults}
143              - values:
144                  external: {get_param: ExternalNetName}
145                  internal_api: {get_param: InternalApiNetName}
146                  storage: {get_param: StorageNetName}
147                  storage_mgmt: {get_param: StorageMgmtNetName}
148                  tenant: {get_param: TenantNetName}
149                  management: {get_param: ManagementNetName}
150           - map_replace:
151              - {get_param: ServiceNetMap}
152              - keys: {get_param: ServiceNetMapDeprecatedMapping}
153
154
155 outputs:
156   service_net_map:
157     value: {get_attr: [ServiceNetMapValue, value]}
158
159   service_net_map_lower:
160     value:
161       # This does a conversion from CamelCase to snake_case,
162       # e.g HeatApiNetwork becomes heat_api_network so it
163       # matches the service names.
164       yaql:
165         expression: dict($.data.map.items().select([ regex(`([a-z0-9])([A-Z])`).replace($[0], '\\1_\\2').toLower(), $[1]]))
166         data:
167           map: {get_attr: [ServiceNetMapValue, value]}