forked from cloudify-cosmo/cloudify-nodecellar-example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhost-pool-blueprint.yaml
91 lines (72 loc) · 2.44 KB
/
host-pool-blueprint.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
###########################################################
# This Blueprint installs the nodecellar application
# on hosts from an existing host-pool using the
# cloudify-host-pool-plugin
###########################################################
tosca_definitions_version: cloudify_dsl_1_0
imports:
- http://www.getcloudify.org/spec/cloudify/3.3m3/types.yaml
- http://www.getcloudify.org/spec/host-pool-plugin/1.3m3/plugin.yaml
- types/nodecellar.yaml
inputs:
host_pool_service_endpoint:
description: >
URL to the host pool service that will allocate hosts.
node_types:
nodecellar.nodes.Host:
derived_from: cloudify.hostpool.nodes.Host
interfaces:
cloudify.interfaces.lifecycle:
create:
implementation: hostpool.cloudify_hostpool_plugin.tasks.acquire
inputs:
service_url:
default: { get_input: host_pool_service_endpoint }
delete:
implementation: hostpool.cloudify_hostpool_plugin.tasks.release
inputs:
service_url:
default: { get_input: host_pool_service_endpoint }
node_templates:
nodejs_host:
type: nodecellar.nodes.Host
mongod_host:
type: nodecellar.nodes.Host
mongod:
type: nodecellar.nodes.MongoDatabase
properties:
port: 27017
relationships:
- type: cloudify.relationships.contained_in
target: mongod_host
nodejs:
type: nodecellar.nodes.NodeJSServer
relationships:
- type: cloudify.relationships.contained_in
target: nodejs_host
nodecellar:
type: nodecellar.nodes.NodecellarApplicationModule
properties:
port: 8080
relationships:
################################
# Setting the mongo connection
################################
- type: node_connected_to_mongo
target: mongod
################################
# Setting the nodejs connection
################################
- type: node_contained_in_nodejs
target: nodejs
###########################################################
# This outputs section exposes the application endpoint.
# You can access it by running:
# - cfy deployments -d <deployment_id> outputs
###########################################################
outputs:
endpoint:
description: Web application endpoint
value:
ip_address: { get_attribute: [ nodejs_host, public_address ] }
port: { get_property: [nodecellar, port] }