From e6adab8e102f76c4d2f861d9060fa3f33d9a3342 Mon Sep 17 00:00:00 2001 From: Isaac Shabtay Date: Wed, 15 Jun 2016 10:20:54 -0700 Subject: [PATCH] Ported 3.3.1-maint Simple changes --- .gitignore | 2 + inputs/simple.yaml.template | 5 +++ simple-blueprint.yaml | 83 +++++++++++++++++++++++-------------- types/simple-types.yaml | 7 +++- 4 files changed, 66 insertions(+), 31 deletions(-) create mode 100644 inputs/simple.yaml.template diff --git a/.gitignore b/.gitignore index ba86e69..8e6f56f 100644 --- a/.gitignore +++ b/.gitignore @@ -59,3 +59,5 @@ docs/_build/ # QuickBuild .qbcache/ .cloudify + +.idea diff --git a/inputs/simple.yaml.template b/inputs/simple.yaml.template new file mode 100644 index 0000000..d720018 --- /dev/null +++ b/inputs/simple.yaml.template @@ -0,0 +1,5 @@ +nodejs_host_ip: '' +mongod_host_ip: '' +agent_user: '' +agent_private_key_path: '' + diff --git a/simple-blueprint.yaml b/simple-blueprint.yaml index 63ec4c4..6c5ad3f 100644 --- a/simple-blueprint.yaml +++ b/simple-blueprint.yaml @@ -1,8 +1,8 @@ tosca_definitions_version: cloudify_dsl_1_3 description: > - This Blueprint installs the nodecellar application - on an existing host. + This blueprint installs the Node Cellar application + on hosts with known IP addresses. imports: - http://www.getcloudify.org/spec/cloudify/3.4rc1/types.yaml @@ -11,27 +11,31 @@ imports: - types/simple-types.yaml ##################################################################################### -# inputs section allows the user to use same -# blueprint for creating different deployments, each one -# with its own parameters. -# to specify deployment inputs run: -# - cfy deployments create -b -d -i inputs.json +# The inputs section allows the user to use same blueprint for creating different +# deployments, each one with its own parameters. +# +# To specify deployment inputs run: +# - cfy deployments create -b -d -i inputs.yaml ##################################################################################### inputs: - host_ip: - description: > - The ip of the host the application will be deployed on + nodejs_host_ip: + description: > + IP address of nodejs_host + + mongod_host_ip: + description: > + IP address of mongod_host agent_user: description: > - User name used when SSH-ing into the started machine + Username for SSH connections to hosts from Cloudify Manager agent_private_key_path: description: > - Path to a private key that resided on the management machine. - SSH-ing into agent machines will be done with this key. + Path to private key used for SSH connections to hosts + (must be accessible by Cloudify Manager) node_templates: @@ -40,46 +44,64 @@ node_templates: relationships: ################################ - # Setting the mongo connection + # Connected to mongod node ################################ - type: node_connected_to_mongo target: mongod - target_interfaces: - cloudify.interfaces.relationship_lifecycle: - postconfigure: - inputs: - mongo_ip_address: localhost ################################ - # Setting the nodejs connection + # Contained in nodejs node ################################ - type: node_contained_in_nodejs target: nodejs - mongod: - type: nodecellar.nodes.MonitoredMongoDatabase + nodejs: + type: nodecellar.nodes.NodeJSServer relationships: + + ################################ + # Contained in nodejs host + ################################ + - type: cloudify.relationships.contained_in - target: host + target: nodejs_host - nodejs: - type: nodecellar.nodes.NodeJSServer + mongod: + type: nodecellar.nodes.MonitoredMongoDatabase relationships: + + ################################ + # Contained in mongod host + ################################ + - type: cloudify.relationships.contained_in - target: host + target: mongod_host + + ############ + # Hosts + ############ - host: + nodejs_host: type: nodecellar.nodes.MonitoredServer properties: - ip: { get_input: host_ip } + ip: { get_input: nodejs_host_ip } + cloudify_agent: + user: { get_input: agent_user } + key: { get_input: agent_private_key_path } + + mongod_host: + type: nodecellar.nodes.MonitoredServer + properties: + ip: { get_input: mongod_host_ip } cloudify_agent: user: { get_input: agent_user } key: { get_input: agent_private_key_path } ########################################################### -# This outputs section exposes the application endpoint. +# The outputs section exposes the application endpoint. +# # You can access it by running: # - cfy deployments -d outputs ########################################################### @@ -88,5 +110,6 @@ outputs: endpoint: description: Web application endpoint value: - ip_address: { get_property: [ host, ip ] } + ip_address: { get_property: [ nodejs_host, ip ] } port: { get_property: [ nodecellar, port ] } + diff --git a/types/simple-types.yaml b/types/simple-types.yaml index 8aae09c..7d6e9bf 100644 --- a/types/simple-types.yaml +++ b/types/simple-types.yaml @@ -1,12 +1,17 @@ node_types: + ########################################################### + # We define a type that inherits Cloudify's default + # server, and adds monitoring capabilities on top of it. + ########################################################### + nodecellar.nodes.MonitoredServer: derived_from: cloudify.nodes.Compute interfaces: ########################################################### - # We are infact telling cloudify to install a diamond + # We are telling Cloudify to install a Diamond # monitoring agent on the server. # # (see https://github.com/BrightcoveOS/Diamond)