blob: fdb03359fea3893ec79555bc818b80c71394afc0 [file] [log] [blame]
Pavlo Shchelokovskyy9ede1852015-03-19 17:54:52 +00001heat_template_version: 2015-10-15
2
3description: |
4 Simplest web-app using netcat reporting only hostname.
5 Specifically tailored for minimal Cirros image.
6
7parameters:
8
9 app_port:
10 type: number
11
12 wc_curl_cli:
13 type: string
14
15resources:
16
17 webapp_nc:
18 type: OS::Heat::SoftwareConfig
19 properties:
20 group: ungrouped
21 config:
22 str_replace:
23 template: |
24 #! /bin/sh -v
25 Body=$(hostname)
26 Response="HTTP/1.1 200 OK\r\nContent-Length: ${#Body}\r\n\r\n$Body"
27 wc_notify --data-binary '{"status": "SUCCESS"}'
28 while true ; do echo -e $Response | nc -llp PORT; done
29 params:
30 PORT: { get_param: app_port }
31 wc_notify: { get_param: wc_curl_cli }
32
33outputs:
34 OS::stack_id:
35 value: { get_resource: webapp_nc }