Merge "Bind MySQL address to hostname appropriate to its network"
[apex-tripleo-heat-templates.git] / puppet / controller.yaml
1 heat_template_version: 2016-10-14
2
3 description: >
4   OpenStack controller node configured by Puppet.
5
6 parameters:
7   controllerExtraConfig:
8     default: {}
9     description: |
10       Deprecated. Use ControllerExtraConfig via parameter_defaults instead.
11     type: json
12   ControllerExtraConfig:
13     default: {}
14     description: |
15       Controller specific hiera configuration data to inject into the cluster.
16     type: json
17   ControllerIPs:
18     default: {}
19     description: >
20       A network mapped list of IPs to assign to Controllers in the following form:
21       {
22         "internal_api": ["a.b.c.d", "e.f.g.h"],
23         ...
24       }
25     type: json
26   Debug:
27     default: ''
28     description: Set to True to enable debugging on all services.
29     type: string
30   EnableLoadBalancer:
31     default: true
32     description: Whether to deploy a LoadBalancer on the Controller
33     type: boolean
34   ExtraConfig:
35     default: {}
36     description: |
37       Additional hieradata to inject into the cluster, note that
38       ControllerExtraConfig takes precedence over ExtraConfig.
39     type: json
40   OvercloudControlFlavor:
41     description: Flavor for control nodes to request when deploying.
42     default: baremetal
43     type: string
44     constraints:
45       - custom_constraint: nova.flavor
46   controllerImage:
47     type: string
48     default: overcloud-full
49     constraints:
50       - custom_constraint: glance.image
51   ImageUpdatePolicy:
52     default: 'REBUILD_PRESERVE_EPHEMERAL'
53     description: What policy to use when reconstructing instances. REBUILD for rebuilds, REBUILD_PRESERVE_EPHEMERAL to preserve /mnt.
54     type: string
55   KeyName:
56     default: default
57     description: Name of an existing Nova key pair to enable SSH access to the instances
58     type: string
59     constraints:
60       - custom_constraint: nova.keypair
61   NeutronPublicInterface:
62     default: nic1
63     description: What interface to bridge onto br-ex for network nodes.
64     type: string
65   ServiceNetMap:
66     default: {}
67     description: Mapping of service_name -> network name. Typically set
68                  via parameter_defaults in the resource registry.
69     type: json
70   EndpointMap:
71     default: {}
72     description: Mapping of service endpoint -> protocol. Typically set
73                  via parameter_defaults in the resource registry.
74     type: json
75   UpdateIdentifier:
76     default: ''
77     type: string
78     description: >
79       Setting to a previously unused value during stack-update will trigger
80       package update on all nodes
81   Hostname:
82     type: string
83     default: '' # Defaults to Heat created hostname
84   HostnameMap:
85     type: json
86     default: {}
87     description: Optional mapping to override hostnames
88   NetworkDeploymentActions:
89     type: comma_delimited_list
90     description: >
91       Heat action when to apply network configuration changes
92     default: ['CREATE']
93   NodeIndex:
94     type: number
95     default: 0
96   SoftwareConfigTransport:
97     default: POLL_SERVER_CFN
98     description: |
99       How the server should receive the metadata required for software configuration.
100     type: string
101     constraints:
102     - allowed_values: [POLL_SERVER_CFN, POLL_SERVER_HEAT, POLL_TEMP_URL, ZAQAR_MESSAGE]
103   CloudDomain:
104     type: string
105     description: >
106       The DNS domain used for the hosts. This should match the dhcp_domain
107       configured in the Undercloud neutron. Defaults to localdomain.
108   ServerMetadata:
109     default: {}
110     description: >
111       Extra properties or metadata passed to Nova for the created nodes in
112       the overcloud. It's accessible via the Nova metadata API.
113     type: json
114   ControllerSchedulerHints:
115     type: json
116     description: Optional scheduler hints to pass to nova
117     default: {}
118   ServiceConfigSettings:
119     type: json
120     default: {}
121   ServiceNames:
122     type: comma_delimited_list
123     default: []
124   MonitoringSubscriptions:
125     type: comma_delimited_list
126     default: []
127   ConfigCommand:
128     type: string
129     description: Command which will be run whenever configuration data changes
130     default: os-refresh-config --timeout 14400
131   LoggingSources:
132     type: json
133     default: []
134   LoggingGroups:
135     type: comma_delimited_list
136     default: []
137
138 parameter_groups:
139 - label: deprecated
140   description: Do not use deprecated params, they will be removed.
141   parameters:
142   - controllerExtraConfig
143
144 resources:
145
146   Controller:
147     type: OS::TripleO::Server
148     metadata:
149       os-collect-config:
150         command: {get_param: ConfigCommand}
151     properties:
152       image: {get_param: controllerImage}
153       image_update_policy: {get_param: ImageUpdatePolicy}
154       flavor: {get_param: OvercloudControlFlavor}
155       key_name: {get_param: KeyName}
156       networks:
157         - network: ctlplane
158       user_data_format: SOFTWARE_CONFIG
159       user_data: {get_resource: UserData}
160       name:
161         str_replace:
162             template: {get_param: Hostname}
163             params: {get_param: HostnameMap}
164       software_config_transport: {get_param: SoftwareConfigTransport}
165       metadata: {get_param: ServerMetadata}
166       scheduler_hints: {get_param: ControllerSchedulerHints}
167
168   # Combine the NodeAdminUserData and NodeUserData mime archives
169   UserData:
170     type: OS::Heat::MultipartMime
171     properties:
172       parts:
173       - config: {get_resource: NodeAdminUserData}
174         type: multipart
175       - config: {get_resource: NodeUserData}
176         type: multipart
177
178   # Creates the "heat-admin" user if configured via the environment
179   # Should return a OS::Heat::MultipartMime reference via OS::stack_id
180   NodeAdminUserData:
181     type: OS::TripleO::NodeAdminUserData
182
183   # For optional operator additional userdata
184   # Should return a OS::Heat::MultipartMime reference via OS::stack_id
185   NodeUserData:
186     type: OS::TripleO::NodeUserData
187
188   ExternalPort:
189     type: OS::TripleO::Controller::Ports::ExternalPort
190     properties:
191       IPPool: {get_param: ControllerIPs}
192       NodeIndex: {get_param: NodeIndex}
193       ControlPlaneIP: {get_attr: [Controller, networks, ctlplane, 0]}
194
195   InternalApiPort:
196     type: OS::TripleO::Controller::Ports::InternalApiPort
197     properties:
198       IPPool: {get_param: ControllerIPs}
199       NodeIndex: {get_param: NodeIndex}
200       ControlPlaneIP: {get_attr: [Controller, networks, ctlplane, 0]}
201
202   StoragePort:
203     type: OS::TripleO::Controller::Ports::StoragePort
204     properties:
205       IPPool: {get_param: ControllerIPs}
206       NodeIndex: {get_param: NodeIndex}
207       ControlPlaneIP: {get_attr: [Controller, networks, ctlplane, 0]}
208
209   StorageMgmtPort:
210     type: OS::TripleO::Controller::Ports::StorageMgmtPort
211     properties:
212       IPPool: {get_param: ControllerIPs}
213       NodeIndex: {get_param: NodeIndex}
214       ControlPlaneIP: {get_attr: [Controller, networks, ctlplane, 0]}
215
216   TenantPort:
217     type: OS::TripleO::Controller::Ports::TenantPort
218     properties:
219       IPPool: {get_param: ControllerIPs}
220       NodeIndex: {get_param: NodeIndex}
221       ControlPlaneIP: {get_attr: [Controller, networks, ctlplane, 0]}
222
223   ManagementPort:
224     type: OS::TripleO::Controller::Ports::ManagementPort
225     properties:
226       IPPool: {get_param: ControllerIPs}
227       NodeIndex: {get_param: NodeIndex}
228       ControlPlaneIP: {get_attr: [Controller, networks, ctlplane, 0]}
229
230   NetIpMap:
231     type: OS::TripleO::Network::Ports::NetIpMap
232     properties:
233       ControlPlaneIp: {get_attr: [Controller, networks, ctlplane, 0]}
234       ExternalIp: {get_attr: [ExternalPort, ip_address]}
235       ExternalIpSubnet: {get_attr: [ExternalPort, ip_subnet]}
236       ExternalIpUri: {get_attr: [ExternalPort, ip_address_uri]}
237       InternalApiIp: {get_attr: [InternalApiPort, ip_address]}
238       InternalApiIpSubnet: {get_attr: [InternalApiPort, ip_subnet]}
239       InternalApiIpUri: {get_attr: [InternalApiPort, ip_address_uri]}
240       StorageIp: {get_attr: [StoragePort, ip_address]}
241       StorageIpSubnet: {get_attr: [StoragePort, ip_subnet]}
242       StorageIpUri: {get_attr: [StoragePort, ip_address_uri]}
243       StorageMgmtIp: {get_attr: [StorageMgmtPort, ip_address]}
244       StorageMgmtIpSubnet: {get_attr: [StorageMgmtPort, ip_subnet]}
245       StorageMgmtIpUri: {get_attr: [StorageMgmtPort, ip_address_uri]}
246       TenantIp: {get_attr: [TenantPort, ip_address]}
247       TenantIpSubnet: {get_attr: [TenantPort, ip_subnet]}
248       TenantIpUri: {get_attr: [TenantPort, ip_address_uri]}
249       ManagementIp: {get_attr: [ManagementPort, ip_address]}
250       ManagementIpSubnet: {get_attr: [ManagementPort, ip_subnet]}
251       ManagementIpUri: {get_attr: [ManagementPort, ip_address_uri]}
252
253   NetworkConfig:
254     type: OS::TripleO::Controller::Net::SoftwareConfig
255     properties:
256       ControlPlaneIp: {get_attr: [Controller, networks, ctlplane, 0]}
257       ExternalIpSubnet: {get_attr: [ExternalPort, ip_subnet]}
258       InternalApiIpSubnet: {get_attr: [InternalApiPort, ip_subnet]}
259       StorageIpSubnet: {get_attr: [StoragePort, ip_subnet]}
260       StorageMgmtIpSubnet: {get_attr: [StorageMgmtPort, ip_subnet]}
261       TenantIpSubnet: {get_attr: [TenantPort, ip_subnet]}
262       ManagementIpSubnet: {get_attr: [ManagementPort, ip_subnet]}
263
264   NetworkDeployment:
265     type: OS::TripleO::SoftwareDeployment
266     properties:
267       name: NetworkDeployment
268       config: {get_resource: NetworkConfig}
269       server: {get_resource: Controller}
270       actions: {get_param: NetworkDeploymentActions}
271       input_values:
272         bridge_name: br-ex
273         interface_name: {get_param: NeutronPublicInterface}
274
275   # Resource for site-specific injection of root certificate
276   NodeTLSCAData:
277     depends_on: NetworkDeployment
278     type: OS::TripleO::NodeTLSCAData
279     properties:
280       server: {get_resource: Controller}
281
282   # Resource for site-specific passing of private keys/certificates
283   NodeTLSData:
284     depends_on: NodeTLSCAData
285     type: OS::TripleO::NodeTLSData
286     properties:
287       server: {get_resource: Controller}
288       NodeIndex: {get_param: NodeIndex}
289
290
291   ControllerDeployment:
292     type: OS::TripleO::SoftwareDeployment
293     depends_on: NetworkDeployment
294     properties:
295       name: ControllerDeployment
296       config: {get_resource: ControllerConfig}
297       server: {get_resource: Controller}
298       input_values:
299         bootstack_nodeid: {get_attr: [Controller, name]}
300         enable_load_balancer: {get_param: EnableLoadBalancer}
301         enable_package_upgrade: {get_attr: [UpdateDeployment, update_managed_packages]}
302
303   # Map heat metadata into hiera datafiles
304   ControllerConfig:
305     type: OS::Heat::StructuredConfig
306     properties:
307       group: os-apply-config
308       config:
309         hiera:
310           hierarchy:
311             - '"%{::uuid}"'
312             - heat_config_%{::deploy_config_name}
313             - controller_extraconfig
314             - extraconfig
315             - service_configs
316             - service_names
317             - controller
318             - bootstrap_node # provided by BootstrapNodeConfig
319             - all_nodes # provided by allNodesConfig
320             - vip_data # provided by allNodesConfig
321             - '"%{::osfamily}"'
322             - cinder_dellsc_data # Optionally provided by ControllerExtraConfigPre
323             - cinder_netapp_data # Optionally provided by ControllerExtraConfigPre
324             - cinder_eqlx_data # Optionally provided by ControllerExtraConfigPre
325             - neutron_bigswitch_data # Optionally provided by ControllerExtraConfigPre
326             - neutron_cisco_data # Optionally provided by ControllerExtraConfigPre
327             - cisco_n1kv_data # Optionally provided by ControllerExtraConfigPre
328             - midonet_data #Optionally provided by AllNodesExtraConfig
329             - cisco_aci_data # Optionally provided by ControllerExtraConfigPre
330           merge_behavior: deeper
331           datafiles:
332             service_names:
333               mapped_data:
334                 service_names: {get_param: ServiceNames}
335                 sensu::subscriptions: {get_param: MonitoringSubscriptions}
336             service_configs:
337               mapped_data:
338                 map_replace:
339                   - {get_param: ServiceConfigSettings}
340                   - values: {get_attr: [NetIpMap, net_ip_map]}
341             controller_extraconfig:
342               mapped_data:
343                 map_merge:
344                   - {get_param: controllerExtraConfig}
345                   - {get_param: ControllerExtraConfig}
346             extraconfig:
347               mapped_data: {get_param: ExtraConfig}
348             controller:
349               mapped_data: # data supplied directly to this deployment configuration, etc
350                 bootstack_nodeid: {get_input: bootstack_nodeid}
351
352                 # Pacemaker
353                 enable_load_balancer: {get_input: enable_load_balancer}
354
355                 # Misc
356                 tripleo::haproxy::service_certificate: {get_attr: [NodeTLSData, deployed_ssl_certificate_path]}
357                 tripleo::packages::enable_upgrade: {get_input: enable_package_upgrade}
358                 tripleo::profile::base::logging::fluentd::fluentd_sources: {get_param: LoggingSources}
359                 tripleo::profile::base::logging::fluentd::fluentd_groups: {get_param: LoggingGroups}
360
361   # Hook for site-specific additional pre-deployment config, e.g extra hieradata
362   ControllerExtraConfigPre:
363     depends_on: ControllerDeployment
364     type: OS::TripleO::ControllerExtraConfigPre
365     properties:
366         server: {get_resource: Controller}
367
368   # Hook for site-specific additional pre-deployment config,
369   # applying to all nodes, e.g node registration/unregistration
370   NodeExtraConfig:
371     depends_on: [ControllerExtraConfigPre, NodeTLSData]
372     type: OS::TripleO::NodeExtraConfig
373     properties:
374         server: {get_resource: Controller}
375
376   UpdateConfig:
377     type: OS::TripleO::Tasks::PackageUpdate
378
379   UpdateDeployment:
380     type: OS::Heat::SoftwareDeployment
381     properties:
382       name: UpdateDeployment
383       config: {get_resource: UpdateConfig}
384       server: {get_resource: Controller}
385       input_values:
386         update_identifier:
387           get_param: UpdateIdentifier
388
389 outputs:
390   ip_address:
391     description: IP address of the server in the ctlplane network
392     value: {get_attr: [Controller, networks, ctlplane, 0]}
393   external_ip_address:
394     description: IP address of the server in the external network
395     value: {get_attr: [ExternalPort, ip_address]}
396   internal_api_ip_address:
397     description: IP address of the server in the internal_api network
398     value: {get_attr: [InternalApiPort, ip_address]}
399   storage_ip_address:
400     description: IP address of the server in the storage network
401     value: {get_attr: [StoragePort, ip_address]}
402   storage_mgmt_ip_address:
403     description: IP address of the server in the storage_mgmt network
404     value: {get_attr: [StorageMgmtPort, ip_address]}
405   tenant_ip_address:
406     description: IP address of the server in the tenant network
407     value: {get_attr: [TenantPort, ip_address]}
408   management_ip_address:
409     description: IP address of the server in the management network
410     value: {get_attr: [ManagementPort, ip_address]}
411   hostname:
412     description: Hostname of the server
413     value: {get_attr: [Controller, name]}
414   hosts_entry:
415     description: >
416       Server's IP address and hostname in the /etc/hosts format
417     value:
418       str_replace:
419         template: |
420           PRIMARYIP PRIMARYHOST.DOMAIN PRIMARYHOST
421           EXTERNALIP EXTERNALHOST.DOMAIN EXTERNALHOST
422           INTERNAL_APIIP INTERNAL_APIHOST.DOMAIN INTERNAL_APIHOST
423           STORAGEIP STORAGEHOST.DOMAIN STORAGEHOST
424           STORAGE_MGMTIP STORAGE_MGMTHOST.DOMAIN STORAGE_MGMTHOST
425           TENANTIP TENANTHOST.DOMAIN TENANTHOST
426           MANAGEMENTIP MANAGEMENTHOST.DOMAIN MANAGEMENTHOST
427           CTLPLANEIP CTLPLANEHOST.DOMAIN CTLPLANEHOST
428         params:
429           PRIMARYIP: {get_attr: [NetIpMap, net_ip_map, {get_param: [ServiceNetMap, ControllerHostnameResolveNetwork]}]}
430           DOMAIN: {get_param: CloudDomain}
431           PRIMARYHOST: {get_attr: [Controller, name]}
432           EXTERNALIP: {get_attr: [ExternalPort, ip_address]}
433           EXTERNALHOST:
434             list_join:
435             - '.'
436             - - {get_attr: [Controller, name]}
437               - external
438           INTERNAL_APIIP: {get_attr: [InternalApiPort, ip_address]}
439           INTERNAL_APIHOST:
440             list_join:
441             - '.'
442             - - {get_attr: [Controller, name]}
443               - internalapi
444           STORAGEIP: {get_attr: [StoragePort, ip_address]}
445           STORAGEHOST:
446             list_join:
447             - '.'
448             - - {get_attr: [Controller, name]}
449               - storage
450           STORAGE_MGMTIP: {get_attr: [StorageMgmtPort, ip_address]}
451           STORAGE_MGMTHOST:
452             list_join:
453             - '.'
454             - - {get_attr: [Controller, name]}
455               - storagemgmt
456           TENANTIP: {get_attr: [TenantPort, ip_address]}
457           TENANTHOST:
458             list_join:
459             - '.'
460             - - {get_attr: [Controller, name]}
461               - tenant
462           MANAGEMENTIP: {get_attr: [ManagementPort, ip_address]}
463           MANAGEMENTHOST:
464             list_join:
465             - '.'
466             - - {get_attr: [Controller, name]}
467               - management
468           CTLPLANEIP: {get_attr: [Controller, networks, ctlplane, 0]}
469           CTLPLANEHOST:
470             list_join:
471             - '.'
472             - - {get_attr: [Controller, name]}
473               - ctlplane
474   nova_server_resource:
475     description: Heat resource handle for the Nova compute server
476     value:
477       {get_resource: Controller}
478   tls_key_modulus_md5:
479     description: MD5 checksum of the TLS Key Modulus
480     value: {get_attr: [NodeTLSData, key_modulus_md5]}
481   tls_cert_modulus_md5:
482     description: MD5 checksum of the TLS Certificate Modulus
483     value: {get_attr: [NodeTLSData, cert_modulus_md5]}