1 heat_template_version: 2013-05-23
4 Test template using all resources supported on the Rackspace Public Cloud
11 description: Database access password
16 description: Flavor name for the devops server
17 default: 4 GB Performance
21 - 4GB Standard Instance
25 description: API Servers flavor id
26 default: performance1-1
30 - "3" # 1GB Standard Instance
35 type: OS::Heat::RandomString
40 type: OS::Nova::KeyPair
42 name: { get_resource: random_key_name }
43 save_private_key: true
46 type: OS::Heat::RandomString
49 type: Rackspace::Cloud::Network
55 type: OS::Cinder::Volume
60 image: CentOS 7 (PVHVM)
63 type: OS::Nova::Server
65 name: ksink-BFV-server
66 flavor: 2 GB Performance
67 block_device_mapping: [{volume_id: {get_resource: boot_from_vol_vol}, device_name: vda, delete_on_termination: false}]
70 # type: OS::Neutron::Net
72 # name: ksink-neutron-net
75 # type: OS::Neutron::Subnet
77 # name: ksink-subnet-1
78 # network: { get_resource: neutron_network }
79 # cidr: 192.168.0.0/24
83 # type: OS::Neutron::Port
86 # network: { get_resource: neutron_network }
88 gentoo_server: # Should create as long as there's no user_data
89 type: Rackspace::Cloud::Server
91 flavor: 1 GB Performance
92 image: 26c630fe-ba65-4cd2-ad69-1d808766a54b # Gentoo 14.4
95 type: OS::Nova::Server
97 name: kitchen_sink_ops01
99 rax-heat: { get_param: "OS::stack_id" }
100 image: 042395fc-728c-4763-86f9-9b0cacb00701 #CentOS 6.5
101 flavor: { get_param: devops_flavor }
102 key_name: { get_resource: access_key }
104 - uuid: "00000000-0000-0000-0000-000000000000"
105 - uuid: "11111111-1111-1111-1111-111111111111"
106 - uuid: { get_resource: priv_network }
108 ################################################################
109 #### THIS IS BROKEN ATM: https://jira.rax.io/browse/HEAT-789 ###
110 ################################################################
111 # devops_chefsolo_berkshelf:
112 # type: "OS::Heat::ChefSolo"
113 # depends_on: devops_chefsolo_kitchen_centos
115 # private_key: {get_attr: [access_key, private_key]}
116 # host: {get_attr: [devops_server, accessIPv4]}
117 # chef_version: "11.12.0"
126 # "locked_version": "2.3.8"
134 devops_chefsolo_kitchen_centos:
135 type: "OS::Heat::ChefSolo"
137 private_key: {get_attr: [access_key, private_key]}
138 host: {get_attr: [devops_server, accessIPv4]}
139 kitchen: "https://github.com/heat-ci/heat-templates.git"
144 type: OS::Cinder::Volume
146 name: kitchen_sink_devops_vol
148 rax-heat: { get_param: "OS::stack_id" }
150 description: Created from the kitchen_sink test Heat template
153 type: OS::Cinder::VolumeAttachment
155 instance_uuid: { get_resource: devops_server }
156 volume_id: { get_resource: devops_volume }
159 type: Rackspace::AutoScale::Group
162 name: kitchen_sink_api_asgroup
164 rax-heat: { get_param: "OS::stack_id" }
172 - loadBalancerId: { get_resource: api_loadbalancer }
175 name: kitchen_sink_api
176 flavorRef: { get_param: api_flavor_ref }
177 imageRef: ffd597d6-2cc4-4b43-b8f4-b1006715b84e
178 key_name: { get_resource: access_key }
180 /tmp/testfile: "testfile"
182 - uuid: "11111111-1111-1111-1111-111111111111"
183 - uuid: { get_resource: priv_network }
185 api_servers_no_personality:
186 type: Rackspace::AutoScale::Group
189 name: kitchen_sink_api_asgroup_no_personality
191 rax-heat: { get_param: "OS::stack_id" }
199 - loadBalancerId: { get_resource: api_loadbalancer }
202 name: kitchen_sink_api
203 flavorRef: { get_param: api_flavor_ref }
204 imageRef: df27d481-63a5-40ca-8920-3d132ed643d9
205 key_name: { get_resource: access_key }
207 - uuid: "11111111-1111-1111-1111-111111111111"
208 - uuid: { get_resource: priv_network }
211 type: Rackspace::AutoScale::ScalingPolicy
213 group: { get_resource: api_servers }
214 name: Scale up api servers
219 api_scale_up_webhook:
220 type: Rackspace::AutoScale::WebHook
222 name: triggerApiScaleUp
224 rax-heat: { get_param: "OS::stack_id" }
225 policy: { get_resource: api_scale_up_policy }
227 api_scale_down_policy:
228 type: Rackspace::AutoScale::ScalingPolicy
230 group: { get_resource: api_servers }
231 name: Scale down api servers
236 api_scale_down_webhook:
237 type: Rackspace::AutoScale::WebHook
239 name: triggerApiScaleUp
241 rax-heat: { get_param: "OS::stack_id" }
242 policy: { get_resource: api_scale_down_policy }
245 type: Rackspace::Cloud::LoadBalancer
247 name: kitchen_sink_api_lb
249 rax-heat: { get_param: "OS::stack_id" }
252 algorithm: ROUND_ROBIN
259 type: Rackspace::Cloud::LoadBalancer
261 name: ksink_shared_vip_https
263 rax-heat: { get_param: "OS::stack_id" }
266 algorithm: ROUND_ROBIN
269 - id: { get_attr: [ api_loadbalancer, virtualIps, 0, id ] }
272 type: Rackspace::Cloud::LoadBalancer
276 template: "stack-redir-lb"
278 stack: { get_param: "OS::stack_name" }
280 rax-heat: { get_param: "OS::stack_id" }
284 algorithm: ROUND_ROBIN
291 type: OS::Heat::SwiftSignal
293 handle: {get_resource: wait_handle}
298 type: OS::Heat::SwiftSignalHandle
301 type: OS::Nova::Server
303 image: 4b14a92e-84c8-4770-9245-91ecb8501cc2 # CentOS
304 flavor: 1 GB Performance
305 key_name: { get_resource: access_key }
307 rax-heat: { get_param: "OS::stack_id" }
308 heat-stack-name: { get_param: "OS::stack_name" }
311 # - uuid: "11111111-1111-1111-1111-111111111111"
312 # - uuid: { get_resource: neutron_network }
313 user_data_format: RAW
318 # Below are some examples of the various ways signals
319 # can be sent to the Handle resource
321 # Simple success signal
322 wc_notify --data-binary '{"status": "SUCCESS"}'
324 # Or you optionally can specify any of the additional fields
325 wc_notify --data-binary '{"status": "SUCCESS", "reason": "signal2"}'
326 wc_notify --data-binary '{"status": "SUCCESS", "reason": "signal3", "data": "data3"}'
327 wc_notify --data-binary '{"status": "SUCCESS", "reason": "signal4", "data": "data4"}'
329 # If you require control of the ID, you can pass it.
330 # The ID should be unique, unless you intend for duplicate
331 # signals to overrite each other. The following two calls
332 # do the exact same thing, and will be treated as one signal
333 # (You can prove this by changing count above to 7)
334 wc_notify --data-binary '{"status": "SUCCESS", "id": "5"}'
335 wc_notify --data-binary '{"status": "SUCCESS", "id": "5"}'
337 # Example of sending a failure signal, optionally
338 # reason, id, and data can be specified as above
339 # wc_notify --data-binary '{"status": "FAILURE"}'
342 wc_notify: { get_attr: ['wait_handle', 'curl_cli'] }
345 type: Rackspace::Cloud::DNS
346 depends_on: wait_on_server
350 template: "a%domain%.com"
352 "%domain%": { get_resource: domain_name }
355 template: "admin@{domain}"
359 template: "a%domain%.com"
361 "%domain%": { get_resource: domain_name }
365 template: "a%domain%.com"
367 "%domain%": { get_resource: domain_name }
369 data: { get_attr: [api_loadbalancer, PublicIp] }
372 type: OS::Heat::ResourceGroup
373 depends_on: service_db
377 type: Rackspace::Cloud::Server
379 name: "kitchen_sink_engine_%index%"
380 image: 6f29d6a6-9972-4ae0-aa80-040fa2d6a9cf # Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM)
381 flavor: { get_param: devops_flavor }
382 key_name: { get_resource: access_key }
384 - uuid: { get_resource: priv_network }
385 - uuid: "00000000-0000-0000-0000-000000000000"
386 - uuid: "11111111-1111-1111-1111-111111111111"
389 echo "hello world" > /root/hello-world.txt
392 type: "Rackspace::Cloud::WinServer"
394 name: wordpress_windows_server
395 flavor: 4GB Standard Instance
396 image: Windows Server 2012
398 $source = "http://download.microsoft.com/download/7/0/4/704CEB4C-9F42-4962-A2B0-5C84B0682C7A/WebPlatformInstaller_amd64_en-US.msi"
399 $destination = "webpi.msi"
400 $wc = New-Object System.Net.WebClient
401 $wc.DownloadFile($source, $destination)
404 type: OS::Trove::Instance
406 name: kitchen_sink_db
410 - name: kitchen_sink_data
413 password: { get_param: db_pass }
414 databases: [ kitchen_sink_data ]
416 # This needs an image with heat_cfntools on it to use Metadata; basic
417 # test here to make sure we can actually pop the server and do simple
418 # user data and a signal
420 type: AWS::EC2::Instance
422 ImageId: 753a7703-4960-488b-aab4-a3cdd4b276dc # Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM)
423 InstanceType: { get_param: devops_flavor }
424 KeyName: { get_resource: access_key }
430 apt-get -y install curl
432 curl -i -X PUT --data-binary '{"status": "SUCCESS", "reason": "AWS Signal"}' "wc_notify"
434 wc_notify: { get_resource: aws_handle }
437 type: AWS::CloudFormation::WaitConditionHandle
440 type: AWS::CloudFormation::WaitCondition
442 Handle: { get_resource: aws_handle }
446 type: OS::Swift::Container
448 name: { get_resource: random_key_name }
451 type: AWS::ElasticLoadBalancing::LoadBalancer
453 AvailabilityZones: []
458 LoadBalancerPort: 8945,
465 UnhealthyThreshold: 10
470 type: https://raw.githubusercontent.com/heat-ci/heat-templates/master/dev/provider_resource.template
472 flavor: { get_param: devops_flavor }
473 image: 753a7703-4960-488b-aab4-a3cdd4b276dc # Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM)
474 key_name: { get_resource: access_key }
478 "Private Network ID":
479 value: { get_resource: priv_network }
480 description: Private Network ID
483 value: { get_resource: neutron_network }
485 "Wait Condition data":
486 value: { get_attr: [ wait_on_server, data ] }
489 value: { get_attr: [ random_key_name, value ] }
490 description: Random String
492 "Swift Container ID":
493 value: { get_resource: object_store }
494 description: Swift Container ID
497 value: { get_resource: devops_server }
498 description: Dev Ops Server ID
501 value: { get_resource: devops_volume }
502 description: Dev Ops Volume ID
504 "API servers auto scale group ID":
505 value: { get_resource: api_servers }
506 description: API servers auto scale group ID
508 "API servers auto scale group ID":
509 value: { get_resource: api_servers_no_personality }
510 description: API servers auto scale group ID
512 "Scale UP API servers webhook":
513 value: { get_attr: [ api_scale_up_webhook, executeUrl ] }
514 description: Scale UP API servers webhook
516 "Scale DOWN API servers webhook":
517 value: { get_attr: [ api_scale_down_webhook, executeUrl ] }
518 description: Scale DOWN API servers webhook
521 value: { get_resource: api_loadbalancer }
522 description: Load Balancer ID
525 value: { get_attr: [ api_loadbalancer, PublicIp ] }
526 description: Load Balancer IP
529 value: { get_resource: service_domain }
530 description: DNS Domain ID
533 value: { get_attr: [ engine_nodes, refs ] }
534 description: Engine Node IDs
537 value: { get_resource: service_db }
538 description: Database instance ID
540 "Access Private Key":
541 value: { get_attr: [ access_key, private_key ] }
542 description: SSH access private key
545 value: { get_resource: aws_server }
546 description: ID of the AWS::EC2::Instance resource
549 value: { get_attr: [ rs_windows_server, accessIPv4 ] }
550 description: Windows Server IP