From a0cd66d78088fb9d44710f41c98f8ff078e08f67 Mon Sep 17 00:00:00 2001 From: tengqm Date: Mon, 26 Jan 2015 22:27:35 +0800 Subject: [PATCH] Example spec for creating profile of os.heat.stack type --- examples/profiles/README.rst | 24 +++++++++++++++++++ examples/profiles/env.yaml | 4 ++++ .../profiles/heat_stack_random_string.spec | 6 +++++ ...de_stack.yaml => random_string_stack.yaml} | 3 +++ examples/profiles/test_script.sh | 3 +++ 5 files changed, 40 insertions(+) create mode 100644 examples/profiles/README.rst create mode 100644 examples/profiles/env.yaml create mode 100644 examples/profiles/heat_stack_random_string.spec rename examples/profiles/{node_stack.yaml => random_string_stack.yaml} (76%) create mode 100644 examples/profiles/test_script.sh diff --git a/examples/profiles/README.rst b/examples/profiles/README.rst new file mode 100644 index 000000000..56461b2db --- /dev/null +++ b/examples/profiles/README.rst @@ -0,0 +1,24 @@ +How To Use the Sample Spec File +=============================== + +This directory contains a sample spec file that can be used to create a +profile of type 'os.heat.stack'. It demonstrates how to use environment +files when creating a profile and how to assign default parameters for +the stack to use. In addition to that, it shows an example about making +use of the 'get_file' function supported by Heat. + +To create a profile using the spec, use the following command:: + + senlin profile-create \ + -t os.heat.stack \ + -s heat_stack_random_string.spec \ + -p 1111 + my_stack + +To get help on the command line options for creating profiles:: + + senlin profile-create + +To show the profile created:: + + senlin profile-show diff --git a/examples/profiles/env.yaml b/examples/profiles/env.yaml new file mode 100644 index 000000000..ec240f406 --- /dev/null +++ b/examples/profiles/env.yaml @@ -0,0 +1,4 @@ +resource_registry: + 'os.heat.server': 'OS::Heat::Server' +parameters: + username: admin diff --git a/examples/profiles/heat_stack_random_string.spec b/examples/profiles/heat_stack_random_string.spec new file mode 100644 index 000000000..5830946b3 --- /dev/null +++ b/examples/profiles/heat_stack_random_string.spec @@ -0,0 +1,6 @@ +name: random_string_stack +template: random_string_stack.yaml +parameters: + len: 16 +environment: + - env.yaml diff --git a/examples/profiles/node_stack.yaml b/examples/profiles/random_string_stack.yaml similarity index 76% rename from examples/profiles/node_stack.yaml rename to examples/profiles/random_string_stack.yaml index e099bf3f8..90cb092dd 100644 --- a/examples/profiles/node_stack.yaml +++ b/examples/profiles/random_string_stack.yaml @@ -2,6 +2,9 @@ heat_template_version: 2014-10-16 parameters: len: type: integer + file: + type: string + default: {get_file: test_script.sh} resources: random: type: OS::Heat::RandomString diff --git a/examples/profiles/test_script.sh b/examples/profiles/test_script.sh new file mode 100644 index 000000000..52041cf5d --- /dev/null +++ b/examples/profiles/test_script.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +echo "this is a test script file"