Skip to content

Instantly share code, notes, and snippets.

@pratikmallya
Last active August 29, 2015 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pratikmallya/5a02d89653ae35b2667f to your computer and use it in GitHub Desktop.
Save pratikmallya/5a02d89653ae35b2667f 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: OS::Nova::Server
properties:
image: 4b14a92e-84c8-4770-9245-91ecb8501cc2
flavor: 1 GB Performance
user_data:
str_replace:
template: |
#!/bin/bash -x
# assume you are doing a long running operation here
sleep 10
# 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