Skip to content

Instantly share code, notes, and snippets.

@pratikmallya
Last active September 1, 2015 11:01
Show Gist options
  • Save pratikmallya/41bf51caa8b0d6b7acae to your computer and use it in GitHub Desktop.
Save pratikmallya/41bf51caa8b0d6b7acae to your computer and use it in GitHub Desktop.
heat_template_version: 2014-10-16
description: |
Single node linux server with swift signaling.
resources:
signal_handle:
type: "OS::Heat::SwiftSignalHandle"
linux_server:
type:
get_file: https://gist.githubusercontent.com/pratikmallya/47cf721ecf0822555990/raw/869107a0084c528e50bed449a520a650d14fb2a0/gistfile1.txt
properties:
image: Debian 7 (Wheezy) (PVHVM)
flavor: 1 GB Performance
user_data:
str_replace:
template: |
#!/bin/bash -x
# assume you are doing a long running operation here
sleep 300
# Assuming long running operation completed successfully, notify success signal
wc_notify --data-binary '{"status": "SUCCESS"}'
params:
wc_notify: { get_attr: ['signal_handle', 'curl_cli'] }
wait_on_server:
type: OS::Heat::SwiftSignal
properties:
handle: {get_resource: signal_handle}
count: 1
timeout: 600
outputs:
signal_url:
value: { get_attr: ['signal_handle', 'curl_cli'] }
description: Swift signal URL
server_public_ip:
value: { get_attr: [ linux_server, accessIPv4 ] }
description: Linux server public IP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment