Merge "Add missing reference to ExternalPort for DVR"
[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   RedisVirtualIP:
66     type: string
67     default: ''  # Has to be here because of the ignored empty value bug
68   SwiftRawDisks:
69     default: {}
70     description: 'A hash of additional raw devices to use as Swift backend (eg. {sdb: {}})'
71     type: json
72   ServiceNetMap:
73     default: {}
74     description: Mapping of service_name -> network name. Typically set
75                  via parameter_defaults in the resource registry.
76     type: json
77   EndpointMap:
78     default: {}
79     description: Mapping of service endpoint -> protocol. Typically set
80                  via parameter_defaults in the resource registry.
81     type: json
82   UpdateIdentifier:
83     default: ''
84     type: string
85     description: >
86       Setting to a previously unused value during stack-update will trigger
87       package update on all nodes
88   Hostname:
89     type: string
90     default: '' # Defaults to Heat created hostname
91   HostnameMap:
92     type: json
93     default: {}
94     description: Optional mapping to override hostnames
95   NetworkDeploymentActions:
96     type: comma_delimited_list
97     description: >
98       Heat action when to apply network configuration changes
99     default: ['CREATE']
100   NodeIndex:
101     type: number
102     default: 0
103   SoftwareConfigTransport:
104     default: POLL_SERVER_CFN
105     description: |
106       How the server should receive the metadata required for software configuration.
107     type: string
108     constraints:
109     - allowed_values: [POLL_SERVER_CFN, POLL_SERVER_HEAT, POLL_TEMP_URL, ZAQAR_MESSAGE]
110   CloudDomain:
111     type: string
112     description: >
113       The DNS domain used for the hosts. This should match the dhcp_domain
114       configured in the Undercloud neutron. Defaults to localdomain.
115   ServerMetadata:
116     default: {}
117     description: >
118       Extra properties or metadata passed to Nova for the created nodes in
119       the overcloud. It's accessible via the Nova metadata API.
120     type: json
121   ControllerSchedulerHints:
122     type: json
123     description: Optional scheduler hints to pass to nova
124     default: {}
125   ServiceConfigSettings:
126     type: json
127     default: {}
128   ServiceNames:
129     type: comma_delimited_list
130     default: []
131   MonitoringSubscriptions:
132     type: comma_delimited_list
133     default: []
134   ConfigCommand:
135     type: string
136     description: Command which will be run whenever configuration data changes
137     default: os-refresh-config --timeout 14400
138
139 parameter_groups:
140 - label: deprecated
141   description: Do not use deprecated params, they will be removed.
142   parameters:
143   - controllerExtraConfig
144
145 resources:
146
147   Controller:
148     type: OS::TripleO::Server
149     metadata:
150       os-collect-config:
151         command: {get_param: ConfigCommand}
152     properties:
153       image: {get_param: controllerImage}
154       image_update_policy: {get_param: ImageUpdatePolicy}
155       flavor: {get_param: OvercloudControlFlavor}
156       key_name: {get_param: KeyName}
157       networks:
158         - network: ctlplane
159       user_data_format: SOFTWARE_CONFIG
160       user_data: {get_resource: UserData}
161       name:
162         str_replace:
163             template: {get_param: Hostname}
164             params: {get_param: HostnameMap}
165       software_config_transport: {get_param: SoftwareConfigTransport}
166       metadata: {get_param: ServerMetadata}
167       scheduler_hints: {get_param: ControllerSchedulerHints}
168
169   # Combine the NodeAdminUserData and NodeUserData mime archives
170   UserData:
171     type: OS::Heat::MultipartMime
172     properties:
173       parts:
174       - config: {get_resource: NodeAdminUserData}
175         type: multipart
176       - config: {get_resource: NodeUserData}
177         type: multipart
178
179   # Creates the "heat-admin" user if configured via the environment
180   # Should return a OS::Heat::MultipartMime reference via OS::stack_id
181   NodeAdminUserData:
182     type: OS::TripleO::NodeAdminUserData
183
184   # For optional operator additional userdata
185   # Should return a OS::Heat::MultipartMime reference via OS::stack_id
186   NodeUserData:
187     type: OS::TripleO::NodeUserData
188
189   ExternalPort:
190     type: OS::TripleO::Controller::Ports::ExternalPort
191     properties:
192       IPPool: {get_param: ControllerIPs}
193       NodeIndex: {get_param: NodeIndex}
194       ControlPlaneIP: {get_attr: [Controller, networks, ctlplane, 0]}
195
196   InternalApiPort:
197     type: OS::TripleO::Controller::Ports::InternalApiPort
198     properties:
199       IPPool: {get_param: ControllerIPs}
200       NodeIndex: {get_param: NodeIndex}
201       ControlPlaneIP: {get_attr: [Controller, networks, ctlplane, 0]}
202
203   StoragePort:
204     type: OS::TripleO::Controller::Ports::StoragePort
205     properties:
206       IPPool: {get_param: ControllerIPs}
207       NodeIndex: {get_param: NodeIndex}
208       ControlPlaneIP: {get_attr: [Controller, networks, ctlplane, 0]}
209
210   StorageMgmtPort:
211     type: OS::TripleO::Controller::Ports::StorageMgmtPort
212     properties:
213       IPPool: {get_param: ControllerIPs}
214       NodeIndex: {get_param: NodeIndex}
215       ControlPlaneIP: {get_attr: [Controller, networks, ctlplane, 0]}
216
217   TenantPort:
218     type: OS::TripleO::Controller::Ports::TenantPort
219     properties:
220       IPPool: {get_param: ControllerIPs}
221       NodeIndex: {get_param: NodeIndex}
222       ControlPlaneIP: {get_attr: [Controller, networks, ctlplane, 0]}
223
224   ManagementPort:
225     type: OS::TripleO::Controller::Ports::ManagementPort
226     properties:
227       IPPool: {get_param: ControllerIPs}
228       NodeIndex: {get_param: NodeIndex}
229       ControlPlaneIP: {get_attr: [Controller, networks, ctlplane, 0]}
230
231   NetIpMap:
232     type: OS::TripleO::Network::Ports::NetIpMap
233     properties:
234       ControlPlaneIp: {get_attr: [Controller, networks, ctlplane, 0]}
235       ExternalIp: {get_attr: [ExternalPort, ip_address]}
236       ExternalIpSubnet: {get_attr: [ExternalPort, ip_subnet]}
237       ExternalIpUri: {get_attr: [ExternalPort, ip_address_uri]}
238       InternalApiIp: {get_attr: [InternalApiPort, ip_address]}
239       InternalApiIpSubnet: {get_attr: [InternalApiPort, ip_subnet]}
240       InternalApiIpUri: {get_attr: [InternalApiPort, ip_address_uri]}
241       StorageIp: {get_attr: [StoragePort, ip_address]}
242       StorageIpSubnet: {get_attr: [StoragePort, ip_subnet]}
243       StorageIpUri: {get_attr: [StoragePort, ip_address_uri]}
244       StorageMgmtIp: {get_attr: [StorageMgmtPort, ip_address]}
245       StorageMgmtIpSubnet: {get_attr: [StorageMgmtPort, ip_subnet]}
246       StorageMgmtIpUri: {get_attr: [StorageMgmtPort, ip_address_uri]}
247       TenantIp: {get_attr: [TenantPort, ip_address]}
248       TenantIpSubnet: {get_attr: [TenantPort, ip_subnet]}
249       TenantIpUri: {get_attr: [TenantPort, ip_address_uri]}
250       ManagementIp: {get_attr: [ManagementPort, ip_address]}
251       ManagementIpSubnet: {get_attr: [ManagementPort, ip_subnet]}
252       ManagementIpUri: {get_attr: [ManagementPort, ip_address_uri]}
253
254   NetworkConfig:
255     type: OS::TripleO::Controller::Net::SoftwareConfig
256     properties:
257       ControlPlaneIp: {get_attr: [Controller, networks, ctlplane, 0]}
258       ExternalIpSubnet: {get_attr: [ExternalPort, ip_subnet]}
259       InternalApiIpSubnet: {get_attr: [InternalApiPort, ip_subnet]}
260       StorageIpSubnet: {get_attr: [StoragePort, ip_subnet]}
261       StorageMgmtIpSubnet: {get_attr: [StorageMgmtPort, ip_subnet]}
262       TenantIpSubnet: {get_attr: [TenantPort, ip_subnet]}
263       ManagementIpSubnet: {get_attr: [ManagementPort, ip_subnet]}
264
265   NetworkDeployment:
266     type: OS::TripleO::SoftwareDeployment
267     properties:
268       name: NetworkDeployment
269       config: {get_resource: NetworkConfig}
270       server: {get_resource: Controller}
271       actions: {get_param: NetworkDeploymentActions}
272       input_values:
273         bridge_name: br-ex
274         interface_name: {get_param: NeutronPublicInterface}
275
276   # Resource for site-specific injection of root certificate
277   NodeTLSCAData:
278     depends_on: NetworkDeployment
279     type: OS::TripleO::NodeTLSCAData
280     properties:
281       server: {get_resource: Controller}
282
283   # Resource for site-specific passing of private keys/certificates
284   NodeTLSData:
285     depends_on: NodeTLSCAData
286     type: OS::TripleO::NodeTLSData
287     properties:
288       server: {get_resource: Controller}
289       NodeIndex: {get_param: NodeIndex}
290
291
292   ControllerDeployment:
293     type: OS::TripleO::SoftwareDeployment
294     depends_on: NetworkDeployment
295     properties:
296       name: ControllerDeployment
297       config: {get_resource: ControllerConfig}
298       server: {get_resource: Controller}
299       input_values:
300         bootstack_nodeid: {get_attr: [Controller, name]}
301         enable_load_balancer: {get_param: EnableLoadBalancer}
302         enable_package_upgrade: {get_attr: [UpdateDeployment, update_managed_packages]}
303         redis_vip: {get_param: RedisVirtualIP}
304
305   # Map heat metadata into hiera datafiles
306   ControllerConfig:
307     type: OS::Heat::StructuredConfig
308     properties:
309       group: os-apply-config
310       config:
311         hiera:
312           hierarchy:
313             - '"%{::uuid}"'
314             - heat_config_%{::deploy_config_name}
315             - controller_extraconfig
316             - extraconfig
317             - service_configs
318             - service_names
319             - controller
320             - swift_devices_and_proxy # provided by SwiftDevicesAndProxyConfig
321             - bootstrap_node # provided by BootstrapNodeConfig
322             - all_nodes # provided by allNodesConfig
323             - vip_data # provided by allNodesConfig
324             - '"%{::osfamily}"'
325             - cinder_dellsc_data # Optionally provided by ControllerExtraConfigPre
326             - cinder_netapp_data # Optionally provided by ControllerExtraConfigPre
327             - cinder_eqlx_data # Optionally provided by ControllerExtraConfigPre
328             - neutron_bigswitch_data # Optionally provided by ControllerExtraConfigPre
329             - neutron_cisco_data # Optionally provided by ControllerExtraConfigPre
330             - cisco_n1kv_data # Optionally provided by ControllerExtraConfigPre
331             - midonet_data #Optionally provided by AllNodesExtraConfig
332             - cisco_aci_data # Optionally provided by ControllerExtraConfigPre
333           merge_behavior: deeper
334           datafiles:
335             service_names:
336               mapped_data:
337                 service_names: {get_param: ServiceNames}
338                 sensu::subscriptions: {get_param: MonitoringSubscriptions}
339             service_configs:
340               mapped_data:
341                 map_replace:
342                   - {get_param: ServiceConfigSettings}
343                   - values: {get_attr: [NetIpMap, net_ip_map]}
344             controller_extraconfig:
345               mapped_data:
346                 map_merge:
347                   - {get_param: controllerExtraConfig}
348                   - {get_param: ControllerExtraConfig}
349             extraconfig:
350               mapped_data: {get_param: ExtraConfig}
351             controller:
352               mapped_data: # data supplied directly to this deployment configuration, etc
353                 bootstack_nodeid: {get_input: bootstack_nodeid}
354
355                 # Pacemaker
356                 enable_load_balancer: {get_input: enable_load_balancer}
357
358                 # Redis
359                 redis_vip: {get_input: redis_vip}
360                 # Misc
361                 tripleo::haproxy::service_certificate: {get_attr: [NodeTLSData, deployed_ssl_certificate_path]}
362                 tripleo::packages::enable_upgrade: {get_input: enable_package_upgrade}
363
364   # Hook for site-specific additional pre-deployment config, e.g extra hieradata
365   ControllerExtraConfigPre:
366     depends_on: ControllerDeployment
367     type: OS::TripleO::ControllerExtraConfigPre
368     properties:
369         server: {get_resource: Controller}
370
371   # Hook for site-specific additional pre-deployment config,
372   # applying to all nodes, e.g node registration/unregistration
373   NodeExtraConfig:
374     depends_on: [ControllerExtraConfigPre, NodeTLSData]
375     type: OS::TripleO::NodeExtraConfig
376     properties:
377         server: {get_resource: Controller}
378
379   UpdateConfig:
380     type: OS::TripleO::Tasks::PackageUpdate
381
382   UpdateDeployment:
383     type: OS::Heat::SoftwareDeployment
384     properties:
385       name: UpdateDeployment
386       config: {get_resource: UpdateConfig}
387       server: {get_resource: Controller}
388       input_values:
389         update_identifier:
390           get_param: UpdateIdentifier
391
392 outputs:
393   ip_address:
394     description: IP address of the server in the ctlplane network
395     value: {get_attr: [Controller, networks, ctlplane, 0]}
396   external_ip_address:
397     description: IP address of the server in the external network
398     value: {get_attr: [ExternalPort, ip_address]}
399   internal_api_ip_address:
400     description: IP address of the server in the internal_api network
401     value: {get_attr: [InternalApiPort, ip_address]}
402   storage_ip_address:
403     description: IP address of the server in the storage network
404     value: {get_attr: [StoragePort, ip_address]}
405   storage_mgmt_ip_address:
406     description: IP address of the server in the storage_mgmt network
407     value: {get_attr: [StorageMgmtPort, ip_address]}
408   tenant_ip_address:
409     description: IP address of the server in the tenant network
410     value: {get_attr: [TenantPort, ip_address]}
411   management_ip_address:
412     description: IP address of the server in the management network
413     value: {get_attr: [ManagementPort, ip_address]}
414   hostname:
415     description: Hostname of the server
416     value: {get_attr: [Controller, name]}
417   hosts_entry:
418     description: >
419       Server's IP address and hostname in the /etc/hosts format
420     value:
421       str_replace:
422         template: |
423           PRIMARYIP PRIMARYHOST.DOMAIN PRIMARYHOST
424           EXTERNALIP EXTERNALHOST.DOMAIN EXTERNALHOST
425           INTERNAL_APIIP INTERNAL_APIHOST.DOMAIN INTERNAL_APIHOST
426           STORAGEIP STORAGEHOST.DOMAIN STORAGEHOST
427           STORAGE_MGMTIP STORAGE_MGMTHOST.DOMAIN STORAGE_MGMTHOST
428           TENANTIP TENANTHOST.DOMAIN TENANTHOST
429           MANAGEMENTIP MANAGEMENTHOST.DOMAIN MANAGEMENTHOST
430         params:
431           PRIMARYIP: {get_attr: [NetIpMap, net_ip_map, {get_param: [ServiceNetMap, ControllerHostnameResolveNetwork]}]}
432           DOMAIN: {get_param: CloudDomain}
433           PRIMARYHOST: {get_attr: [Controller, name]}
434           EXTERNALIP: {get_attr: [ExternalPort, ip_address]}
435           EXTERNALHOST:
436             list_join:
437             - '.'
438             - - {get_attr: [Controller, name]}
439               - external
440           INTERNAL_APIIP: {get_attr: [InternalApiPort, ip_address]}
441           INTERNAL_APIHOST:
442             list_join:
443             - '.'
444             - - {get_attr: [Controller, name]}
445               - internalapi
446           STORAGEIP: {get_attr: [StoragePort, ip_address]}
447           STORAGEHOST:
448             list_join:
449             - '.'
450             - - {get_attr: [Controller, name]}
451               - storage
452           STORAGE_MGMTIP: {get_attr: [StorageMgmtPort, ip_address]}
453           STORAGE_MGMTHOST:
454             list_join:
455             - '.'
456             - - {get_attr: [Controller, name]}
457               - storagemgmt
458           TENANTIP: {get_attr: [TenantPort, ip_address]}
459           TENANTHOST:
460             list_join:
461             - '.'
462             - - {get_attr: [Controller, name]}
463               - tenant
464           MANAGEMENTIP: {get_attr: [ManagementPort, ip_address]}
465           MANAGEMENTHOST:
466             list_join:
467             - '.'
468             - - {get_attr: [Controller, name]}
469               - management
470   nova_server_resource:
471     description: Heat resource handle for the Nova compute server
472     value:
473       {get_resource: Controller}
474   swift_device:
475     description: Swift device formatted for swift-ring-builder
476     value:
477       str_replace:
478         template:
479           list_join:
480             - ','
481             - ['r1z1-IP:%PORT%/d1']
482             - repeat:
483                 template: 'r1z1-IP:%PORT%/DEVICE'
484                 for_each:
485                   DEVICE: {get_param: SwiftRawDisks}
486         params:
487           IP:
488             get_attr:
489               - NetIpMap
490               - net_ip_map
491               - str_replace:
492                   template: "NETWORK_uri"
493                   params:
494                     NETWORK: {get_param: [ServiceNetMap, SwiftMgmtNetwork]}
495   tls_key_modulus_md5:
496     description: MD5 checksum of the TLS Key Modulus
497     value: {get_attr: [NodeTLSData, key_modulus_md5]}
498   tls_cert_modulus_md5:
499     description: MD5 checksum of the TLS Certificate Modulus
500     value: {get_attr: [NodeTLSData, cert_modulus_md5]}