Allow a user to set specific setting per host
[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             - '"%{::uuid}"'
337             - heat_config_%{::deploy_config_name}
338             - compute_extraconfig
339             - extraconfig
340             - compute
341             - ceph_cluster # provided by CephClusterConfig
342             - ceph
343             - all_nodes # provided by allNodesConfig
344             - '"%{::osfamily}"'
345             - common
346           datafiles:
347             compute_extraconfig:
348               mapped_data: {get_param: NovaComputeExtraConfig}
349             extraconfig:
350               mapped_data: {get_param: ExtraConfig}
351             common:
352               raw_data: {get_file: hieradata/common.yaml}
353             ceph:
354               raw_data: {get_file: hieradata/ceph.yaml}
355             compute:
356               raw_data: {get_file: hieradata/compute.yaml}
357               mapped_data:
358                 cinder_enable_nfs_backend: {get_input: cinder_enable_nfs_backend}
359                 nova::debug: {get_input: debug}
360                 nova::rabbit_userid: {get_input: rabbit_username}
361                 nova::rabbit_password: {get_input: rabbit_password}
362                 nova::rabbit_use_ssl: {get_input: rabbit_client_use_ssl}
363                 nova::rabbit_port: {get_input: rabbit_client_port}
364                 nova_compute_driver: {get_input: nova_compute_driver}
365                 nova::compute::libvirt::libvirt_virt_type: {get_input: nova_compute_libvirt_type}
366                 nova_api_host: {get_input: nova_api_host}
367                 nova::compute::vncproxy_host: {get_input: nova_public_ip}
368                 nova::compute::rbd::ephemeral_storage: {get_input: nova_enable_rbd_backend}
369                 nova_password: {get_input: nova_password}
370                 nova::compute::vncserver_proxyclient_address: {get_input: nova_vnc_proxyclient_address}
371                 ceilometer::debug: {get_input: debug}
372                 ceilometer::rabbit_userid: {get_input: rabbit_username}
373                 ceilometer::rabbit_password: {get_input: rabbit_password}
374                 ceilometer::rabbit_use_ssl: {get_input: rabbit_client_use_ssl}
375                 ceilometer::rabbit_port: {get_input: rabbit_client_port}
376                 ceilometer::metering_secret: {get_input: ceilometer_metering_secret}
377                 ceilometer::agent::auth::auth_password: {get_input: ceilometer_password}
378                 ceilometer::agent::auth::auth_url: {get_input: ceilometer_agent_auth_url}
379                 ceilometer_compute_agent: {get_input: ceilometer_compute_agent}
380                 snmpd_readonly_user_name: {get_input: snmpd_readonly_user_name}
381                 snmpd_readonly_user_password: {get_input: snmpd_readonly_user_password}
382                 nova::glance_api_servers: {get_input: glance_api_servers}
383                 neutron::debug: {get_input: debug}
384                 neutron::rabbit_password: {get_input: rabbit_password}
385                 neutron::rabbit_user: {get_input: rabbit_user}
386                 neutron::rabbit_use_ssl: {get_input: rabbit_client_use_ssl}
387                 neutron::rabbit_port: {get_input: rabbit_client_port}
388                 neutron_flat_networks: {get_input: neutron_flat_networks}
389                 neutron_host: {get_input: neutron_host}
390                 neutron::agents::ml2::ovs::local_ip: {get_input: neutron_local_ip}
391
392                 neutron_tenant_network_type: {get_input: neutron_tenant_network_type}
393                 neutron_tunnel_types: {get_input: neutron_tunnel_types}
394                 neutron::plugins::ml2::network_vlan_ranges: {get_input: neutron_network_vlan_ranges}
395                 neutron::plugins::ml2::tunnel_id_ranges: {get_input: neutron_tunnel_id_ranges}
396                 neutron::plugins::ml2::vni_ranges: {get_input: neutron_vni_ranges}
397                 neutron_bridge_mappings: {get_input: neutron_bridge_mappings}
398                 neutron::agents::ml2::ovs::enable_tunneling: {get_input: neutron_enable_tunneling}
399                 neutron_physical_bridge: {get_input: neutron_physical_bridge}
400                 neutron_public_interface: {get_input: neutron_public_interface}
401                 nova::network::neutron::neutron_admin_password: {get_input: neutron_password}
402                 nova::network::neutron::neutron_url: {get_input: neutron_url}
403                 nova::network::neutron::neutron_admin_auth_url: {get_input: neutron_admin_auth_url}
404                 neutron_router_distributed: {get_input: neutron_router_distributed}
405                 neutron_agent_mode: {get_input: neutron_agent_mode}
406                 neutron_metadata_proxy_shared_secret: {get_input: neutron_metadata_proxy_shared_secret}
407                 neutron_mechanism_drivers: {get_input: neutron_mechanism_drivers}
408                 neutron_public_interface_raw_device: {get_input: neutron_public_interface_raw_device}
409                 admin_password: {get_input: admin_password}
410                 ntp::servers: {get_input: ntp_servers}
411                 tripleo::packages::enable_install: {get_input: enable_package_install}
412
413   NovaComputeDeployment:
414     type: OS::TripleO::SoftwareDeployment
415     depends_on: NetworkDeployment
416     properties:
417       config: {get_resource: NovaComputeConfig}
418       server: {get_resource: NovaCompute}
419       input_values:
420         cinder_enable_nfs_backend: {get_param: CinderEnableNfsBackend}
421         debug: {get_param: Debug}
422         nova_compute_driver: {get_param: NovaComputeDriver}
423         nova_compute_libvirt_type: {get_param: NovaComputeLibvirtType}
424         nova_public_ip: {get_param: NovaPublicIP}
425         nova_api_host: {get_param: NovaApiHost}
426         nova_password: {get_param: NovaPassword}
427         nova_enable_rbd_backend: {get_param: NovaEnableRbdBackend}
428         nova_vnc_proxyclient_address: {get_attr: [NetIpMap, net_ip_map, {get_param: [ServiceNetMap, NovaVncProxyNetwork]}]}
429         ceilometer_metering_secret: {get_param: CeilometerMeteringSecret}
430         ceilometer_password: {get_param: CeilometerPassword}
431         ceilometer_compute_agent: {get_param: CeilometerComputeAgent}
432         ceilometer_agent_auth_url:
433           list_join:
434             - ''
435             - - 'http://'
436               - {get_param: KeystonePublicApiVirtualIP}
437               - ':5000/v2.0'
438         snmpd_readonly_user_name: {get_param: SnmpdReadonlyUserName}
439         snmpd_readonly_user_password: {get_param: SnmpdReadonlyUserPassword}
440         glance_api_servers:
441           list_join:
442             - ''
443             - - {get_param: GlanceProtocol}
444               - '://'
445               - {get_param: GlanceHost}
446               - ':'
447               - {get_param: GlancePort}
448         neutron_flat_networks: {get_param: NeutronFlatNetworks}
449         neutron_host: {get_param: NeutronHost}
450         neutron_local_ip: {get_attr: [NetIpMap, net_ip_map, {get_param: [ServiceNetMap, NeutronTenantNetwork]}]}
451         neutron_tenant_network_type: {get_param: NeutronNetworkType}
452         neutron_tunnel_types: {get_param: NeutronTunnelTypes}
453         neutron_tunnel_id_ranges:
454           str_replace:
455             template: "['RANGES']"
456             params:
457               RANGES:
458                 list_join:
459                 - "','"
460                 - {get_param: NeutronTunnelIdRanges}
461         neutron_vni_ranges:
462           str_replace:
463             template: "['RANGES']"
464             params:
465               RANGES:
466                 list_join:
467                 - "','"
468                 - {get_param: NeutronVniRanges}
469         neutron_network_vlan_ranges:
470           str_replace:
471             template: "['RANGES']"
472             params:
473               RANGES:
474                 list_join:
475                 - "','"
476                 - {get_param: NeutronNetworkVLANRanges}
477         neutron_bridge_mappings: {get_param: NeutronBridgeMappings}
478         neutron_enable_tunneling: {get_param: NeutronEnableTunnelling}
479         neutron_physical_bridge: {get_param: NeutronPhysicalBridge}
480         neutron_public_interface: {get_param: NeutronPublicInterface}
481         neutron_password: {get_param: NeutronPassword}
482         neutron_agent_mode: {get_param: NeutronAgentMode}
483         neutron_router_distributed: {get_param: NeutronDVR}
484         neutron_metadata_proxy_shared_secret: {get_param: NeutronMetadataProxySharedSecret}
485         neutron_mechanism_drivers: {get_param: NeutronMechanismDrivers}
486         neutron_public_interface_raw_device: {get_param: NeutronPublicInterfaceRawDevice}
487         neutron_url:
488           list_join:
489             - ''
490             - - 'http://'
491               - {get_param: NeutronHost}
492               - ':9696'
493         neutron_admin_auth_url:
494           list_join:
495             - ''
496             - - 'http://'
497               - {get_param: KeystoneAdminApiVirtualIP}
498               - ':35357/v2.0'
499         admin_password: {get_param: AdminPassword}
500         rabbit_username: {get_param: RabbitUserName}
501         rabbit_password: {get_param: RabbitPassword}
502         rabbit_client_use_ssl: {get_param: RabbitClientUseSSL}
503         rabbit_client_port: {get_param: RabbitClientPort}
504         ntp_servers:
505           str_replace:
506             template: '["server"]'
507             params:
508               server: {get_param: NtpServer}
509         enable_package_install: {get_param: EnablePackageInstall}
510
511   # Hook for site-specific additional pre-deployment config, e.g extra hieradata
512   ComputeExtraConfigPre:
513     depends_on: NovaComputeDeployment
514     type: OS::TripleO::ComputeExtraConfigPre
515     properties:
516         server: {get_resource: NovaCompute}
517
518   UpdateConfig:
519     type: OS::TripleO::Tasks::PackageUpdate
520
521   UpdateDeployment:
522     type: OS::Heat::SoftwareDeployment
523     properties:
524       config: {get_resource: UpdateConfig}
525       server: {get_resource: NovaCompute}
526       input_values:
527         update_identifier:
528           get_param: UpdateIdentifier
529
530 outputs:
531   ip_address:
532     description: IP address of the server in the ctlplane network
533     value: {get_attr: [NovaCompute, networks, ctlplane, 0]}
534   internal_api_ip_address:
535     description: IP address of the server in the internal_api network
536     value: {get_attr: [InternalApiPort, ip_address]}
537   storage_ip_address:
538     description: IP address of the server in the storage network
539     value: {get_attr: [StoragePort, ip_address]}
540   tenant_ip_address:
541     description: IP address of the server in the tenant network
542     value: {get_attr: [TenantPort, ip_address]}
543   hostname:
544     description: Hostname of the server
545     value: {get_attr: [NovaCompute, name]}
546   hosts_entry:
547     description: >
548       Server's IP address and hostname in the /etc/hosts format
549     value:
550       str_replace:
551         template: "IP HOST.localdomain HOST"
552         params:
553           IP: {get_attr: [NetIpMap, net_ip_map, {get_param: [ServiceNetMap, ComputeHostnameResolveNetwork]}]}
554           HOST: {get_attr: [NovaCompute, name]}
555   nova_server_resource:
556     description: Heat resource handle for the Nova compute server
557     value:
558       {get_resource: NovaCompute}
559   config_identifier:
560     description: identifier which changes if the node configuration may need re-applying
561     value:
562       list_join:
563       - ','
564       - - {get_attr: [NovaComputeDeployment, deploy_stdout]}
565         - {get_attr: [ComputeExtraConfigPre, deploy_stdout]}