Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
317 changes: 317 additions & 0 deletions CFY524_OIB.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,317 @@
tosca_definitions_version: cloudify_dsl_1_3

imports:
# - http://www.getcloudify.org/spec/cloudify/4.2/types.yaml
# - http://www.getcloudify.org/spec/openstack-plugin/2.4.1/plugin.yaml
# - https://raw.githubusercontent.com/cloudify-cosmo/cloudify-diamond-plugin/1.3.5/plugin.yaml
# - https://github.com/cloudify-incubator/cloudify-utilities-plugin/releases/download/1.9.0/plugin.yaml

- http://cloudify.co/spec/cloudify/5.0.5/types.yaml
- plugin:cloudify-gcp-plugin
- plugin:cloudify-utilities-plugin
- components/ovs/types.yaml
- components/CentOS7/types.yaml
- components/HubSpot/types.yaml

inputs:

### GCP input
region:
type: string
description: The GCP region to deploy the application in, such as europe-west1.
default: 'europe-west2'

zone:
type: string
description: The GCP zone to deploy the application in, such as europe-west1-b.
default: 'europe-west2-a'

network_name:
type: string
description: The name of your GCP Virtual Network.
default: default

subnet_name:
type: string
description: The name of your GCP Virtual Network.
default: default

CFY_image:
type: string
description: Centos image.
default: { get_secret: GCP_CFY524_image }

OIB_image:
type: string
description: Centos image.
default: { get_secret: GCP_OIB_image }


instance_type:
type: string
description: A small GCP machine type.
default: n1-standard-8

cfy_instance_type:
type: string
default: n1-standard-2


#### instance inputs

agent_user:
description: >
The username of the agent running on the instance created from the image.
default: 'centos'

agent_user_private_key:
type: string
default: { get_secret: training_key_private }

agent_user_public_key:
type: string
default: { get_secret: training_key_public }

#### Lab inputs
customer_token:
type: string
default: "AA"

licence:
type: string
default: { get_secret: CFYTmpLicURL }

customer_name:
type: string
default: 'MrCustomer'

customer_email:
type: string
default: [email protected]

hubspot_portal:
type: string
default: "1918719"

hubspot_form:
type: string
default: 74f1a2ca-923d-4eae-aa9e-e0b810788d56

customer_lastname:
type: string
default: 'MrCustomerLast'

customer_phone:
type: string
default: '+123456'

use_analytics:
type: integer
default: 1

use_guides:
type: integer
default: 1


dsl_definitions:

client_config: &gcp_config
auth: { get_secret: GCPAuth }
zone: { get_input: zone }


node_templates:

##
## Hub spot integration
##################

hs_registration:
type: hubspot.form.Submit
properties:
portal_id: { get_input: hubspot_portal }
form_guid: { get_input: hubspot_form }
params:
FirstName: { get_input: customer_name }
LastName: " "
Email: { get_input: customer_email }


##
## Servers
##################



oib_server:
type: cloudify.gcp.nodes.Instance
properties:
gcp_config: *gcp_config
agent_config:
network: external
key: { get_input: agent_user_private_key }
user: { get_input: agent_user }
use_public_ip: true
image_id: { get_input: OIB_image }
instance_type: { get_input: instance_type }
zone: { get_input: zone }
external_ip: true
relationships:
- type: cloudify.relationships.depends_on
target: subnet

cfy_manager:
type: cloudify.gcp.nodes.Instance
properties:
gcp_config: *gcp_config
agent_config:
network: external
key: { get_input: agent_user_private_key }
user: { get_input: agent_user }
use_public_ip: true
image_id: { get_input: CFY_image }
instance_type: { get_input: cfy_instance_type }
zone: { get_input: zone }
external_ip: true
relationships:
- type: cloudify.relationships.depends_on
target: subnet
##
## GCP Networking
############
subnet:
type: cloudify.gcp.nodes.SubNetwork
properties:
name: { get_input: subnet_name }
region: { get_input: region }
use_external_resource: true
subnet: 10.11.12.0/22
gcp_config: *gcp_config
relationships:
- type: cloudify.gcp.relationships.contained_in_network
target: network

network:
type: cloudify.gcp.nodes.Network
properties:
name: { get_input: network_name }
gcp_config: *gcp_config
auto_subnets: false
use_external_resource: true

##
## SDN
################

sdn_sw_manager:
type: ovs.nodes.centos_vswitch
properties:
ipaddr: 10.10.25.15
netmask: 255.255.255.0
relationships:
- target: cfy_manager
type: cloudify.relationships.contained_in
- target: sdn_sw_oib_server
type: ovs.relationships.vswitch_gre

sdn_sw_oib_server:
type: ovs.nodes.centos_vswitch
properties:
use_external_resource: True
resource_id: br-mng
relationships:
- target: oib_server
type: cloudify.relationships.contained_in

##
## Content Related
##############################

vpn:
type: cloudify.nodes.ApplicationModule
interfaces:
cloudify.interfaces.lifecycle:
configure:
implementation: components/VPN/vpn_configure.sh
inputs:
public_ip: { get_attribute: [ oib_server, public_ip_address ] }
relationships:
- target: oib_server
type: cloudify.relationships.contained_in

oib_cloudify_config:
type: cloudify.nodes.ApplicationModule
interfaces:
cloudify.interfaces.lifecycle:
configure:
implementation: components/CFYManager524/manager_oib_configure.sh
inputs:
plugins: { get_input: plugins_bundle }
licence: { get_input: licence }
relationships:
- target: cfy_manager
type: cloudify.relationships.contained_in
- target: external_network
type: cloudify.relationships.depends_on
- target: sdn_sw_manager
type: cloudify.relationships.depends_on

rproxy:
type: cloudify.nodes.ApplicationModule
interfaces:
cloudify.interfaces.lifecycle:
create:
implementation: components/rproxy/proxy_install-sdn.sh
inputs:
public_ip: { get_attribute: [ cfy_manager, public_ip_address ] }
use_sudo: true
start:
implementation: components/rproxy/proxy_start.sh

relationships:
- target: oib_server
type: cloudify.relationships.contained_in

remote_access:
type: CentOS.ssh.RemotePortForward

relationships:
- target: cfy_manager
type: cloudify.relationships.contained_in
- target: sdn_sw_manager
type: cloudify.relationships.depends_on

external_network:
type: cloudify.nodes.ApplicationModule
interfaces:
cloudify.interfaces.lifecycle:
create:
implementation: components/CFYManager524/scripts/add_external_network.sh
inputs:
public_ip: { get_attribute: [ cfy_manager, public_ip_address ] }
private_ip: { get_attribute: [ cfy_manager , ip] }
use_sudo: true
relationships:
- target: remote_access
type: cloudify.relationships.depends_on
- target: cfy_manager
type: cloudify.relationships.contained_in



analytics:
type: cloudify.nodes.ApplicationModule
capabilities:
scalable:
properties:
default_instances: { get_input: use_analytics }
# interfaces:
# cloudify.interfaces.lifecycle:
# configure:
# implementation: components/CFYManager4x/install_analytics.sh
relationships:
- target: cfy_manager
type: cloudify.relationships.contained_in
- target: oib_cloudify_config
type: cloudify.relationships.depends_on
Loading