forked from NeCTAR-RC/heat-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample-deploy-sequence.yaml
More file actions
130 lines (111 loc) · 3.04 KB
/
Copy pathexample-deploy-sequence.yaml
File metadata and controls
130 lines (111 loc) · 3.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
heat_template_version: 2013-05-23
### A modified copy of
### https://github.com/openstack/heat-templates/tree/master/hot/software-config/example-templates
### Original: example-deploy-sequence.yaml
### Changes: Added some defaults, ie. a NeCTAR image
### It only works with images that have the full Heat software installed on them...
### None of the Nectar images do at the moment :(
###################################################################
# The example is designed to demo how software deployment to handle
# dependencies.
#
# The scenario:
# deployment_c -- hosted on --> server_a
# | (explicit depends on via depends_on property)
# deployment_b -- hosted on --> server_b
# | (implicit depends on via get_attr in input_values property)
# deployment_a -- hosted on --> server_a
#
# So the right deployment sequence should be:
# deployment_a (server_a)
# -->
# deployment_b (server_b)
# -->
# deployment_c (back to server_a)
#
# How to deploy the sample:
#
# 1. Create on image with element heat-config-script in
# 2. heat stack-create -f example-deploy-sequence.yaml sequence
# 3. heat stack-show sequence
###################################################################
parameters:
key_name:
type: string
flavor:
type: string
default: m1.small
image:
type: string
default: 7313d773-3cd9-4e69-98d2-eff1f9797480
resources:
config:
type: OS::Heat::SoftwareConfig
properties:
inputs:
- name: previous
default: 'NONE'
group: script
config: |
#!/bin/bash
echo "Previous: $previous"
echo "${deploy_resource_name} is running on $(hostname) at $(date)"
deployment_a:
type: OS::Heat::SoftwareDeployment
properties:
config:
get_resource: config
server:
get_resource: server_a
deployment_b:
type: OS::Heat::SoftwareDeployment
properties:
input_values:
previous:
get_attr: [deployment_a, deploy_stdout]
config:
get_resource: config
server:
get_resource: server_b
deployment_c:
type: OS::Heat::SoftwareDeployment
depends_on: deployment_b
properties:
input_values:
previous: 'deployment_b'
config:
get_resource: config
server:
get_resource: server_a
server_a:
type: OS::Nova::Server
properties:
image:
get_param: image
flavor:
get_param: flavor
key_name:
get_param: key_name
user_data_format: SOFTWARE_CONFIG
software_config_transport: POLL_SERVER_HEAT
server_b:
type: OS::Nova::Server
properties:
image:
get_param: image
flavor:
get_param: flavor
key_name:
get_param: key_name
user_data_format: SOFTWARE_CONFIG
software_config_transport: POLL_SERVER_HEAT
outputs:
deployment_a_stdout:
value:
get_attr: [deployment_a, deploy_stdout]
deployment_b_stdout:
value:
get_attr: [deployment_b, deploy_stdout]
deployment_c_stdout:
value:
get_attr: [deployment_c, deploy_stdout]