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