api-site/firstapp/samples/heat/hello_faafo.yaml
Martin Paulo 6bc079176f Added a heat template to build Faafo
The added template builds Faafo as an all-in-one install.

Change-Id: Ie5e2df904c7f1fb0cee6c1238c5523495d1b93f2
2015-11-19 20:48:35 -06:00

90 lines
2.4 KiB
YAML

heat_template_version: 2014-10-16
description: |
A template to bring up the faafo application as an all in one install
parameters:
key_name:
type: string
description: Name of an existing KeyPair to enable SSH access to the instances
default: id_rsa
constraints:
- custom_constraint: nova.keypair
description: Must already exist on your cloud
flavor:
type: string
description: The flavor the application is to use
constraints:
- custom_constraint: nova.flavor
description: Must be a valid flavor provided by your cloud provider.
image_id:
type: string
description: ID of the image to use to create the instance
constraints:
- custom_constraint: glance.image
description: Must be a valid image on your cloud
faafo_source:
type: string
description: The http location of the faafo application install script
default: https://git.openstack.org/cgit/openstack/faafo/plain/contrib/install.sh
resources:
security_group:
type: OS::Neutron::SecurityGroup
properties:
description: "SSH and HTTP for the all in one server"
rules: [
{remote_ip_prefix: 0.0.0.0/0,
protocol: tcp,
port_range_min: 22,
port_range_max: 22},
{remote_ip_prefix: 0.0.0.0/0,
protocol: tcp,
port_range_min: 80,
port_range_max: 80},]
server:
type: OS::Nova::Server
properties:
image: { get_param: image_id }
flavor: { get_param: flavor }
key_name: { get_param: key_name }
security_groups:
- {get_resource: security_group}
user_data_format: RAW
user_data:
str_replace:
template: |
#!/usr/bin/env bash
curl -L -s faafo_installer | bash -s -- \
-i faafo -i messaging -r api -r worker -r demo
wc_notify --data-binary '{"status": "SUCCESS"}'
params:
wc_notify: { get_attr: ['wait_handle', 'curl_cli'] }
faafo_installer: { get_param: faafo_source }
wait_handle:
type: OS::Heat::WaitConditionHandle
wait_condition:
type: OS::Heat::WaitCondition
depends_on: server
properties:
handle: { get_resource: wait_handle }
count: 1
# we'll give it 10 minutes
timeout: 600
outputs:
faafo_ip:
description: The faafo url
value:
list_join: ['', ['Faafo can be found at: http://', get_attr: [server, first_address]]]