Pavlo Shchelokovskyy | 9ede185 | 2015-03-19 17:54:52 +0000 | [diff] [blame] | 1 | heat_template_version: 2015-10-15 |
| 2 | |
| 3 | description: | |
| 4 | Simplest web-app using netcat reporting only hostname. |
| 5 | Specifically tailored for minimal Cirros image. |
| 6 | |
| 7 | parameters: |
| 8 | |
| 9 | app_port: |
| 10 | type: number |
| 11 | |
| 12 | wc_curl_cli: |
| 13 | type: string |
| 14 | |
| 15 | resources: |
| 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 | |
| 33 | outputs: |
| 34 | OS::stack_id: |
| 35 | value: { get_resource: webapp_nc } |