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