1 # Licensed to the Apache Software Foundation (ASF) under one or more
2 # contributor license agreements. See the NOTICE file distributed with
3 # this work for additional information regarding copyright ownership.
4 # The ASF licenses this file to You under the Apache License, Version 2.0
5 # (the "License"); you may not use this file except in compliance with
6 # the License. You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
16 # NFV is not used here, but we are using it just to validate the imports
17 tosca_definitions_version: tosca_simple_profile_for_nfv_1_0
18 #tosca_definitions_version: tosca_simple_yaml_1_0
21 Node Cellar TOSCA blueprint.
22 Here is some Unicode: 中國.
25 template_name: node-cellar
27 template_version: '1.0.0'
31 - types/openstack.yaml
39 default_openstack_credential: &DEFAULT_OPENSTACK_CREDENTIAL
41 token: { concat: [ openstack, 123 ] }
47 The repository for the Node Cellar application and its dependencies.
48 url: https://github.com/ccoenraets/nodecellar/archive/
56 derived_from: tosca.interfaces.Root
62 - valid_values: [ immediate, eventual ]
64 The mode in which maintenance mode is enabled/disabled.
67 Enable maintenance mode.
70 Disable maintenance mode.
75 derived_from: nodejs.Application
81 capability: tosca.capabilities.Endpoint.Database
82 node: mongodb.Database
88 type: openstack.Credential
89 value: *DEFAULT_OPENSTACK_CREDENTIAL
97 Node Cellar Node.js web application.
98 type: NodeMongoApplication
102 The Node Cellar application package.
105 repository: node_cellar
106 deploy_path: /opt/nodejs/applications/node-cellar
110 token: { get_attribute: [ SELF, tosca_id ] }
111 #token: { get_property: [ SELF, app_endpoint, protocol ] }
112 #token: { get_property: [ HOST, flavor_name ] }
113 #token: { token: [ { get_property: [ HOST, flavor_name ] }, '.', 1 ] }
114 #token: { token: [ 'zero.one|two-three', '.|-', 3 ] }
119 enable: maintenance_node_cellar.sh
120 disable: maintenance_node_cellar.sh
124 primary: create_node_cellar.sh
126 - "process.args.1 > { get_attribute: [ SELF, tosca_id ] }"
127 - "process.args.2 > { get_property: [ HOST, flavor_name ] }"
129 - ssh.password > '1234'
130 - ssh.use_sudo > true
132 - database: node_cellar_database
137 url_path: /nodecellar
139 node_cellar_database:
141 Node Cellar MongoDB database.
142 type: mongodb.Database
148 The Node Cellar initial database.
149 type: mongodb.DatabaseDump
150 file: node-cellar.json
151 repository: node_cellar
160 - host: application_host
165 node_filter: # cannot be validated
167 #- flavor_name: { valid_values: [ {concat:[m1,.,small]} ] } # won't work because not validated :/
168 - flavor_name: { valid_values: [ m1.small ] }
172 - max_instances: { greater_or_equal: 5 }
180 node: openstack.Instance
183 - flavor_name: { valid_values: [ m1.medium, { concat: [ { concat: [ m1, . ] }, large ] } ] }
184 #- flavor_name: { valid_values: [ m1.medium, m1.large ] }
188 - max_instances: { greater_or_equal: 5 }
192 target_changed: changed.sh
197 - host: loadbalancer_host
198 - feature: loadbalancer
203 type: nginx.LoadBalancer
205 algorithm: round-robin
211 Host for the loadbalancer.
212 type: openstack.Instance
214 flavor_name: m1.small
215 os_users: # map of os.UserInfo
221 openstack_credential: { get_input: openstack_credential }
224 primary: juju > run_charm
226 - charm > loadbalancer
229 copy: loadbalancer_host
231 Host for applications.
233 flavor_name: m1.small
234 os_users: # map of os.UserInfo
242 max_instances: 5 # overrides the policy
245 copy: loadbalancer_host
249 flavor_name: m1.large
250 flavor_id: 5d62e82c-924e-4fa9-b1e4-c133867596f7
251 os_users: # map of os.UserInfo
259 location: /mnt/volume
263 max_instances: 6 # overrides the policy
266 type: openstack.Volume
272 openstack_credential: { get_input: openstack_credential }
273 create: create_data_volume.sh
278 type: openstack.Secured
286 openstack_credential: { get_input: openstack_credential }
300 type: openstack.Scaling
302 bandwidth_threshold: 2 GB
305 targets: # node templates or groups
310 Juju plugin executes charms.
317 type: MaintenanceWorkflow
322 type: MaintenanceWorkflow
326 substitution_mappings:
328 node_type: tosca.nodes.WebApplication
330 host: [ node_cellar, host ] # doesn't really make sense; just for testing
332 app_endpoint: [ loadbalancer, client ]
338 The application endpoint.
340 value: { get_property: [ nodejs, data_endpoint, url_path ] }
346 Workflow to put all nodes in/out of maintenance mode. For web servers, this will show a "this
347 site is under maintenance and we'll be back soon" web page. Database nodes will then close all
348 client connections cleanly and shut down services.
349 derived_from: aria.Workflow
353 default: workflows.maintenance
356 Whether to turn maintenance mode on or off.