Cleanup some inline comments in network/config
[apex-tripleo-heat-templates.git] / puppet / controller-role.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
132 parameter_groups:
133 - label: deprecated
134   description: Do not use deprecated params, they will be removed.
135   parameters:
136   - controllerExtraConfig
137
138 resources:
139
140   Controller:
141     type: OS::TripleO::Server
142     metadata:
143       os-collect-config:
144         command: {get_param: ConfigCommand}
145     properties:
146       image: {get_param: controllerImage}
147       image_update_policy: {get_param: ImageUpdatePolicy}
148       flavor: {get_param: OvercloudControlFlavor}
149       key_name: {get_param: KeyName}
150       networks:
151         - network: ctlplane
152       user_data_format: SOFTWARE_CONFIG
153       user_data: {get_resource: UserData}
154       name:
155         str_replace:
156             template: {get_param: Hostname}
157             params: {get_param: HostnameMap}
158       software_config_transport: {get_param: SoftwareConfigTransport}
159       metadata: {get_param: ServerMetadata}
160       scheduler_hints: {get_param: ControllerSchedulerHints}
161
162   # Combine the NodeAdminUserData and NodeUserData mime archives
163   UserData:
164     type: OS::Heat::MultipartMime
165     properties:
166       parts:
167       - config: {get_resource: NodeAdminUserData}
168         type: multipart
169       - config: {get_resource: NodeUserData}
170         type: multipart
171
172   # Creates the "heat-admin" user if configured via the environment
173   # Should return a OS::Heat::MultipartMime reference via OS::stack_id
174   NodeAdminUserData:
175     type: OS::TripleO::NodeAdminUserData
176
177   # For optional operator additional userdata
178   # Should return a OS::Heat::MultipartMime reference via OS::stack_id
179   NodeUserData:
180     type: OS::TripleO::NodeUserData
181
182   ExternalPort:
183     type: OS::TripleO::Controller::Ports::ExternalPort
184     properties:
185       IPPool: {get_param: ControllerIPs}
186       NodeIndex: {get_param: NodeIndex}
187       ControlPlaneIP: {get_attr: [Controller, networks, ctlplane, 0]}
188
189   InternalApiPort:
190     type: OS::TripleO::Controller::Ports::InternalApiPort
191     properties:
192       IPPool: {get_param: ControllerIPs}
193       NodeIndex: {get_param: NodeIndex}
194       ControlPlaneIP: {get_attr: [Controller, networks, ctlplane, 0]}
195
196   StoragePort:
197     type: OS::TripleO::Controller::Ports::StoragePort
198     properties:
199       IPPool: {get_param: ControllerIPs}
200       NodeIndex: {get_param: NodeIndex}
201       ControlPlaneIP: {get_attr: [Controller, networks, ctlplane, 0]}
202
203   StorageMgmtPort:
204     type: OS::TripleO::Controller::Ports::StorageMgmtPort
205     properties:
206       IPPool: {get_param: ControllerIPs}
207       NodeIndex: {get_param: NodeIndex}
208       ControlPlaneIP: {get_attr: [Controller, networks, ctlplane, 0]}
209
210   TenantPort:
211     type: OS::TripleO::Controller::Ports::TenantPort
212     properties:
213       IPPool: {get_param: ControllerIPs}
214       NodeIndex: {get_param: NodeIndex}
215       ControlPlaneIP: {get_attr: [Controller, networks, ctlplane, 0]}
216
217   ManagementPort:
218     type: OS::TripleO::Controller::Ports::ManagementPort
219     properties:
220       IPPool: {get_param: ControllerIPs}
221       NodeIndex: {get_param: NodeIndex}
222       ControlPlaneIP: {get_attr: [Controller, networks, ctlplane, 0]}
223
224   NetIpMap:
225     type: OS::TripleO::Network::Ports::NetIpMap
226     properties:
227       ControlPlaneIp: {get_attr: [Controller, networks, ctlplane, 0]}
228       ExternalIp: {get_attr: [ExternalPort, ip_address]}
229       ExternalIpSubnet: {get_attr: [ExternalPort, ip_subnet]}
230       ExternalIpUri: {get_attr: [ExternalPort, ip_address_uri]}
231       InternalApiIp: {get_attr: [InternalApiPort, ip_address]}
232       InternalApiIpSubnet: {get_attr: [InternalApiPort, ip_subnet]}
233       InternalApiIpUri: {get_attr: [InternalApiPort, ip_address_uri]}
234       StorageIp: {get_attr: [StoragePort, ip_address]}
235       StorageIpSubnet: {get_attr: [StoragePort, ip_subnet]}
236       StorageIpUri: {get_attr: [StoragePort, ip_address_uri]}
237       StorageMgmtIp: {get_attr: [StorageMgmtPort, ip_address]}
238       StorageMgmtIpSubnet: {get_attr: [StorageMgmtPort, ip_subnet]}
239       StorageMgmtIpUri: {get_attr: [StorageMgmtPort, ip_address_uri]}
240       TenantIp: {get_attr: [TenantPort, ip_address]}
241       TenantIpSubnet: {get_attr: [TenantPort, ip_subnet]}
242       TenantIpUri: {get_attr: [TenantPort, ip_address_uri]}
243       ManagementIp: {get_attr: [ManagementPort, ip_address]}
244       ManagementIpSubnet: {get_attr: [ManagementPort, ip_subnet]}
245       ManagementIpUri: {get_attr: [ManagementPort, ip_address_uri]}
246
247   NetworkConfig:
248     type: OS::TripleO::Controller::Net::SoftwareConfig
249     properties:
250       ControlPlaneIp: {get_attr: [Controller, networks, ctlplane, 0]}
251       ExternalIpSubnet: {get_attr: [ExternalPort, ip_subnet]}
252       InternalApiIpSubnet: {get_attr: [InternalApiPort, ip_subnet]}
253       StorageIpSubnet: {get_attr: [StoragePort, ip_subnet]}
254       StorageMgmtIpSubnet: {get_attr: [StorageMgmtPort, ip_subnet]}
255       TenantIpSubnet: {get_attr: [TenantPort, ip_subnet]}
256       ManagementIpSubnet: {get_attr: [ManagementPort, ip_subnet]}
257
258   NetworkDeployment:
259     type: OS::TripleO::SoftwareDeployment
260     properties:
261       name: NetworkDeployment
262       config: {get_resource: NetworkConfig}
263       server: {get_resource: Controller}
264       actions: {get_param: NetworkDeploymentActions}
265       input_values:
266         bridge_name: br-ex
267         interface_name: {get_param: NeutronPublicInterface}
268
269   # Resource for site-specific injection of root certificate
270   NodeTLSCAData:
271     depends_on: NetworkDeployment
272     type: OS::TripleO::NodeTLSCAData
273     properties:
274       server: {get_resource: Controller}
275
276   # Resource for site-specific passing of private keys/certificates
277   NodeTLSData:
278     depends_on: NodeTLSCAData
279     type: OS::TripleO::NodeTLSData
280     properties:
281       server: {get_resource: Controller}
282       NodeIndex: {get_param: NodeIndex}
283
284
285   ControllerDeployment:
286     type: OS::TripleO::SoftwareDeployment
287     depends_on: NetworkDeployment
288     properties:
289       name: ControllerDeployment
290       config: {get_resource: ControllerConfig}
291       server: {get_resource: Controller}
292       input_values:
293         bootstack_nodeid: {get_attr: [Controller, name]}
294         enable_load_balancer: {get_param: EnableLoadBalancer}
295         enable_package_upgrade: {get_attr: [UpdateDeployment, update_managed_packages]}
296
297   # Map heat metadata into hiera datafiles
298   ControllerConfig:
299     type: OS::Heat::StructuredConfig
300     properties:
301       group: os-apply-config
302       config:
303         hiera:
304           hierarchy:
305             - '"%{::uuid}"'
306             - heat_config_%{::deploy_config_name}
307             - controller_extraconfig
308             - extraconfig
309             - service_configs
310             - service_names
311             - controller
312             - bootstrap_node # provided by BootstrapNodeConfig
313             - all_nodes # provided by allNodesConfig
314             - vip_data # provided by allNodesConfig
315             - '"%{::osfamily}"'
316             - cinder_dellsc_data # Optionally provided by ControllerExtraConfigPre
317             - cinder_netapp_data # Optionally provided by ControllerExtraConfigPre
318             - cinder_eqlx_data # Optionally provided by ControllerExtraConfigPre
319             - neutron_bigswitch_data # Optionally provided by ControllerExtraConfigPre
320             - neutron_cisco_data # Optionally provided by ControllerExtraConfigPre
321             - cisco_n1kv_data # Optionally provided by ControllerExtraConfigPre
322             - midonet_data #Optionally provided by AllNodesExtraConfig
323             - cisco_aci_data # Optionally provided by ControllerExtraConfigPre
324           merge_behavior: deeper
325           datafiles:
326             service_names:
327               mapped_data:
328                 service_names: {get_param: ServiceNames}
329                 sensu::subscriptions: {get_param: MonitoringSubscriptions}
330             service_configs:
331               mapped_data:
332                 map_replace:
333                   - {get_param: ServiceConfigSettings}
334                   - values: {get_attr: [NetIpMap, net_ip_map]}
335             controller_extraconfig:
336               mapped_data:
337                 map_merge:
338                   - {get_param: controllerExtraConfig}
339                   - {get_param: ControllerExtraConfig}
340             extraconfig:
341               mapped_data: {get_param: ExtraConfig}
342             controller:
343               mapped_data: # data supplied directly to this deployment configuration, etc
344                 bootstack_nodeid: {get_input: bootstack_nodeid}
345
346                 # Pacemaker
347                 enable_load_balancer: {get_input: enable_load_balancer}
348
349                 # Misc
350                 tripleo::haproxy::service_certificate: {get_attr: [NodeTLSData, deployed_ssl_certificate_path]}
351                 tripleo::packages::enable_upgrade: {get_input: enable_package_upgrade}
352
353   # Hook for site-specific additional pre-deployment config, e.g extra hieradata
354   ControllerExtraConfigPre:
355     depends_on: ControllerDeployment
356     type: OS::TripleO::ControllerExtraConfigPre
357     properties:
358         server: {get_resource: Controller}
359
360   # Hook for site-specific additional pre-deployment config,
361   # applying to all nodes, e.g node registration/unregistration
362   NodeExtraConfig:
363     depends_on: [ControllerExtraConfigPre, NodeTLSData]
364     type: OS::TripleO::NodeExtraConfig
365     properties:
366         server: {get_resource: Controller}
367
368   UpdateConfig:
369     type: OS::TripleO::Tasks::PackageUpdate
370
371   UpdateDeployment:
372     type: OS::Heat::SoftwareDeployment
373     properties:
374       name: UpdateDeployment
375       config: {get_resource: UpdateConfig}
376       server: {get_resource: Controller}
377       input_values:
378         update_identifier:
379           get_param: UpdateIdentifier
380
381 outputs:
382   ip_address:
383     description: IP address of the server in the ctlplane network
384     value: {get_attr: [Controller, networks, ctlplane, 0]}
385   external_ip_address:
386     description: IP address of the server in the external network
387     value: {get_attr: [ExternalPort, ip_address]}
388   internal_api_ip_address:
389     description: IP address of the server in the internal_api network
390     value: {get_attr: [InternalApiPort, ip_address]}
391   storage_ip_address:
392     description: IP address of the server in the storage network
393     value: {get_attr: [StoragePort, ip_address]}
394   storage_mgmt_ip_address:
395     description: IP address of the server in the storage_mgmt network
396     value: {get_attr: [StorageMgmtPort, ip_address]}
397   tenant_ip_address:
398     description: IP address of the server in the tenant network
399     value: {get_attr: [TenantPort, ip_address]}
400   management_ip_address:
401     description: IP address of the server in the management network
402     value: {get_attr: [ManagementPort, ip_address]}
403   hostname:
404     description: Hostname of the server
405     value: {get_attr: [Controller, name]}
406   hostname_map:
407     description: Mapping of network names to hostnames
408     value:
409       external:
410         list_join:
411         - '.'
412         - - {get_attr: [Controller, name]}
413           - external
414           - {get_param: CloudDomain}
415       internal_api:
416         list_join:
417         - '.'
418         - - {get_attr: [Controller, name]}
419           - internalapi
420           - {get_param: CloudDomain}
421       storage:
422         list_join:
423         - '.'
424         - - {get_attr: [Controller, name]}
425           - storage
426           - {get_param: CloudDomain}
427       storage_mgmt:
428         list_join:
429         - '.'
430         - - {get_attr: [Controller, name]}
431           - storagemgmt
432           - {get_param: CloudDomain}
433       tenant:
434         list_join:
435         - '.'
436         - - {get_attr: [Controller, name]}
437           - tenant
438           - {get_param: CloudDomain}
439       management:
440         list_join:
441         - '.'
442         - - {get_attr: [Controller, name]}
443           - management
444           - {get_param: CloudDomain}
445       ctlplane:
446         list_join:
447         - '.'
448         - - {get_attr: [Controller, name]}
449           - ctlplane
450           - {get_param: CloudDomain}
451   hosts_entry:
452     description: >
453       Server's IP address and hostname in the /etc/hosts format
454     value:
455       str_replace:
456         template: |
457           PRIMARYIP PRIMARYHOST.DOMAIN PRIMARYHOST
458           EXTERNALIP EXTERNALHOST.DOMAIN EXTERNALHOST
459           INTERNAL_APIIP INTERNAL_APIHOST.DOMAIN INTERNAL_APIHOST
460           STORAGEIP STORAGEHOST.DOMAIN STORAGEHOST
461           STORAGE_MGMTIP STORAGE_MGMTHOST.DOMAIN STORAGE_MGMTHOST
462           TENANTIP TENANTHOST.DOMAIN TENANTHOST
463           MANAGEMENTIP MANAGEMENTHOST.DOMAIN MANAGEMENTHOST
464           CTLPLANEIP CTLPLANEHOST.DOMAIN CTLPLANEHOST
465         params:
466           PRIMARYIP: {get_attr: [NetIpMap, net_ip_map, {get_param: [ServiceNetMap, ControllerHostnameResolveNetwork]}]}
467           DOMAIN: {get_param: CloudDomain}
468           PRIMARYHOST: {get_attr: [Controller, name]}
469           EXTERNALIP: {get_attr: [ExternalPort, ip_address]}
470           EXTERNALHOST:
471             list_join:
472             - '.'
473             - - {get_attr: [Controller, name]}
474               - external
475           INTERNAL_APIIP: {get_attr: [InternalApiPort, ip_address]}
476           INTERNAL_APIHOST:
477             list_join:
478             - '.'
479             - - {get_attr: [Controller, name]}
480               - internalapi
481           STORAGEIP: {get_attr: [StoragePort, ip_address]}
482           STORAGEHOST:
483             list_join:
484             - '.'
485             - - {get_attr: [Controller, name]}
486               - storage
487           STORAGE_MGMTIP: {get_attr: [StorageMgmtPort, ip_address]}
488           STORAGE_MGMTHOST:
489             list_join:
490             - '.'
491             - - {get_attr: [Controller, name]}
492               - storagemgmt
493           TENANTIP: {get_attr: [TenantPort, ip_address]}
494           TENANTHOST:
495             list_join:
496             - '.'
497             - - {get_attr: [Controller, name]}
498               - tenant
499           MANAGEMENTIP: {get_attr: [ManagementPort, ip_address]}
500           MANAGEMENTHOST:
501             list_join:
502             - '.'
503             - - {get_attr: [Controller, name]}
504               - management
505           CTLPLANEIP: {get_attr: [Controller, networks, ctlplane, 0]}
506           CTLPLANEHOST:
507             list_join:
508             - '.'
509             - - {get_attr: [Controller, name]}
510               - ctlplane
511   nova_server_resource:
512     description: Heat resource handle for the Nova compute server
513     value:
514       {get_resource: Controller}
515   tls_key_modulus_md5:
516     description: MD5 checksum of the TLS Key Modulus
517     value: {get_attr: [NodeTLSData, key_modulus_md5]}
518   tls_cert_modulus_md5:
519     description: MD5 checksum of the TLS Certificate Modulus
520     value: {get_attr: [NodeTLSData, cert_modulus_md5]}