Skip to content

Instantly share code, notes, and snippets.

@andreaturli
Last active October 29, 2015 16:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andreaturli/2e11ef31f993ca2e06c5 to your computer and use it in GitHub Desktop.
Save andreaturli/2e11ef31f993ca2e06c5 to your computer and use it in GitHub Desktop.
tosca_definitions_version: tosca_simple_yaml_1_0_0_wd03
description: Custom template
template_name: My App
template_version: 0.1.0-SNAPSHOT
imports:
- tosca-normative-types:1.0.0.wd03-SNAPSHOT
topology_template:
node_templates:
a_server:
type: tosca.nodes.Compute
properties:
mem_size: 4 gb
script_hello:
type: tosca.nodes.SoftwareComponent
requirements:
- host: a_server
interfaces:
Standard:
create: https://raw.githubusercontent.com/ahgittin/tosca-demo/master/script1/scripts/create.sh
configure: https://raw.githubusercontent.com/ahgittin/tosca-demo/master/script1/scripts/configure.sh
start: https://raw.githubusercontent.com/ahgittin/tosca-demo/master/script1/scripts/start.sh
stop: https://raw.githubusercontent.com/ahgittin/tosca-demo/master/script1/scripts/stop.sh
JBoss6Server:
type: org.apache.brooklyn.entity.webapp.jboss.JBoss6Server
requirements:
- host: a_server
CassandraNode:
type: org.apache.brooklyn.entity.nosql.cassandra.CassandraNode
requirements:
- host: a_server
groups:
add_brooklyn_location:
members: [ script_hello, JBoss6Server, CassandraNode ]
policies:
- brooklyn.location: aws-ec2:eu-west-1
@ahgittin
Copy link

it should be enough to add_brooklyn_location to the a_server node -- my understanding is that that should correspond to a VM, not a cloud / vm-spec. if you want things to start on separate machine you'd add something like b_server

@kiuby88
Copy link

kiuby88 commented Oct 29, 2015

@ahgittin I am not sure if I understood you.
You mean

groups:
   add_brooklyn_location:
     members: [ a_server ]
     policies:
     - brooklyn.location: aws-ec2:eu-west-1

deploys all nodes on the same VM.
And

groups:
   add_brooklyn_location:
     members: [ a_server, b_server ]
     policies:
     - brooklyn.location: aws-ec2:eu-west-1

will create two different VM, one for a_server and another one for b_server.
Right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment