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