Merge "Rename -puppet.yaml templates."
[apex-tripleo-heat-templates.git] / puppet / compute.yaml
1 heat_template_version: 2015-04-30
2
3 description: >
4   OpenStack hypervisor node configured via Puppet.
5
6 parameters:
7   AdminPassword:
8     default: unset
9     description: The password for the keystone admin account, used for monitoring, querying neutron etc.
10     type: string
11     hidden: true
12   CeilometerComputeAgent:
13     description: Indicates whether the Compute agent is present and expects nova-compute to be configured accordingly
14     type: string
15     default: ''
16     constraints:
17     - allowed_values: ['', Present]
18   CeilometerMeteringSecret:
19     default: unset
20     description: Secret shared by the ceilometer services.
21     type: string
22     hidden: true
23   CeilometerPassword:
24     default: unset
25     description: The password for the ceilometer service account.
26     type: string
27     hidden: true
28   CinderEnableNfsBackend:
29     default: false
30     description: Whether to enable or not the NFS backend for Cinder
31     type: boolean
32   Debug:
33     default: ''
34     description: Set to True to enable debugging on all services.
35     type: string
36   ExtraConfig:
37     default: {}
38     description: |
39       Additional hiera configuration to inject into the cluster. Note
40       that NovaComputeExtraConfig takes precedence over ExtraConfig.
41     type: json
42   Flavor:
43     description: Flavor for the nova compute node
44     type: string
45     constraints:
46       - custom_constraint: nova.flavor
47   GlanceHost:
48     type: string
49     default: ''  # Has to be here because of the ignored empty value bug
50   GlancePort:
51     default: "9292"
52     description: Glance port.
53     type: string
54   GlanceProtocol:
55     default: http
56     description: Protocol to use when connecting to glance, set to https for SSL.
57     type: string
58   Image:
59     type: string
60     default: overcloud-compute
61     constraints:
62       - custom_constraint: glance.image
63   ImageUpdatePolicy:
64     default: 'REBUILD_PRESERVE_EPHEMERAL'
65     description: What policy to use when reconstructing instances. REBUILD for rebuilds, REBUILD_PRESERVE_EPHEMERAL to preserve /mnt.
66     type: string
67   KeyName:
68     description: Name of an existing EC2 KeyPair to enable SSH access to the instances
69     type: string
70     default: default
71     constraints:
72       - custom_constraint: nova.keypair
73   KeystoneAdminApiVirtualIP:
74     type: string
75     default: ''
76   KeystonePublicApiVirtualIP:
77      type: string
78      default: ''
79   NeutronBridgeMappings:
80     description: >
81       The OVS logical->physical bridge mappings to use. See the Neutron
82       documentation for details. Defaults to mapping br-ex - the external
83       bridge on hosts - to a physical name 'datacentre' which can be used
84       to create provider networks (and we use this for the default floating
85       network) - if changing this either use different post-install network
86       scripts or be sure to keep 'datacentre' as a mapping network name.
87     type: string
88     default: "datacentre:br-ex"
89   NeutronEnableTunnelling:
90     type: string
91     default: "True"
92   NeutronFlatNetworks:
93     type: string
94     default: 'datacentre'
95     description: >
96       If set, flat networks to configure in neutron plugins.
97   NeutronHost:
98     type: string
99     default: ''  # Has to be here because of the ignored empty value bug
100   NeutronNetworkType:
101     type: string
102     description: The tenant network type for Neutron, either gre or vxlan.
103     default: 'vxlan'
104   NeutronNetworkVLANRanges:
105     default: 'datacentre'
106     description: >
107       The Neutron ML2 and OpenVSwitch vlan mapping range to support. See the
108       Neutron documentation for permitted values. Defaults to permitting any
109       VLAN on the 'datacentre' physical network (See NeutronBridgeMappings).
110     type: comma_delimited_list
111   NeutronPassword:
112     default: unset
113     description: The password for the neutron service account, used by neutron agents.
114     type: string
115     hidden: true
116   NeutronPhysicalBridge:
117     default: 'br-ex'
118     description: An OVS bridge to create for accessing external networks.
119     type: string
120   NeutronPublicInterface:
121     default: nic1
122     description: A port to add to the NeutronPhysicalBridge.
123     type: string
124   NeutronTunnelTypes:
125     type: string
126     description: |
127         The tunnel types for the Neutron tenant network. To specify multiple
128         values, use a comma separated string, like so: 'gre,vxlan'
129     default: 'vxlan'
130   NeutronTunnelIdRanges:
131     description: |
132         Comma-separated list of <tun_min>:<tun_max> tuples enumerating ranges
133         of GRE tunnel IDs that are available for tenant network allocation
134     default: ["1:1000", ]
135     type: comma_delimited_list
136   NeutronVniRanges:
137     description: |
138         Comma-separated list of <vni_min>:<vni_max> tuples enumerating ranges
139         of VXLAN VNI IDs that are available for tenant network allocation
140     default: ["1:1000", ]
141     type: comma_delimited_list
142   NeutronPublicInterfaceRawDevice:
143     default: ''
144     type: string
145   NeutronDVR:
146     default: 'False'
147     type: string
148   NeutronMetadataProxySharedSecret:
149     default: 'unset'
150     description: Shared secret to prevent spoofing
151     type: string
152   NeutronMechanismDrivers:
153     default: 'openvswitch'
154     description: |
155         The mechanism drivers for the Neutron tenant network. To specify multiple
156         values, use a comma separated string, like so: 'openvswitch,l2_population'
157     type: string
158   # Not relevant for Computes, should be removed
159   NeutronAllowL3AgentFailover:
160     default: 'True'
161     description: Allow automatic l3-agent failover
162     type: string
163   # Not relevant for Computes, should be removed
164   NeutronL3HA:
165     default: 'False'
166     description: Whether to enable l3-agent HA
167     type: string
168   NeutronAgentMode:
169     default: 'dvr_snat'
170     description: Agent mode for the neutron-l3-agent on the controller hosts
171     type: string
172   NovaApiHost:
173     type: string
174     default: ''  # Has to be here because of the ignored empty value bug
175   NovaComputeDriver:
176     type: string
177     default: libvirt.LibvirtDriver
178   NovaComputeExtraConfig:
179     default: {}
180     description: |
181       NovaCompute specific configuration to inject into the cluster. Same
182       structure as ExtraConfig.
183     type: json
184   NovaComputeLibvirtType:
185     type: string
186     default: ''
187   NovaEnableRbdBackend:
188     default: false
189     description: Whether to enable or not the Rbd backend for Nova
190     type: boolean
191   NovaPassword:
192     default: unset
193     description: The password for the nova service account, used by nova-api.
194     type: string
195     hidden: true
196   NovaPublicIP:
197     type: string
198     default: ''  # Has to be here because of the ignored empty value bug
199   NtpServer:
200     type: string
201     default: ''
202   RabbitHost:
203     type: string
204     default: ''  # Has to be here because of the ignored empty value bug
205   RabbitPassword:
206     default: guest
207     description: The password for RabbitMQ
208     type: string
209     hidden: true
210   RabbitUserName:
211     default: guest
212     description: The username for RabbitMQ
213     type: string
214   RabbitClientUseSSL:
215     default: false
216     description: >
217         Rabbit client subscriber parameter to specify
218         an SSL connection to the RabbitMQ host.
219     type: string
220   RabbitClientPort:
221     default: 5672
222     description: Set rabbit subscriber port, change this if using SSL
223     type: number
224   SnmpdReadonlyUserName:
225     default: ro_snmp_user
226     description: The user name for SNMPd with readonly rights running on all Overcloud nodes
227     type: string
228   SnmpdReadonlyUserPassword:
229     default: unset
230     description: The user password for SNMPd with readonly rights running on all Overcloud nodes
231     type: string
232     hidden: true
233   EnablePackageInstall:
234     default: 'false'
235     description: Set to true to enable package installation via Puppet
236     type: boolean
237   ServiceNetMap:
238     default: {}
239     description: Mapping of service_name -> network name. Typically set
240                  via parameter_defaults in the resource registry.
241     type: json
242   UpdateIdentifier:
243     default: ''
244     type: string
245     description: >
246       Setting to a previously unused value during stack-update will trigger
247       package update on all nodes
248   Hostname:
249     type: string
250     default: '' # Defaults to Heat created hostname
251
252 resources:
253
254   NovaCompute:
255     type: OS::Nova::Server
256     properties:
257       image:
258         {get_param: Image}
259       image_update_policy:
260         get_param: ImageUpdatePolicy
261       flavor: {get_param: Flavor}
262       key_name: {get_param: KeyName}
263       networks:
264         - network: ctlplane
265       user_data_format: SOFTWARE_CONFIG
266       user_data: {get_resource: UserData}
267       name: {get_param: Hostname}
268
269   # Combine the NodeAdminUserData and NodeUserData mime archives
270   UserData:
271     type: OS::Heat::MultipartMime
272     properties:
273       parts:
274       - config: {get_resource: NodeAdminUserData}
275         type: multipart
276       - config: {get_resource: NodeUserData}
277         type: multipart
278
279   # Creates the "heat-admin" user if configured via the environment
280   # Should return a OS::Heat::MultipartMime reference via OS::stack_id
281   NodeAdminUserData:
282     type: OS::TripleO::NodeAdminUserData
283
284   # For optional operator additional userdata
285   # Should return a OS::Heat::MultipartMime reference via OS::stack_id
286   NodeUserData:
287     type: OS::TripleO::NodeUserData
288
289   InternalApiPort:
290     type: OS::TripleO::Compute::Ports::InternalApiPort
291     properties:
292       ControlPlaneIP: {get_attr: [NovaCompute, networks, ctlplane, 0]}
293
294   StoragePort:
295     type: OS::TripleO::Compute::Ports::StoragePort
296     properties:
297       ControlPlaneIP: {get_attr: [NovaCompute, networks, ctlplane, 0]}
298
299   TenantPort:
300     type: OS::TripleO::Compute::Ports::TenantPort
301     properties:
302       ControlPlaneIP: {get_attr: [NovaCompute, networks, ctlplane, 0]}
303
304   NetIpMap:
305     type: OS::TripleO::Network::Ports::NetIpMap
306     properties:
307       ControlPlaneIp: {get_attr: [NovaCompute, networks, ctlplane, 0]}
308       InternalApiIp: {get_attr: [InternalApiPort, ip_address]}
309       StorageIp: {get_attr: [StoragePort, ip_address]}
310       TenantIp: {get_attr: [TenantPort, ip_address]}
311
312   NetworkConfig:
313     type: OS::TripleO::Compute::Net::SoftwareConfig
314     properties:
315       ControlPlaneIp: {get_attr: [NovaCompute, networks, ctlplane, 0]}
316       InternalApiIpSubnet: {get_attr: [InternalApiPort, ip_subnet]}
317       StorageIpSubnet: {get_attr: [StoragePort, ip_subnet]}
318       TenantIpSubnet: {get_attr: [TenantPort, ip_subnet]}
319
320   NetworkDeployment:
321     type: OS::TripleO::SoftwareDeployment
322     properties:
323       config: {get_resource: NetworkConfig}
324       server: {get_resource: NovaCompute}
325       input_values:
326         bridge_name: {get_param: NeutronPhysicalBridge}
327         interface_name: {get_param: NeutronPublicInterface}
328
329   NovaComputeConfig:
330     type: OS::Heat::StructuredConfig
331     properties:
332       group: os-apply-config
333       config:
334         hiera:
335           hierarchy:
336             - heat_config_%{::deploy_config_name}
337             - compute_extraconfig
338             - extraconfig
339             - compute
340             - ceph_cluster # provided by CephClusterConfig
341             - ceph
342             - all_nodes # provided by allNodesConfig
343             - '"%{::osfamily}"'
344             - common
345           datafiles:
346             compute_extraconfig:
347               mapped_data: {get_param: NovaComputeExtraConfig}
348             extraconfig:
349               mapped_data: {get_param: ExtraConfig}
350             common:
351               raw_data: {get_file: hieradata/common.yaml}
352             ceph:
353               raw_data: {get_file: hieradata/ceph.yaml}
354             compute:
355               raw_data: {get_file: hieradata/compute.yaml}
356               mapped_data:
357                 cinder_enable_nfs_backend: {get_input: cinder_enable_nfs_backend}
358                 nova::debug: {get_input: debug}
359                 nova::rabbit_userid: {get_input: rabbit_username}
360                 nova::rabbit_password: {get_input: rabbit_password}
361                 nova::rabbit_use_ssl: {get_input: rabbit_client_use_ssl}
362                 nova::rabbit_port: {get_input: rabbit_client_port}
363                 nova_compute_driver: {get_input: nova_compute_driver}
364                 nova::compute::libvirt::libvirt_virt_type: {get_input: nova_compute_libvirt_type}
365                 nova_api_host: {get_input: nova_api_host}
366                 nova::compute::vncproxy_host: {get_input: nova_public_ip}
367                 nova::compute::rbd::ephemeral_storage: {get_input: nova_enable_rbd_backend}
368                 nova_password: {get_input: nova_password}
369                 nova::compute::vncserver_proxyclient_address: {get_input: nova_vnc_proxyclient_address}
370                 ceilometer::debug: {get_input: debug}
371                 ceilometer::rabbit_userid: {get_input: rabbit_username}
372                 ceilometer::rabbit_password: {get_input: rabbit_password}
373                 ceilometer::rabbit_use_ssl: {get_input: rabbit_client_use_ssl}
374                 ceilometer::rabbit_port: {get_input: rabbit_client_port}
375                 ceilometer::metering_secret: {get_input: ceilometer_metering_secret}
376                 ceilometer::agent::auth::auth_password: {get_input: ceilometer_password}
377                 ceilometer::agent::auth::auth_url: {get_input: ceilometer_agent_auth_url}
378                 ceilometer_compute_agent: {get_input: ceilometer_compute_agent}
379                 snmpd_readonly_user_name: {get_input: snmpd_readonly_user_name}
380                 snmpd_readonly_user_password: {get_input: snmpd_readonly_user_password}
381                 nova::glance_api_servers: {get_input: glance_api_servers}
382                 neutron::debug: {get_input: debug}
383                 neutron::rabbit_password: {get_input: rabbit_password}
384                 neutron::rabbit_user: {get_input: rabbit_user}
385                 neutron::rabbit_use_ssl: {get_input: rabbit_client_use_ssl}
386                 neutron::rabbit_port: {get_input: rabbit_client_port}
387                 neutron_flat_networks: {get_input: neutron_flat_networks}
388                 neutron_host: {get_input: neutron_host}
389                 neutron::agents::ml2::ovs::local_ip: {get_input: neutron_local_ip}
390
391                 neutron_tenant_network_type: {get_input: neutron_tenant_network_type}
392                 neutron_tunnel_types: {get_input: neutron_tunnel_types}
393                 neutron::plugins::ml2::network_vlan_ranges: {get_input: neutron_network_vlan_ranges}
394                 neutron::plugins::ml2::tunnel_id_ranges: {get_input: neutron_tunnel_id_ranges}
395                 neutron::plugins::ml2::vni_ranges: {get_input: neutron_vni_ranges}
396                 neutron_bridge_mappings: {get_input: neutron_bridge_mappings}
397                 neutron::agents::ml2::ovs::enable_tunneling: {get_input: neutron_enable_tunneling}
398                 neutron_physical_bridge: {get_input: neutron_physical_bridge}
399                 neutron_public_interface: {get_input: neutron_public_interface}
400                 nova::network::neutron::neutron_admin_password: {get_input: neutron_password}
401                 nova::network::neutron::neutron_url: {get_input: neutron_url}
402                 nova::network::neutron::neutron_admin_auth_url: {get_input: neutron_admin_auth_url}
403                 neutron_router_distributed: {get_input: neutron_router_distributed}
404                 neutron_agent_mode: {get_input: neutron_agent_mode}
405                 neutron_metadata_proxy_shared_secret: {get_input: neutron_metadata_proxy_shared_secret}
406                 neutron_mechanism_drivers: {get_input: neutron_mechanism_drivers}
407                 neutron_public_interface_raw_device: {get_input: neutron_public_interface_raw_device}
408                 admin_password: {get_input: admin_password}
409                 ntp::servers: {get_input: ntp_servers}
410                 tripleo::packages::enable_install: {get_input: enable_package_install}
411
412   NovaComputeDeployment:
413     type: OS::TripleO::SoftwareDeployment
414     depends_on: NetworkDeployment
415     properties:
416       config: {get_resource: NovaComputeConfig}
417       server: {get_resource: NovaCompute}
418       input_values:
419         cinder_enable_nfs_backend: {get_param: CinderEnableNfsBackend}
420         debug: {get_param: Debug}
421         nova_compute_driver: {get_param: NovaComputeDriver}
422         nova_compute_libvirt_type: {get_param: NovaComputeLibvirtType}
423         nova_public_ip: {get_param: NovaPublicIP}
424         nova_api_host: {get_param: NovaApiHost}
425         nova_password: {get_param: NovaPassword}
426         nova_enable_rbd_backend: {get_param: NovaEnableRbdBackend}
427         nova_vnc_proxyclient_address: {get_attr: [NetIpMap, net_ip_map, {get_param: [ServiceNetMap, NovaVncProxyNetwork]}]}
428         ceilometer_metering_secret: {get_param: CeilometerMeteringSecret}
429         ceilometer_password: {get_param: CeilometerPassword}
430         ceilometer_compute_agent: {get_param: CeilometerComputeAgent}
431         ceilometer_agent_auth_url:
432           list_join:
433             - ''
434             - - 'http://'
435               - {get_param: KeystonePublicApiVirtualIP}
436               - ':5000/v2.0'
437         snmpd_readonly_user_name: {get_param: SnmpdReadonlyUserName}
438         snmpd_readonly_user_password: {get_param: SnmpdReadonlyUserPassword}
439         glance_api_servers:
440           list_join:
441             - ''
442             - - {get_param: GlanceProtocol}
443               - '://'
444               - {get_param: GlanceHost}
445               - ':'
446               - {get_param: GlancePort}
447         neutron_flat_networks: {get_param: NeutronFlatNetworks}
448         neutron_host: {get_param: NeutronHost}
449         neutron_local_ip: {get_attr: [NetIpMap, net_ip_map, {get_param: [ServiceNetMap, NeutronTenantNetwork]}]}
450         neutron_tenant_network_type: {get_param: NeutronNetworkType}
451         neutron_tunnel_types: {get_param: NeutronTunnelTypes}
452         neutron_tunnel_id_ranges:
453           str_replace:
454             template: "['RANGES']"
455             params:
456               RANGES:
457                 list_join:
458                 - "','"
459                 - {get_param: NeutronTunnelIdRanges}
460         neutron_vni_ranges:
461           str_replace:
462             template: "['RANGES']"
463             params:
464               RANGES:
465                 list_join:
466                 - "','"
467                 - {get_param: NeutronVniRanges}
468         neutron_network_vlan_ranges:
469           str_replace:
470             template: "['RANGES']"
471             params:
472               RANGES:
473                 list_join:
474                 - "','"
475                 - {get_param: NeutronNetworkVLANRanges}
476         neutron_bridge_mappings: {get_param: NeutronBridgeMappings}
477         neutron_enable_tunneling: {get_param: NeutronEnableTunnelling}
478         neutron_physical_bridge: {get_param: NeutronPhysicalBridge}
479         neutron_public_interface: {get_param: NeutronPublicInterface}
480         neutron_password: {get_param: NeutronPassword}
481         neutron_agent_mode: {get_param: NeutronAgentMode}
482         neutron_router_distributed: {get_param: NeutronDVR}
483         neutron_metadata_proxy_shared_secret: {get_param: NeutronMetadataProxySharedSecret}
484         neutron_mechanism_drivers: {get_param: NeutronMechanismDrivers}
485         neutron_public_interface_raw_device: {get_param: NeutronPublicInterfaceRawDevice}
486         neutron_url:
487           list_join:
488             - ''
489             - - 'http://'
490               - {get_param: NeutronHost}
491               - ':9696'
492         neutron_admin_auth_url:
493           list_join:
494             - ''
495             - - 'http://'
496               - {get_param: KeystoneAdminApiVirtualIP}
497               - ':35357/v2.0'
498         admin_password: {get_param: AdminPassword}
499         rabbit_username: {get_param: RabbitUserName}
500         rabbit_password: {get_param: RabbitPassword}
501         rabbit_client_use_ssl: {get_param: RabbitClientUseSSL}
502         rabbit_client_port: {get_param: RabbitClientPort}
503         ntp_servers:
504           str_replace:
505             template: '["server"]'
506             params:
507               server: {get_param: NtpServer}
508         enable_package_install: {get_param: EnablePackageInstall}
509
510   # Hook for site-specific additional pre-deployment config, e.g extra hieradata
511   ComputeExtraConfigPre:
512     depends_on: NovaComputeDeployment
513     type: OS::TripleO::ComputeExtraConfigPre
514     properties:
515         server: {get_resource: NovaCompute}
516
517   UpdateConfig:
518     type: OS::TripleO::Tasks::PackageUpdate
519
520   UpdateDeployment:
521     type: OS::Heat::SoftwareDeployment
522     properties:
523       config: {get_resource: UpdateConfig}
524       server: {get_resource: NovaCompute}
525       input_values:
526         update_identifier:
527           get_param: UpdateIdentifier
528
529 outputs:
530   ip_address:
531     description: IP address of the server in the ctlplane network
532     value: {get_attr: [NovaCompute, networks, ctlplane, 0]}
533   internal_api_ip_address:
534     description: IP address of the server in the internal_api network
535     value: {get_attr: [InternalApiPort, ip_address]}
536   storage_ip_address:
537     description: IP address of the server in the storage network
538     value: {get_attr: [StoragePort, ip_address]}
539   tenant_ip_address:
540     description: IP address of the server in the tenant network
541     value: {get_attr: [TenantPort, ip_address]}
542   hostname:
543     description: Hostname of the server
544     value: {get_attr: [NovaCompute, name]}
545   hosts_entry:
546     description: >
547       Server's IP address and hostname in the /etc/hosts format
548     value:
549       str_replace:
550         template: "IP HOST.localdomain HOST"
551         params:
552           IP: {get_attr: [NetIpMap, net_ip_map, {get_param: [ServiceNetMap, ComputeHostnameResolveNetwork]}]}
553           HOST: {get_attr: [NovaCompute, name]}
554   nova_server_resource:
555     description: Heat resource handle for the Nova compute server
556     value:
557       {get_resource: NovaCompute}
558   config_identifier:
559     description: identifier which changes if the node configuration may need re-applying
560     value:
561       list_join:
562       - ','
563       - - {get_attr: [NovaComputeDeployment, deploy_stdout]}
564         - {get_attr: [ComputeExtraConfigPre, deploy_stdout]}