e9d9662bb6
Currently most OpenStack code is linted, but YAML files are not. As a result, sometimes YAML problems enter the code base (e.g., the key duplicate fixed in change I7f2369adfb152fd2a74b9b105e969e653e592922). This patch enables YAML linting in tox linting tests, using the yamllint tool [1]. It checks syntax errors, key duplicates, and cosmetic problems. [1]: http://yamllint.readthedocs.org/ EDIT: It also fixes six errors (including key duplicates) that entered the code base after the first fix change was merged. (I7f2369adfb152fd2a74b9b105e969e653e592922) Change-Id: Ie746230f28fe3ed0cf218201d5a3810f7bc44070
96 lines
2.3 KiB
YAML
96 lines
2.3 KiB
YAML
heat_template_version: 2016-04-08
|
|
|
|
description: >
|
|
This template demostrate how to use senlin resources to create
|
|
a flexible cluster.
|
|
|
|
parameters:
|
|
flavor:
|
|
description: Flavor for the instances to be created.
|
|
type: string
|
|
default: m1.nano
|
|
image:
|
|
description: Name or ID of the image to use for the instances.
|
|
type: string
|
|
default: cirros-0.3.4-x86_64-uec
|
|
key_name:
|
|
description: Name of an existing key pair to use for the instances.
|
|
type: string
|
|
network:
|
|
description: The network for the instances.
|
|
type: string
|
|
default: private
|
|
|
|
resources:
|
|
profile:
|
|
type: OS::Senlin::Profile
|
|
properties:
|
|
type: os.nova.server-1.0
|
|
properties:
|
|
flavor: {get_param: flavor}
|
|
image: {get_param: image}
|
|
key_name: {get_param: key_name}
|
|
networks:
|
|
- network: {get_param: network}
|
|
|
|
cluster:
|
|
type: OS::Senlin::Cluster
|
|
properties:
|
|
desired_capacity: 1
|
|
profile: {get_resource: profile}
|
|
|
|
scale_in_policy:
|
|
type: OS::Senlin::Policy
|
|
properties:
|
|
type: senlin.policy.scaling-1.0
|
|
bindings:
|
|
- cluster: {get_resource: cluster}
|
|
properties:
|
|
event: CLUSTER_SCALE_IN
|
|
adjustment:
|
|
type: CHANGE_IN_CAPACITY
|
|
number: 1
|
|
|
|
scale_out_policy:
|
|
type: OS::Senlin::Policy
|
|
properties:
|
|
type: senlin.policy.scaling-1.0
|
|
bindings:
|
|
- cluster: {get_resource: cluster}
|
|
properties:
|
|
event: CLUSTER_SCALE_OUT
|
|
adjustment:
|
|
type: CHANGE_IN_CAPACITY
|
|
number: 1
|
|
|
|
receiver_scale_out:
|
|
type: OS::Senlin::Receiver
|
|
properties:
|
|
cluster: {get_resource: cluster}
|
|
action: CLUSTER_SCALE_OUT
|
|
type: webhook
|
|
|
|
receiver_scale_in:
|
|
type: OS::Senlin::Receiver
|
|
properties:
|
|
cluster: {get_resource: cluster}
|
|
action: CLUSTER_SCALE_IN
|
|
type: webhook
|
|
|
|
outputs:
|
|
webhook_scale_out:
|
|
description: Webhook to scale out cluster.
|
|
value:
|
|
str_replace:
|
|
template: curl -X POST LINK
|
|
params:
|
|
LINK: {get_attr: [receiver_scale_out, channel, alarm_url]}
|
|
|
|
webhook_scale_in:
|
|
description: Webhook to scale in cluster.
|
|
value:
|
|
str_replace:
|
|
template: curl -X POST LINK
|
|
params:
|
|
LINK: {get_attr: [receiver_scale_in, channel, alarm_url]}
|