3a8aa828bc
Task: 36946 Depends-On: https://review.opendev.org/#/c/700512/ Change-Id: I0689ac7e434b6e621e8d3a3be9d3420eea570e68
44 lines
1010 B
YAML
44 lines
1010 B
YAML
heat_template_version: 2015-10-15
|
|
|
|
description: |
|
|
Simplest web-app using netcat reporting only hostname.
|
|
Specifically tailored for minimal Cirros image.
|
|
|
|
parameters:
|
|
|
|
app_port:
|
|
type: number
|
|
|
|
wc_curl_cli:
|
|
type: string
|
|
|
|
resources:
|
|
|
|
webapp_nc:
|
|
type: OS::Heat::SoftwareConfig
|
|
properties:
|
|
group: ungrouped
|
|
config:
|
|
str_replace:
|
|
template: |
|
|
#! /bin/sh -v
|
|
Body=$(hostname)
|
|
Response="HTTP/1.1 200 OK\r\nContent-Length: ${#Body}\r\n\r\n$Body"
|
|
while true; do
|
|
wc_notify --data-binary '{"status": "SUCCESS"}'
|
|
if [ $? -eq 0 ]; then
|
|
break
|
|
fi
|
|
sleep 10
|
|
done
|
|
while true ; do
|
|
echo -e $Response | nc -llp PORT
|
|
done
|
|
params:
|
|
PORT: { get_param: app_port }
|
|
wc_notify: { get_param: wc_curl_cli }
|
|
|
|
outputs:
|
|
OS::stack_id:
|
|
value: { get_resource: webapp_nc }
|