forked from cloudify-cosmo/cloudify-nodecellar-example
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvcloud-without-agent-blueprint.yaml
More file actions
429 lines (382 loc) · 13.8 KB
/
vcloud-without-agent-blueprint.yaml
File metadata and controls
429 lines (382 loc) · 13.8 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
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
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
tosca_definitions_version: cloudify_dsl_1_0
imports:
- http://www.getcloudify.org/spec/cloudify/3.3m3/types.yaml
- https://raw.githubusercontent.com/cloudify-cosmo/tosca-vcloud-plugin/master/plugin.yaml
- http://www.getcloudify.org/spec/fabric-plugin/1.3m3/plugin.yaml
- types/agentless-nodecellar.yaml
inputs:
vcloud_username:
type: string
description: >
User login for vcloud air
vcloud_password:
type: string
default: ''
description: >
User password for vcloud air - for login by name + password
vcloud_token:
type: string
default: ''
description: >
User token for vcloud air - for login by name + token
vcloud_url:
type: string
description: >
Vcloud url
vcloud_service:
type: string
description: >
Vcloud service
vcloud_service_type:
type: string
default: 'subscription'
description: >
Type of service: subscription, ondemand, vcd, private
vcloud_instance:
type: string
default: ''
description: >
Only required for ondemand service type, instance uuid
vcloud_api_version:
type: string
default: '5.6'
description: >
Version of api, for now 5.6
nodejs_ssh:
type: string
default: 22
description: >
Ssh port for nodejs host
mongo_ssh:
type: string
default: 23
description: >
Ssh port for mongodb host
nodejs_http:
type: string
default: 8080
description: >
Http port for nodejs host
vcloud_org_url:
type: string
default: ''
description: >
Only required if using token based login on a private vcloud
director. This can be obtained by following the vcloud API
example docs. If you are unsure of how to obtain this, you will
need to use password based login.
vcloud_org:
type: string
description: >
Organization uuid
vcloud_vdc:
type: string
description: >
Virtual data center name
catalog:
type: string
description: >
Name of catalog, can be 'Public Catalog'
template:
type: string
description: >
Name of template from catalog,
can be 'Ubuntu Server 12.04 LTS (amd64 20150127)'
server_cpu:
type: string
default: 2
description: >
Count cpu on nodes
server_memory:
type: string
default: 4096
description: >
Amount memmory on nodes
network_use_existing:
type: boolean
default: false
description: >
Use existed network
common_network_name:
type: string
description: >
Name common network taht can be used for nodes
port_ip_allocation_mode:
type: string
default: pool
description: >
Ip allocation type for case when you doesn't set public ip
for nodes and want auto allocate ip
nodejs_ip_address:
type: string
default: ''
description: >
For 'ondemand' service type, the value of
nodejs_ip_address can be empty
mongo_ip_address:
type: string
default: ''
description: >
For 'ondemand' service type, the value of
mongo_ip_address can be empty
common_network_public_nat_use_existing:
type: boolean
default: false
description: >
Use already existed nat rules, only for case when you
doesn't want to change nat rules
edge_gateway:
type: string
default: gateway
description: >
For 'ondemand' service type, the value of edge_gateway
is always 'gateway'
servers_user:
default: ubuntu
type: string
description: >
Default admin user in os template
private_key_path:
default: ~/.ssh/cloudify-agent-kp.pem
type: string
description: >
Please upload key to manager server before use key
user_public_key:
type: string
default: ''
description: >
Public key
resources_prefix:
type: string
default: ''
description: >
Prefix for nodes
node_types:
# base server type for installation without agent
agentless-nodecellar.nodes.ParentTypeServer:
derived_from: cloudify.vcloud.nodes.Server
properties:
install_agent:
default: false
vcloud_configuration:
derived_from: cloudify.nodes.Root
properties:
vcloud_config: {}
node_templates:
vcloud_configuration:
type: vcloud_configuration
properties:
vcloud_config:
username: { get_input: vcloud_username }
password: { get_input: vcloud_password }
token: { get_input: vcloud_token }
url: { get_input: vcloud_url }
service: { get_input: vcloud_service }
org: { get_input: vcloud_org }
vdc: { get_input: vcloud_vdc }
service_type: { get_input: vcloud_service_type }
instance: { get_input: vcloud_instance }
api_version: { get_input: vcloud_api_version }
org_url: { get_input: vcloud_org_url }
edge_gateway: { get_input: edge_gateway }
nodejs_host:
type: agentless-nodecellar.nodes.ParentTypeServer
properties:
server:
catalog: { get_input: catalog }
template: { get_input: template }
guest_customization:
public_keys:
- { get_property: [common_keypair, public_key] }
hardware:
cpu: { get_input: server_cpu }
memory: { get_input: server_memory }
management_network: { get_input: common_network_name }
vcloud_config: { get_property: [vcloud_configuration, vcloud_config] }
relationships:
- target: nodejs_host_nat
type: cloudify.vcloud.server_connected_to_public_nat
- target: node_security_group
type: cloudify.vcloud.server_connected_to_security_group
mongod_host:
type: agentless-nodecellar.nodes.ParentTypeServer
properties:
server:
catalog: { get_input: catalog }
template: { get_input: template }
guest_customization:
public_keys:
- { get_property: [common_keypair, public_key] }
hardware:
cpu: { get_input: server_cpu }
memory: { get_input: server_memory }
management_network: { get_input: common_network_name }
vcloud_config: { get_property: [vcloud_configuration, vcloud_config] }
relationships:
- target: mongo_server_nat
type: cloudify.vcloud.server_connected_to_public_nat
- target: node_security_group
type: cloudify.vcloud.server_connected_to_security_group
common_network:
type: cloudify.vcloud.nodes.Network
properties:
use_external_resource: { get_input: network_use_existing }
resource_id: { get_input: common_network_name }
network:
name: { get_input: common_network_name }
edge_gateway: { get_input: edge_gateway }
static_range: 10.67.80.129-10.67.80.254
netmask: 255.255.255.0
gateway_ip: 10.67.80.1
dns:
- 10.67.80.1
- 8.8.8.8
dhcp:
dhcp_range: 10.67.80.2-10.67.80.128
vcloud_config: { get_property: [vcloud_configuration, vcloud_config] }
relationships:
- target: common_network_nat
type: cloudify.vcloud.net_connected_to_public_nat
common_network_nat:
type: cloudify.vcloud.nodes.PublicNAT
properties:
use_external_resource: { get_input: common_network_public_nat_use_existing }
nat:
edge_gateway: { get_input: edge_gateway }
public_ip: { get_input: nodejs_ip_address }
rules:
- type: SNAT
vcloud_config: { get_property: [vcloud_configuration, vcloud_config] }
nodejs_host_nat:
type: cloudify.vcloud.nodes.PublicNAT
properties:
nat:
edge_gateway: { get_input: edge_gateway }
public_ip: { get_input: nodejs_ip_address }
rules:
- type: DNAT
protocol: tcp
original_port: { get_input: nodejs_http }
translated_port: 8080
- type: DNAT
protocol: tcp
original_port: { get_input: nodejs_ssh }
translated_port: 22
vcloud_config: { get_property: [vcloud_configuration, vcloud_config] }
mongo_server_nat:
type: cloudify.vcloud.nodes.PublicNAT
properties:
nat:
edge_gateway: { get_input: edge_gateway }
public_ip: { get_input: mongo_ip_address }
rules:
- type: DNAT
protocol: tcp
original_port: { get_input: mongo_ssh }
translated_port: 22
vcloud_config: { get_property: [vcloud_configuration, vcloud_config] }
node_security_group:
type: cloudify.vcloud.nodes.SecurityGroup
properties:
security_group:
name: nodevcloud_security_group
edge_gateway: { get_input: edge_gateway }
rules:
- source: any
destination: internal
destination_port: { get_input: nodejs_ssh }
action: allow
description: >
ssh to node_js
protocol: TCP
- source: any
destination: internal
destination_port: { get_input: mongo_ssh }
action: allow
description: >
ssh to mongo
protocol: TCP
- source: internal
destination: internal
destination_port: 27017
action: allow
description: >
mongo <-> nodejs connection
protocol: TCP
- source: external
destination: internal
destination_port: 8080
action: allow
description: >
http to nodejs
protocol: TCP
- source: internal
destination: any
action: allow
description: >
backward network connection for host updates
protocol: any
- source: external
destination: internal
action: allow
description: >
Allow ping
protocol: ICMP
vcloud_config: { get_property: [vcloud_configuration, vcloud_config] }
common_keypair:
type: cloudify.vcloud.nodes.KeyPair
properties:
private_key_path: { get_input: private_key_path }
public_key:
key: { get_input: user_public_key }
user: { get_input: servers_user }
nodejs:
type: agentless-nodecellar.nodes.NodeJSServer
relationships:
- target: nodejs_host
type: cloudify.relationships.contained_in
interfaces:
cloudify.interfaces.lifecycle:
start:
inputs:
fabric_env:
user: { get_input: servers_user }
key_filename: { get_input: private_key_path }
host_string: { get_attribute: [nodejs_host_nat, public_ip] }
port: { get_input: nodejs_ssh }
mongod:
type: agentless-nodecellar.nodes.MongoDatabase
relationships:
- target: mongod_host
type: cloudify.relationships.contained_in
interfaces:
cloudify.interfaces.lifecycle:
start:
inputs:
fabric_env:
user: { get_input: servers_user }
key_filename: { get_input: private_key_path }
host_string: { get_attribute: [mongo_server_nat, public_ip] }
port: { get_input: mongo_ssh }
nodecellar:
type: agentless-nodecellar.nodes.nodecellar
interfaces:
cloudify.interfaces.lifecycle:
start:
inputs:
task_properties:
config:
mongo: { get_attribute: [mongod_host, ip] }
fabric_env:
user: { get_input: servers_user }
key_filename: { get_input: private_key_path }
host_string: { get_attribute: [nodejs_host_nat, public_ip] }
port: { get_input: nodejs_ssh }
relationships:
- type: cloudify.relationships.contained_in
target: nodejs
- type: cloudify.relationships.connected_to
target: mongod
outputs:
nodejs_ip:
value: { get_attribute: [nodejs_host_nat, public_ip] }