Merge "Fix Ironic service bind IPs"
[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   CorosyncIPv6:
27     default: false
28     description: Enable IPv6 in Corosync
29     type: boolean
30   Debug:
31     default: ''
32     description: Set to True to enable debugging on all services.
33     type: string
34   EnableFencing:
35     default: false
36     description: Whether to enable fencing in Pacemaker or not.
37     type: boolean
38   EnableLoadBalancer:
39     default: true
40     description: Whether to deploy a LoadBalancer on the Controller
41     type: boolean
42   ExtraConfig:
43     default: {}
44     description: |
45       Additional hieradata to inject into the cluster, note that
46       ControllerExtraConfig takes precedence over ExtraConfig.
47     type: json
48   FencingConfig:
49     default: {}
50     description: |
51       Pacemaker fencing configuration. The JSON should have
52       the following structure:
53         {
54           "devices": [
55             {
56               "agent": "AGENT_NAME",
57               "host_mac": "HOST_MAC_ADDRESS",
58               "params": {"PARAM_NAME": "PARAM_VALUE"}
59             }
60           ]
61         }
62       For instance:
63         {
64           "devices": [
65             {
66               "agent": "fence_xvm",
67               "host_mac": "52:54:00:aa:bb:cc",
68               "params": {
69                 "multicast_address": "225.0.0.12",
70                 "port": "baremetal_0",
71                 "manage_fw": true,
72                 "manage_key_file": true,
73                 "key_file": "/etc/fence_xvm.key",
74                 "key_file_password": "abcdef"
75               }
76             }
77           ]
78         }
79     type: json
80   OvercloudControlFlavor:
81     description: Flavor for control nodes to request when deploying.
82     default: baremetal
83     type: string
84     constraints:
85       - custom_constraint: nova.flavor
86   controllerImage:
87     type: string
88     default: overcloud-full
89     constraints:
90       - custom_constraint: glance.image
91   ImageUpdatePolicy:
92     default: 'REBUILD_PRESERVE_EPHEMERAL'
93     description: What policy to use when reconstructing instances. REBUILD for rebuilds, REBUILD_PRESERVE_EPHEMERAL to preserve /mnt.
94     type: string
95   KeyName:
96     default: default
97     description: Name of an existing Nova key pair to enable SSH access to the instances
98     type: string
99     constraints:
100       - custom_constraint: nova.keypair
101   ManageFirewall:
102     default: false
103     description: Whether to manage IPtables rules.
104     type: boolean
105   PurgeFirewallRules:
106     default: false
107     description: Whether IPtables rules should be purged before setting up the new ones.
108     type: boolean
109   NeutronPublicInterface:
110     default: nic1
111     description: What interface to bridge onto br-ex for network nodes.
112     type: string
113   PcsdPassword:
114     type: string
115     description: The password for the 'pcsd' user.
116     hidden: true
117   RedisPassword:
118     description: The password for Redis
119     type: string
120     hidden: true
121   RedisVirtualIP:
122     type: string
123     default: ''  # Has to be here because of the ignored empty value bug
124   RedisVirtualIPUri:
125     type: string
126     default: ''  # Has to be here because of the ignored empty value bug
127     description: An IP address which is wrapped in brackets in case of IPv6
128   SwiftRawDisks:
129     default: {}
130     description: 'A hash of additional raw devices to use as Swift backend (eg. {sdb: {}})'
131     type: json
132   ServiceNetMap:
133     default: {}
134     description: Mapping of service_name -> network name. Typically set
135                  via parameter_defaults in the resource registry.
136     type: json
137   EndpointMap:
138     default: {}
139     description: Mapping of service endpoint -> protocol. Typically set
140                  via parameter_defaults in the resource registry.
141     type: json
142   UpdateIdentifier:
143     default: ''
144     type: string
145     description: >
146       Setting to a previously unused value during stack-update will trigger
147       package update on all nodes
148   Hostname:
149     type: string
150     default: '' # Defaults to Heat created hostname
151   HostnameMap:
152     type: json
153     default: {}
154     description: Optional mapping to override hostnames
155   NetworkDeploymentActions:
156     type: comma_delimited_list
157     description: >
158       Heat action when to apply network configuration changes
159     default: ['CREATE']
160   NodeIndex:
161     type: number
162     default: 0
163   SoftwareConfigTransport:
164     default: POLL_SERVER_CFN
165     description: |
166       How the server should receive the metadata required for software configuration.
167     type: string
168     constraints:
169     - allowed_values: [POLL_SERVER_CFN, POLL_SERVER_HEAT, POLL_TEMP_URL, ZAQAR_MESSAGE]
170   CloudDomain:
171     type: string
172     description: >
173       The DNS domain used for the hosts. This should match the dhcp_domain
174       configured in the Undercloud neutron. Defaults to localdomain.
175   ServerMetadata:
176     default: {}
177     description: >
178       Extra properties or metadata passed to Nova for the created nodes in
179       the overcloud. It's accessible via the Nova metadata API.
180     type: json
181   ControllerSchedulerHints:
182     type: json
183     description: Optional scheduler hints to pass to nova
184     default: {}
185   ServiceConfigSettings:
186     type: json
187     default: {}
188   ServiceNames:
189     type: comma_delimited_list
190     default: []
191   ConfigCommand:
192     type: string
193     description: Command which will be run whenever configuration data changes
194     default: os-refresh-config --timeout 14400
195
196 parameter_groups:
197 - label: deprecated
198   description: Do not use deprecated params, they will be removed.
199   parameters:
200   - controllerExtraConfig
201
202 resources:
203
204   Controller:
205     type: OS::TripleO::Server
206     metadata:
207       os-collect-config:
208         command: {get_param: ConfigCommand}
209     properties:
210       image: {get_param: controllerImage}
211       image_update_policy: {get_param: ImageUpdatePolicy}
212       flavor: {get_param: OvercloudControlFlavor}
213       key_name: {get_param: KeyName}
214       networks:
215         - network: ctlplane
216       user_data_format: SOFTWARE_CONFIG
217       user_data: {get_resource: UserData}
218       name:
219         str_replace:
220             template: {get_param: Hostname}
221             params: {get_param: HostnameMap}
222       software_config_transport: {get_param: SoftwareConfigTransport}
223       metadata: {get_param: ServerMetadata}
224       scheduler_hints: {get_param: ControllerSchedulerHints}
225
226   # Combine the NodeAdminUserData and NodeUserData mime archives
227   UserData:
228     type: OS::Heat::MultipartMime
229     properties:
230       parts:
231       - config: {get_resource: NodeAdminUserData}
232         type: multipart
233       - config: {get_resource: NodeUserData}
234         type: multipart
235
236   # Creates the "heat-admin" user if configured via the environment
237   # Should return a OS::Heat::MultipartMime reference via OS::stack_id
238   NodeAdminUserData:
239     type: OS::TripleO::NodeAdminUserData
240
241   # For optional operator additional userdata
242   # Should return a OS::Heat::MultipartMime reference via OS::stack_id
243   NodeUserData:
244     type: OS::TripleO::NodeUserData
245
246   ExternalPort:
247     type: OS::TripleO::Controller::Ports::ExternalPort
248     properties:
249       IPPool: {get_param: ControllerIPs}
250       NodeIndex: {get_param: NodeIndex}
251       ControlPlaneIP: {get_attr: [Controller, networks, ctlplane, 0]}
252
253   InternalApiPort:
254     type: OS::TripleO::Controller::Ports::InternalApiPort
255     properties:
256       IPPool: {get_param: ControllerIPs}
257       NodeIndex: {get_param: NodeIndex}
258       ControlPlaneIP: {get_attr: [Controller, networks, ctlplane, 0]}
259
260   StoragePort:
261     type: OS::TripleO::Controller::Ports::StoragePort
262     properties:
263       IPPool: {get_param: ControllerIPs}
264       NodeIndex: {get_param: NodeIndex}
265       ControlPlaneIP: {get_attr: [Controller, networks, ctlplane, 0]}
266
267   StorageMgmtPort:
268     type: OS::TripleO::Controller::Ports::StorageMgmtPort
269     properties:
270       IPPool: {get_param: ControllerIPs}
271       NodeIndex: {get_param: NodeIndex}
272       ControlPlaneIP: {get_attr: [Controller, networks, ctlplane, 0]}
273
274   TenantPort:
275     type: OS::TripleO::Controller::Ports::TenantPort
276     properties:
277       IPPool: {get_param: ControllerIPs}
278       NodeIndex: {get_param: NodeIndex}
279       ControlPlaneIP: {get_attr: [Controller, networks, ctlplane, 0]}
280
281   ManagementPort:
282     type: OS::TripleO::Controller::Ports::ManagementPort
283     properties:
284       IPPool: {get_param: ControllerIPs}
285       NodeIndex: {get_param: NodeIndex}
286       ControlPlaneIP: {get_attr: [Controller, networks, ctlplane, 0]}
287
288   NetIpMap:
289     type: OS::TripleO::Network::Ports::NetIpMap
290     properties:
291       ControlPlaneIp: {get_attr: [Controller, networks, ctlplane, 0]}
292       ExternalIp: {get_attr: [ExternalPort, ip_address]}
293       ExternalIpSubnet: {get_attr: [ExternalPort, ip_subnet]}
294       ExternalIpUri: {get_attr: [ExternalPort, ip_address_uri]}
295       InternalApiIp: {get_attr: [InternalApiPort, ip_address]}
296       InternalApiIpSubnet: {get_attr: [InternalApiPort, ip_subnet]}
297       InternalApiIpUri: {get_attr: [InternalApiPort, ip_address_uri]}
298       StorageIp: {get_attr: [StoragePort, ip_address]}
299       StorageIpSubnet: {get_attr: [StoragePort, ip_subnet]}
300       StorageIpUri: {get_attr: [StoragePort, ip_address_uri]}
301       StorageMgmtIp: {get_attr: [StorageMgmtPort, ip_address]}
302       StorageMgmtIpSubnet: {get_attr: [StorageMgmtPort, ip_subnet]}
303       StorageMgmtIpUri: {get_attr: [StorageMgmtPort, ip_address_uri]}
304       TenantIp: {get_attr: [TenantPort, ip_address]}
305       TenantIpSubnet: {get_attr: [TenantPort, ip_subnet]}
306       TenantIpUri: {get_attr: [TenantPort, ip_address_uri]}
307       ManagementIp: {get_attr: [ManagementPort, ip_address]}
308       ManagementIpSubnet: {get_attr: [ManagementPort, ip_subnet]}
309       ManagementIpUri: {get_attr: [ManagementPort, ip_address_uri]}
310
311   NetworkConfig:
312     type: OS::TripleO::Controller::Net::SoftwareConfig
313     properties:
314       ControlPlaneIp: {get_attr: [Controller, networks, ctlplane, 0]}
315       ExternalIpSubnet: {get_attr: [ExternalPort, ip_subnet]}
316       InternalApiIpSubnet: {get_attr: [InternalApiPort, ip_subnet]}
317       StorageIpSubnet: {get_attr: [StoragePort, ip_subnet]}
318       StorageMgmtIpSubnet: {get_attr: [StorageMgmtPort, ip_subnet]}
319       TenantIpSubnet: {get_attr: [TenantPort, ip_subnet]}
320       ManagementIpSubnet: {get_attr: [ManagementPort, ip_subnet]}
321
322   NetworkDeployment:
323     type: OS::TripleO::SoftwareDeployment
324     properties:
325       name: NetworkDeployment
326       config: {get_resource: NetworkConfig}
327       server: {get_resource: Controller}
328       actions: {get_param: NetworkDeploymentActions}
329       input_values:
330         bridge_name: br-ex
331         interface_name: {get_param: NeutronPublicInterface}
332
333   # Resource for site-specific injection of root certificate
334   NodeTLSCAData:
335     depends_on: NetworkDeployment
336     type: OS::TripleO::NodeTLSCAData
337     properties:
338       server: {get_resource: Controller}
339
340   # Resource for site-specific passing of private keys/certificates
341   NodeTLSData:
342     depends_on: NodeTLSCAData
343     type: OS::TripleO::NodeTLSData
344     properties:
345       server: {get_resource: Controller}
346       NodeIndex: {get_param: NodeIndex}
347
348
349   ControllerDeployment:
350     type: OS::TripleO::SoftwareDeployment
351     depends_on: NetworkDeployment
352     properties:
353       name: ControllerDeployment
354       config: {get_resource: ControllerConfig}
355       server: {get_resource: Controller}
356       input_values:
357         bootstack_nodeid: {get_attr: [Controller, name]}
358         debug: {get_param: Debug}
359         enable_fencing: {get_param: EnableFencing}
360         enable_load_balancer: {get_param: EnableLoadBalancer}
361         manage_firewall: {get_param: ManageFirewall}
362         purge_firewall_rules: {get_param: PurgeFirewallRules}
363         corosync_ipv6: {get_param: CorosyncIPv6}
364         fencing_config: {get_param: FencingConfig}
365         pcsd_password: {get_param: PcsdPassword}
366         enable_package_upgrade: {get_attr: [UpdateDeployment, update_managed_packages]}
367         redis_vip: {get_param: RedisVirtualIP}
368         ironic_api_network: {get_attr: [NetIpMap, net_ip_map, {get_param: [ServiceNetMap, IronicApiNetwork]}]}
369
370   # Map heat metadata into hiera datafiles
371   ControllerConfig:
372     type: OS::Heat::StructuredConfig
373     properties:
374       group: os-apply-config
375       config:
376         hiera:
377           hierarchy:
378             - '"%{::uuid}"'
379             - heat_config_%{::deploy_config_name}
380             - controller_extraconfig
381             - extraconfig
382             - service_configs
383             - service_names
384             - controller
385             - swift_devices_and_proxy # provided by SwiftDevicesAndProxyConfig
386             - bootstrap_node # provided by BootstrapNodeConfig
387             - all_nodes # provided by allNodesConfig
388             - vip_data # provided by vip-config
389             - '"%{::osfamily}"'
390             - cinder_dellsc_data # Optionally provided by ControllerExtraConfigPre
391             - cinder_netapp_data # Optionally provided by ControllerExtraConfigPre
392             - cinder_eqlx_data # Optionally provided by ControllerExtraConfigPre
393             - neutron_bigswitch_data # Optionally provided by ControllerExtraConfigPre
394             - neutron_cisco_data # Optionally provided by ControllerExtraConfigPre
395             - cisco_n1kv_data # Optionally provided by ControllerExtraConfigPre
396             - midonet_data #Optionally provided by AllNodesExtraConfig
397             - cisco_aci_data # Optionally provided by ControllerExtraConfigPre
398           merge_behavior: deeper
399           datafiles:
400             service_names:
401               mapped_data:
402                 service_names: {get_param: ServiceNames}
403             service_configs:
404               mapped_data:
405                 map_replace:
406                   - {get_param: ServiceConfigSettings}
407                   - values: {get_attr: [NetIpMap, net_ip_map]}
408             controller_extraconfig:
409               mapped_data:
410                 map_merge:
411                   - {get_param: controllerExtraConfig}
412                   - {get_param: ControllerExtraConfig}
413             extraconfig:
414               mapped_data: {get_param: ExtraConfig}
415             controller:
416               mapped_data: # data supplied directly to this deployment configuration, etc
417                 bootstack_nodeid: {get_input: bootstack_nodeid}
418
419                 # Pacemaker
420                 enable_fencing: {get_input: enable_fencing}
421                 enable_load_balancer: {get_input: enable_load_balancer}
422                 hacluster_pwd: {get_input: pcsd_password}
423                 corosync_ipv6: {get_input: corosync_ipv6}
424                 tripleo::fencing::config: {get_input: fencing_config}
425
426                 # Neutron
427                 snmpd_readonly_user_name: {get_input: snmpd_readonly_user_name}
428                 snmpd_readonly_user_password: {get_input: snmpd_readonly_user_password}
429                 # Redis
430                 redis_vip: {get_input: redis_vip}
431                 # Firewall
432                 tripleo::firewall::manage_firewall: {get_input: manage_firewall}
433                 tripleo::firewall::purge_firewall_rules: {get_input: purge_firewall_rules}
434                 # Misc
435                 tripleo::haproxy::service_certificate: {get_attr: [NodeTLSData, deployed_ssl_certificate_path]}
436                 tripleo::packages::enable_upgrade: {get_input: enable_package_upgrade}
437
438   # Hook for site-specific additional pre-deployment config, e.g extra hieradata
439   ControllerExtraConfigPre:
440     depends_on: ControllerDeployment
441     type: OS::TripleO::ControllerExtraConfigPre
442     properties:
443         server: {get_resource: Controller}
444
445   # Hook for site-specific additional pre-deployment config,
446   # applying to all nodes, e.g node registration/unregistration
447   NodeExtraConfig:
448     depends_on: [ControllerExtraConfigPre, NodeTLSData]
449     type: OS::TripleO::NodeExtraConfig
450     properties:
451         server: {get_resource: Controller}
452
453   UpdateConfig:
454     type: OS::TripleO::Tasks::PackageUpdate
455
456   UpdateDeployment:
457     type: OS::Heat::SoftwareDeployment
458     properties:
459       name: UpdateDeployment
460       config: {get_resource: UpdateConfig}
461       server: {get_resource: Controller}
462       input_values:
463         update_identifier:
464           get_param: UpdateIdentifier
465
466 outputs:
467   ip_address:
468     description: IP address of the server in the ctlplane network
469     value: {get_attr: [Controller, networks, ctlplane, 0]}
470   external_ip_address:
471     description: IP address of the server in the external network
472     value: {get_attr: [ExternalPort, ip_address]}
473   internal_api_ip_address:
474     description: IP address of the server in the internal_api network
475     value: {get_attr: [InternalApiPort, ip_address]}
476   storage_ip_address:
477     description: IP address of the server in the storage network
478     value: {get_attr: [StoragePort, ip_address]}
479   storage_mgmt_ip_address:
480     description: IP address of the server in the storage_mgmt network
481     value: {get_attr: [StorageMgmtPort, ip_address]}
482   tenant_ip_address:
483     description: IP address of the server in the tenant network
484     value: {get_attr: [TenantPort, ip_address]}
485   management_ip_address:
486     description: IP address of the server in the management network
487     value: {get_attr: [ManagementPort, ip_address]}
488   hostname:
489     description: Hostname of the server
490     value: {get_attr: [Controller, name]}
491   hosts_entry:
492     description: >
493       Server's IP address and hostname in the /etc/hosts format
494     value:
495       str_replace:
496         template: |
497           PRIMARYIP PRIMARYHOST.DOMAIN PRIMARYHOST
498           EXTERNALIP EXTERNALHOST.DOMAIN EXTERNALHOST
499           INTERNAL_APIIP INTERNAL_APIHOST.DOMAIN INTERNAL_APIHOST
500           STORAGEIP STORAGEHOST.DOMAIN STORAGEHOST
501           STORAGE_MGMTIP STORAGE_MGMTHOST.DOMAIN STORAGE_MGMTHOST
502           TENANTIP TENANTHOST.DOMAIN TENANTHOST
503           MANAGEMENTIP MANAGEMENTHOST.DOMAIN MANAGEMENTHOST
504         params:
505           PRIMARYIP: {get_attr: [NetIpMap, net_ip_map, {get_param: [ServiceNetMap, ControllerHostnameResolveNetwork]}]}
506           DOMAIN: {get_param: CloudDomain}
507           PRIMARYHOST: {get_attr: [Controller, name]}
508           EXTERNALIP: {get_attr: [ExternalPort, ip_address]}
509           EXTERNALHOST:
510             list_join:
511             - '.'
512             - - {get_attr: [Controller, name]}
513               - external
514           INTERNAL_APIIP: {get_attr: [InternalApiPort, ip_address]}
515           INTERNAL_APIHOST:
516             list_join:
517             - '.'
518             - - {get_attr: [Controller, name]}
519               - internalapi
520           STORAGEIP: {get_attr: [StoragePort, ip_address]}
521           STORAGEHOST:
522             list_join:
523             - '.'
524             - - {get_attr: [Controller, name]}
525               - storage
526           STORAGE_MGMTIP: {get_attr: [StorageMgmtPort, ip_address]}
527           STORAGE_MGMTHOST:
528             list_join:
529             - '.'
530             - - {get_attr: [Controller, name]}
531               - storagemgmt
532           TENANTIP: {get_attr: [TenantPort, ip_address]}
533           TENANTHOST:
534             list_join:
535             - '.'
536             - - {get_attr: [Controller, name]}
537               - tenant
538           MANAGEMENTIP: {get_attr: [ManagementPort, ip_address]}
539           MANAGEMENTHOST:
540             list_join:
541             - '.'
542             - - {get_attr: [Controller, name]}
543               - management
544   nova_server_resource:
545     description: Heat resource handle for the Nova compute server
546     value:
547       {get_resource: Controller}
548   swift_device:
549     description: Swift device formatted for swift-ring-builder
550     value:
551       str_replace:
552         template:
553           list_join:
554             - ','
555             - ['r1z1-IP:%PORT%/d1']
556             - repeat:
557                 template: 'r1z1-IP:%PORT%/DEVICE'
558                 for_each:
559                   DEVICE: {get_param: SwiftRawDisks}
560         params:
561           IP:
562             get_attr:
563               - NetIpMap
564               - net_ip_map
565               - str_replace:
566                   template: "NETWORK_uri"
567                   params:
568                     NETWORK: {get_param: [ServiceNetMap, SwiftMgmtNetwork]}
569   swift_proxy_memcache:
570     description: Swift proxy-memcache value
571     value:
572       str_replace:
573         template: "IP:11211"
574         params:
575           IP:
576             get_attr:
577               - NetIpMap
578               - net_ip_map
579               - str_replace:
580                   template: "NETWORK_uri"
581                   params:
582                     NETWORK: {get_param: [ServiceNetMap, MemcachedNetwork]}
583   tls_key_modulus_md5:
584     description: MD5 checksum of the TLS Key Modulus
585     value: {get_attr: [NodeTLSData, key_modulus_md5]}
586   tls_cert_modulus_md5:
587     description: MD5 checksum of the TLS Certificate Modulus
588     value: {get_attr: [NodeTLSData, cert_modulus_md5]}