-
Notifications
You must be signed in to change notification settings - Fork 7
/
node-web.yaml
217 lines (191 loc) · 5.72 KB
/
node-web.yaml
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
heat_template_version: 2013-05-23
description: |
Heat template to deploy a single Node.js server
parameters:
hostname:
label: Server Name
description: Server Name
type: string
default: nodejs
constraints:
- length:
min: 1
max: 64
- allowed_pattern: "^[a-zA-Z][a-zA-Z0-9-]*$"
description: |
Must begin with a letter and contain only alphanumeric characters.
server_count:
label: Server Count
description: |
Required: Number of servers to spin up as a part of this deployment.
type: number
default: 2
constraints:
- range:
min: 1
max: 25
description: Must be between 1 and 25 servers.
image:
label: Operating System
description: |
Required: Server image used for all servers that are created as a part of
this deployment.
type: string
default: Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM)
constraints:
- allowed_values:
- Ubuntu 12.04 LTS (Precise Pangolin) (PVHVM)
- Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM)
description: Must be a supported operating system.
flavor:
label: Server Size
description: |
Required: Rackspace Cloud Server flavor to use. The size is based on the
amount of RAM for the provisioned server.
type: string
default: 4 GB General Purpose v1
constraints:
- allowed_values:
- 1 GB General Purpose v1
- 2 GB General Purpose v1
- 4 GB General Purpose v1
- 8 GB General Purpose v1
- 15 GB I/O v1
- 30 GB I/O v1
- 60 GB I/O v1
- 90 GB Performance
- 512MB Standard Instance
- 1GB Standard Instance
- 2GB Standard Instance
- 4GB Standard Instance
- 8GB Standard Instance
- 15GB Standard Instance
- 30GB Standard Instance
description: |
Must be a valid Rackspace Cloud Server flavor for the region you have
selected to deploy into.
ssh_key_name:
description: Nova keypair name for ssh access to the server
type: string
ssh_private_key:
description: Private SSH key
type: string
default: false
kitchen:
description: URL for the kitchen to use
type: string
default: https://github.com/rackspace-orchestration-templates/nodejs-clouddb
chef_version:
description: Version of chef client to use
type: string
default: 11.16.0
child_template:
type: string
default: https://raw.githubusercontent.com/rackspace-orchestration-templates/nodejs-clouddb/master/node-web.yaml
revision:
label: Revision
description: |
Optional: Git Branch/Ref to deploy. Default: HEAD
type: string
default: HEAD
packages:
label: System Packages
description: |
Optional: Additional system packages to install. For a list of available
packages, see: http://packages.ubuntu.com/precise/allpackages
type: string
default: ''
repo:
label: Git Repository
description: |
Optional: URL to your git repository. Use the https:// syntax for public
repositories, use git@ syntax for private repositories.
type: string
default: ''
deploy_key:
label: Git Deploy Key
description: |
Optional: If you specified a private repository, provide your private
deploy key here.
type: string
default: ''
destination:
label: Site Path
description: Path to setup your application on your servers.
default: /var/www/vhosts/application
type: string
stack_id:
type: string
default: node
db_server_ip:
type: string
default: ''
database_username:
type: string
default: ''
database_user_password:
type: string
default: ''
resources:
nodejs_user_password:
type: "OS::Heat::RandomString"
properties:
length: 16
sequence: lettersdigits
nodestack_node:
type: 'OS::Nova::Server'
properties:
name: { get_param: hostname }
flavor: { get_param: flavor }
image: { get_param: image }
key_name: { get_param: ssh_key_name }
metadata:
rax-heat: { get_param: stack_id }
nodestack_chef_run:
type: 'OS::Heat::ChefSolo'
depends_on: nodestack_node
properties:
username: root
private_key: { get_param: ssh_private_key }
host: { get_attr: [nodestack_node, accessIPv4] }
kitchen: { get_param: kitchen }
chef_version: { get_param: chef_version }
node:
nodejs_app:
packages: { get_param: packages }
git_repo: { get_param: repo }
rev: { get_param: revision }
deploy_key: { get_param: deploy_key }
destination: { get_param: destination }
rax:
firewall:
tcp: [22, 80]
deployment:
id: { get_param: stack_id }
app_id: nodejs
run_list: ["recipe[apt]",
"recipe[nodejs]",
"recipe[ssh_known_hosts]",
"recipe[nodejs_app]",
"recipe[rax-firewall]"]
data_bags:
nodejs:
encrypted: true
id: { get_param: stack_id }
nodejs_app:
password: { get_attr: [nodejs_user_password, value] }
deploy_key: { get_param: deploy_key }
database_url:
str_replace:
template: 'mysql://%dbuser%:%dbpasswd%@%dbhostname%'
params:
'%dbuser%': { get_param: database_username }
'%dbpasswd%': { get_param: database_user_password }
'%dbhostname%': { get_param: db_server_ip }
outputs:
accessIPv4:
description: Node.js node public IP
value: { get_attr: [nodestack_node, accessIPv4] }
privateIPv4:
description: NodeJS node prive IP
value: { get_attr: [nodestack_node, networks, private, 0] }