From 939daa0ccccdaa278ff9b19f1a8a14f3566f9923 Mon Sep 17 00:00:00 2001 From: Vijay Venkatesh Kumar Date: Thu, 4 Apr 2019 23:08:05 +0000 Subject: Bulk blueprint update 1) Moved older bluerpints from build dir 2) Modified snmp and ves blueprint port mapping 3) Added helm and Dashboard blueprint Change-Id: If4739901d754fa6fea81024917fb425e82c20657 Signed-off-by: Vijay Venkatesh Kumar Issue-ID: DCAEGEN2-1270 Signed-off-by: Vijay Venkatesh Kumar --- blueprints/DeploymentHandler-README.md | 23 - blueprints/DeploymentHandler.yaml-template | 102 -- blueprints/DockerBP.yaml-template | 345 ------- blueprints/cdap-sdk.yaml-template | 71 -- blueprints/cdap_broker.yaml-template | 97 -- blueprints/cdapbp7.yaml-template | 1054 -------------------- blueprints/centos_vm.yaml-template | 243 ----- blueprints/config_binding_service.yaml-template | 62 -- blueprints/consul_cluster.yaml-template | 384 ------- blueprints/heartbeat-service.yaml-template | 61 -- blueprints/holmes-engine.yaml-template | 98 -- blueprints/holmes-rules.yaml-template | 81 -- blueprints/inventory.yaml-template | 196 ---- .../k8s-config_binding_service.yaml-template | 53 - blueprints/k8s-dashboard.yaml-template | 114 +++ blueprints/k8s-deployment_handler.yaml-template | 87 -- blueprints/k8s-helm-override.yaml-template | 75 ++ blueprints/k8s-helm.yaml-template | 60 ++ blueprints/k8s-inventory.yaml-template | 180 ---- blueprints/k8s-policy_handler.yaml-template | 60 -- blueprints/k8s-snmptrap.yaml-template | 17 +- blueprints/k8s-ves.yaml-template | 7 +- blueprints/pgaas-cluster.yaml-template | 435 -------- blueprints/pgaas-database.yaml-template | 63 -- blueprints/pgaas-disk.yaml-template | 123 --- blueprints/pgaas-getdbinfo.yaml-template | 92 -- blueprints/pgaas-onevm.yaml-template | 300 ------ blueprints/pgaas.yaml-template | 412 -------- blueprints/policy_handler.yaml-template | 70 -- blueprints/prh-service.yaml-template | 61 -- .../DeploymentHandler-README.md | 23 + .../DeploymentHandler.yaml-template | 102 ++ .../reference_templates/DockerBP.yaml-template | 345 +++++++ blueprints/reference_templates/README.txt | 42 + .../reference_templates/cdap-sdk.yaml-template | 71 ++ .../reference_templates/cdap_broker.yaml-template | 97 ++ .../reference_templates/cdapbp7.yaml-template | 1054 ++++++++++++++++++++ .../reference_templates/centos_vm.yaml-template | 243 +++++ .../config_binding_service.yaml-template | 62 ++ .../consul_cluster.yaml-template | 384 +++++++ .../heartbeat-service.yaml-template | 61 ++ .../holmes-engine.yaml-template | 98 ++ .../reference_templates/holmes-rules.yaml-template | 81 ++ .../reference_templates/inventory.yaml-template | 196 ++++ .../pgaas-cluster.yaml-template | 435 ++++++++ .../pgaas-database.yaml-template | 63 ++ .../reference_templates/pgaas-disk.yaml-template | 123 +++ .../pgaas-getdbinfo.yaml-template | 92 ++ .../reference_templates/pgaas-onevm.yaml-template | 300 ++++++ blueprints/reference_templates/pgaas.yaml-template | 412 ++++++++ .../policy_handler.yaml-template | 70 ++ .../reference_templates/prh-service.yaml-template | 61 ++ .../snmptrap-collector.yaml-template | 95 ++ blueprints/reference_templates/tca.yaml-template | 92 ++ .../tcadocker-service.yaml-template | 192 ++++ blueprints/reference_templates/ves.yaml-template | 135 +++ blueprints/snmptrap-collector.yaml-template | 95 -- blueprints/tca.yaml-template | 92 -- blueprints/tcadocker-service.yaml-template | 192 ---- blueprints/ves.yaml-template | 135 --- 60 files changed, 5190 insertions(+), 5279 deletions(-) delete mode 100644 blueprints/DeploymentHandler-README.md delete mode 100644 blueprints/DeploymentHandler.yaml-template delete mode 100644 blueprints/DockerBP.yaml-template delete mode 100644 blueprints/cdap-sdk.yaml-template delete mode 100644 blueprints/cdap_broker.yaml-template delete mode 100644 blueprints/cdapbp7.yaml-template delete mode 100644 blueprints/centos_vm.yaml-template delete mode 100644 blueprints/config_binding_service.yaml-template delete mode 100644 blueprints/consul_cluster.yaml-template delete mode 100644 blueprints/heartbeat-service.yaml-template delete mode 100644 blueprints/holmes-engine.yaml-template delete mode 100644 blueprints/holmes-rules.yaml-template delete mode 100644 blueprints/inventory.yaml-template delete mode 100644 blueprints/k8s-config_binding_service.yaml-template create mode 100644 blueprints/k8s-dashboard.yaml-template delete mode 100644 blueprints/k8s-deployment_handler.yaml-template create mode 100644 blueprints/k8s-helm-override.yaml-template create mode 100644 blueprints/k8s-helm.yaml-template delete mode 100644 blueprints/k8s-inventory.yaml-template delete mode 100644 blueprints/k8s-policy_handler.yaml-template delete mode 100644 blueprints/pgaas-cluster.yaml-template delete mode 100644 blueprints/pgaas-database.yaml-template delete mode 100644 blueprints/pgaas-disk.yaml-template delete mode 100644 blueprints/pgaas-getdbinfo.yaml-template delete mode 100644 blueprints/pgaas-onevm.yaml-template delete mode 100644 blueprints/pgaas.yaml-template delete mode 100644 blueprints/policy_handler.yaml-template delete mode 100644 blueprints/prh-service.yaml-template create mode 100644 blueprints/reference_templates/DeploymentHandler-README.md create mode 100644 blueprints/reference_templates/DeploymentHandler.yaml-template create mode 100644 blueprints/reference_templates/DockerBP.yaml-template create mode 100644 blueprints/reference_templates/README.txt create mode 100644 blueprints/reference_templates/cdap-sdk.yaml-template create mode 100644 blueprints/reference_templates/cdap_broker.yaml-template create mode 100644 blueprints/reference_templates/cdapbp7.yaml-template create mode 100644 blueprints/reference_templates/centos_vm.yaml-template create mode 100644 blueprints/reference_templates/config_binding_service.yaml-template create mode 100644 blueprints/reference_templates/consul_cluster.yaml-template create mode 100644 blueprints/reference_templates/heartbeat-service.yaml-template create mode 100644 blueprints/reference_templates/holmes-engine.yaml-template create mode 100644 blueprints/reference_templates/holmes-rules.yaml-template create mode 100644 blueprints/reference_templates/inventory.yaml-template create mode 100644 blueprints/reference_templates/pgaas-cluster.yaml-template create mode 100644 blueprints/reference_templates/pgaas-database.yaml-template create mode 100644 blueprints/reference_templates/pgaas-disk.yaml-template create mode 100644 blueprints/reference_templates/pgaas-getdbinfo.yaml-template create mode 100644 blueprints/reference_templates/pgaas-onevm.yaml-template create mode 100644 blueprints/reference_templates/pgaas.yaml-template create mode 100644 blueprints/reference_templates/policy_handler.yaml-template create mode 100644 blueprints/reference_templates/prh-service.yaml-template create mode 100644 blueprints/reference_templates/snmptrap-collector.yaml-template create mode 100644 blueprints/reference_templates/tca.yaml-template create mode 100644 blueprints/reference_templates/tcadocker-service.yaml-template create mode 100644 blueprints/reference_templates/ves.yaml-template delete mode 100644 blueprints/snmptrap-collector.yaml-template delete mode 100644 blueprints/tca.yaml-template delete mode 100644 blueprints/tcadocker-service.yaml-template delete mode 100644 blueprints/ves.yaml-template diff --git a/blueprints/DeploymentHandler-README.md b/blueprints/DeploymentHandler-README.md deleted file mode 100644 index 8b76890..0000000 --- a/blueprints/DeploymentHandler-README.md +++ /dev/null @@ -1,23 +0,0 @@ -## Deployment Handler Installation Blueprint -[`DeploymentHandler.yaml`](./DeploymentHandler.yaml) is a Cloudify blueprint that can be used to deploy an instance of the DCAE Deployment Handler (DH) as a Docker container in the DCAE Docker environment. - -### Input parameters -Some deployment parameters can be controlled via inputs supplied to Cloudify at the time a deployment is created from the blueprint. -The table below describes the available input parameters. - -Parameter|Description|Required?|Default ----------|-----------|---------|------- -`location_id`|Location where DH is to be deployed; should point to a central site|Yes|None -`docker_host_override`|Registered service name of the Docker host where DH should be deployed|Yes|`platform_dockerhost` -`deployment_handler_image`|Fully qualified name of the Docker image to use for DH|Yes|Current stable version of image -`application_config`|Application-specific configuration parameters (see below)|No|`{}` -`host_log_root`|root directory for logs in the Docker host file system|Yes|`/opt/onap/log` - -### Application configuration -The DH has sensible defaults for its configuration. The `application_config` input can be used to supply additional configuration information to override defaults and/or to set values for optional parameters. The content of this input is a dictionary with parameter names as keys and parameter values as values. See the documentation for the DH for the available configuration parameters. - -### Additional configuration -`DeploymentHandler.yaml` relies on the DCAE Docker plugin to carry out the actual deployment. The plugin gathers information from the blueprint and the inputs and uses this information to make API calls to a Docker Engine running in the DCAE environment. - -Certain aspects of Docker behavior are controlled through inputs to the plugin's `create` operation. This includes mapping directories and files from the host file system into the Docker container's file system. It is also possible to pass environment variables to the container. The inputs to the `create` operation are specified inside the blueprint in the `interfaces` section of node definition for the deployment handler. - diff --git a/blueprints/DeploymentHandler.yaml-template b/blueprints/DeploymentHandler.yaml-template deleted file mode 100644 index 4856636..0000000 --- a/blueprints/DeploymentHandler.yaml-template +++ /dev/null @@ -1,102 +0,0 @@ -# -*- indent-tabs-mode: nil -*- # vi: set expandtab: -# -# ============LICENSE_START========================================== -# org.onap.dcae -# =================================================================== -# Copyright © 2017 AT&T Intellectual Property. All rights reserved. -# =================================================================== -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END============================================ -# -# ECOMP and OpenECOMP are trademarks -# and service marks of AT&T Intellectual Property. -# - -tosca_definitions_version: cloudify_dsl_1_3 - -description: > - This blueprint deploys/manages the DCAE deployment handler as a Docker container - -imports: - - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml - - -inputs: - - location_id: - description: Deployment location - - docker_host_override: - description: Target docker host - default: 'platform_dockerhost' - - deployment_handler_image: - description: Docker image for deployment handler - default: '{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/org.onap.dcaegen2.platform.deployment-handler:3.2.0' - - application_config: - description: deployment handler application configuration (to override defaults) - default: {} - - host_log_root: - description: root directory for logs in the Docker host file system - default: '/opt/onap/log' - -node_templates: - - # Deployment Handler - deployment-handler: - type: dcae.nodes.DockerContainerForPlatforms - properties: - name: - 'deployment_handler' - image: - { get_input: deployment_handler_image } - application_config: - { get_input: application_config } - host_port: - 8188 - container_port: - 8443 - docker_config: - healthcheck: - type: 'http' - interval: '300s' - timeout: '5s' - endpoint: '/' - relationships: - - type: dcae.relationships.component_contained_in - target: docker_host - interfaces: - cloudify.interfaces.lifecycle: - start: - inputs: - envs: - SOMEVAR: somevalue - #volumes: - #- host: - #path: { concat: [ { get_input: host_log_root }, '/dcae/deployment_handler' ] } - #container: - #bind: /opt/app/dh/log - #mode: rw - - # Docker host - docker_host: - type: dcae.nodes.SelectedDockerHost - properties: - location_id: - { get_input: location_id } - docker_host_override: - { get_input: docker_host_override } diff --git a/blueprints/DockerBP.yaml-template b/blueprints/DockerBP.yaml-template deleted file mode 100644 index e655063..0000000 --- a/blueprints/DockerBP.yaml-template +++ /dev/null @@ -1,345 +0,0 @@ -# -*- indent-tabs-mode: nil -*- # vi: set expandtab: -# -# ============LICENSE_START==================================================== -# org.onap.dcae -# ============================================================================= -# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. -# ============================================================================= -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END====================================================== - -tosca_definitions_version: cloudify_dsl_1_3 - -imports: - - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml - - http://www.getcloudify.org/spec/openstack-plugin/1.4/plugin.yaml - - http://www.getcloudify.org/spec/fabric-plugin/1.4.1/plugin.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/dnsdesig/dns_types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/sshkeyshare/sshkey_types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml - - - -inputs: - registered_dockerhost_name: - description: the name that this Dockerhost is registered as - location_id: - description: the location ID for the location where the Docker hsot is being deployed - type: string - target_datacenter: - description: |- - This is the name of the target Consul datacenter that the docker host will try to join - type: string - registrator_image: - description: |- - Full uri to registrator Docker image. Note! You should be using the forked version of - registrator in order to have Consul health checks for Docker containers. - type: string - centos7image_id: - type: string - default: '' - ubuntu1604image_id: - type: string - flavor_id: - type: string - security_group: - type: string - public_net: - type: string - private_net: - type: string - openstack: {} - keypair: - type: string - location_prefix: - type: string - location_domain: - type: string - node_name: - description: Used to construct the fqdn of the docker host - type: string - default: dokr00 - key_filename: - type: string - codesource_url: - type: string - codesource_version: - type: string - vm_init_dokr_00: - type: string - default: |- - #!/bin/sh - set -x - DATACENTER= - vm_init_dokr_01: - type: string - default: |- - REGNAME= - vm_init_dokr_fqdn: - type: string - description: |- - The FQDN environment variable is to be used in the cloud init script for the Docker host. - This is to be applied as metadata on the Consul node for the Docker host under the key - "fqdn". - default: |- - FQDN= - vm_init_dokr_service_tags: - type: string - description: |- - Environment variable assigned to a list of strings that are to be used as tags to label - the docker host. These tags are used when registering the docker host as a service in - Consul. The format of this input parameter is a string that is a shell script variable - assignment of the variable SERVICE_TAGS. It must be either null or a json array of strings. - Here is a valid example of when the value is a json array: - - 'SERVICE_TAGS="[\"foo\", \"bar\"]"' - - Note how the double quotes per array element are escaped. - default: "SERVICE_TAGS=null" - vm_init_dokr_02: - type: string - default: | - MYIP=`wget -qO- http://169.254.169.254/2009-04-04/meta-data/local-ipv4` - while [ -z "$MYPUB" ]; do - MYPUB=`wget -qO- http://169.254.169.254/2009-04-04/meta-data/public-ipv4` - sleep 5 - done - echo "My public IP: $MYPUB" - MYNAME=`hostname` - echo >>/etc/hosts - echo $MYIP $MYNAME >>/etc/hosts - - # Grab nameservers to be used to setup recursors for Consul - cat < /tmp/grab_nameservers.py - with open("/etc/resolv.conf", "r") as f: - nss = [line.split(" ")[1].strip() for line in f.readlines() if line.startswith("nameserver")] - print("[\"{0}\"]".format("\",\"".join(nss))) - EOF - NAMESERVERS=$(python3 /tmp/grab_nameservers.py) - - mkdir -p /opt/consul/config /opt/consul/data /opt/consul/bin - # Download Consul from Nexus - apt-get update - DEBIAN_FRONTEND=noninteractive apt-get install -y -q unzip - CONSUL_BIN_DIR=/opt/consul/bin - curl -Ss https://releases.hashicorp.com/consul/0.8.3/consul_0.8.3_linux_amd64.zip > $CONSUL_BIN_DIR/consul_0.8.3_linux_amd64.zip - unzip $CONSUL_BIN_DIR/consul_0.8.3_linux_amd64.zip -d $CONSUL_BIN_DIR - # NOTE: The health check for the docker host is a simple existence look up for - # registrator (name is hardcoded). It does not check if registrator is running. - # This would require a script health check which means we might need to turn on - # "enable_script_check". - # NOTE: At the time of this change, there is no issue but there could be a - # chicken-and-egg issue where the health check might depend upon future downstream - # nodes (registrator) that downstream node requires a *healthy* docker host. - cat < /opt/consul/config/consul.json - { - "bind_addr" : "0.0.0.0", - "client_addr" : "0.0.0.0", - "advertise_addr" : "$MYIP", - "data_dir" : "/opt/consul/data", - "datacenter": "$DATACENTER", - "http_api_response_headers": { - "Access-Control-Allow-Origin" : "*" - }, - "rejoin_after_leave": true, - "server": false, - "ui": false, - "enable_syslog": true, - "log_level": "info", - "ports": { - "dns": 53 - }, - "recursors": $NAMESERVERS, - "service" : { - "id": "$REGNAME", - "name": "$REGNAME", - "address": "$MYPUB", - "port": 2376, - "tags": $SERVICE_TAGS, - "checks": [ - { - "http": "http://$MYPUB:2376/containers/registrator/json", - "interval": "30s" - } - ] - }, - "node_meta": { - "fqdn": "$FQDN" - } - } - EOF - - # Specify DOCKER_HOST environment variable to support healthchecks for Docker containers - # in Consul. Tried using the local unix socket but that did not work (possible bug in Consul) - # so forcing to use the http connection to Docker engine. - cat < /lib/systemd/system/consul.service - [Unit] - Description=Consul - Requires=network-online.target - After=network.target - [Service] - Type=simple - Environment=DOCKER_HOST=tcp://localhost:2376 - ExecStart=/opt/consul/bin/consul agent -config-dir=/opt/consul/config - ExecReload=/bin/kill -HUP \$MAINPID - [Install] - WantedBy=multi-user.target - EOF - systemctl enable consul - systemctl start consul - until /opt/consul/bin/consul join "cloudify-manager-${DATACENTER}" - do - echo Waiting to join Consul cluster - sleep 60 - done - - DEBIAN_FRONTEND=noninteractive apt-get install -y -q linux-image-extra-`uname -r` linux-image-extra-virtual apparmor dirmngr - DEBIAN_FRONTEND=noninteractive apt-get install -y -q docker.io - echo 'DOCKER_OPTS="--raw-logs -H tcp://0.0.0.0:2376 -H unix:///var/run/docker.sock"' >>/etc/default/docker - systemctl restart docker -node_templates: - key_pair: - type: cloudify.openstack.nodes.KeyPair - properties: - private_key_path: { get_input: key_filename } - use_external_resource: True - resource_id: { get_input: keypair } - openstack_config: &open_conf - get_input: openstack - private_net: - type: cloudify.openstack.nodes.Network - properties: - use_external_resource: True - resource_id: { get_input: private_net } - openstack_config: *open_conf - security_group: - type: cloudify.openstack.nodes.SecurityGroup - properties: - use_external_resource: True - resource_id: { get_input: security_group } - openstack_config: *open_conf - fixedip_dokr00: - type: cloudify.openstack.nodes.Port - properties: - port: - extra_dhcp_opts: - - opt_name: 'domain-name' - opt_value: { get_input: location_domain } - openstack_config: *open_conf - relationships: - - type: cloudify.relationships.contained_in - target: private_net - floatingip_dokr00: - type: cloudify.openstack.nodes.FloatingIP - properties: - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - floating_network_name: { get_input: public_net } - dns_dokr00: - type: ccsdk.nodes.dns.arecord - properties: - fqdn: { concat: [ { get_input: location_prefix }, { get_input: node_name }, '.', { get_input: location_domain } ] } - openstack: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - ip_addresses: - - { get_attribute: [ floatingip_dokr00, floating_ip_address ] } - relationships: - - type: cloudify.relationships.depends_on - target: floatingip_dokr00 - host_dokr00: - type: cloudify.openstack.nodes.Server - properties: - install_agent: false - image: { get_input: ubuntu1604image_id } - flavor: { get_input: flavor_id } - management_network_name: { get_input: private_net } - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - name: { concat: [ { get_input: location_prefix }, { get_input: node_name }] } - userdata: - concat: - - { get_input: vm_init_dokr_00 } - - { get_input: target_datacenter } - - |+ - - - { get_input: vm_init_dokr_01 } - - { get_input: registered_dockerhost_name } - - |+ - - - { get_input: vm_init_dokr_fqdn } - - { get_property: [ dns_dokr00, fqdn ] } - - |+ - - - { get_input: vm_init_dokr_service_tags } - - |+ - - - { get_input: vm_init_dokr_02 } - relationships: - - type: cloudify.openstack.server_connected_to_port - target: fixedip_dokr00 - - type: cloudify.openstack.server_connected_to_security_group - target: security_group - - type: cloudify.openstack.server_connected_to_floating_ip - target: floatingip_dokr00 - - type: cloudify.openstack.server_connected_to_keypair - target: key_pair - - type: cloudify.relationships.depends_on - target: dns_dokr00 - - registrator: - type: dcae.nodes.DockerContainer - properties: - name: - 'registrator' - image: - { get_input: registrator_image } - relationships: - - type: dcae.relationships.component_contained_in - target: docker_host - interfaces: - cloudify.interfaces.lifecycle: - start: - inputs: - envs: - EXTERNAL_IP: - get_attribute: [ floatingip_dokr00, floating_ip_address ] - volumes: - - host: - path: '/var/run/docker.sock' - container: - bind: '/tmp/docker.sock' - mode: 'ro' - - docker_host: - type: dcae.nodes.SelectedDockerHost - properties: - location_id: - { get_input: location_id } - docker_host_override: - { get_input: registered_dockerhost_name } - relationships: - - type: cloudify.relationships.depends_on #this is to avoid a race condition - target: host_dokr00 diff --git a/blueprints/cdap-sdk.yaml-template b/blueprints/cdap-sdk.yaml-template deleted file mode 100644 index cd1244f..0000000 --- a/blueprints/cdap-sdk.yaml-template +++ /dev/null @@ -1,71 +0,0 @@ -# ============LICENSE_START==================================================== -# org.onap.dcae -# ============================================================================= -# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. -# ============================================================================= -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END====================================================== - - -tosca_definitions_version: cloudify_dsl_1_3 -imports: - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml - -inputs: - dh_override: - type: string - default: "component_dockerhost" - dh_location_id: - type: string - default: "dcaeams" - cdap_cluster_name: - type: string - default: "cdap" -node_templates: - docker_cdap_host: - properties: - docker_host_override: - get_input: dh_override - location_id: - get_input: dh_location_id - type: dcae.nodes.SelectedDockerHost - cdapdocker: - interfaces: - cloudify.interfaces.lifecycle: - stop: - inputs: - cleanup_image: true - start: - inputs: - ports: - - '11011:11011' - envs: - SERVICE_11015_NAME: { get_input: cdap_cluster_name } - SERVICE_11011_IGNORE: 'true' - properties: - host_port: 11015 - container_port: 11015 - docker_config: - healthcheck: - endpoint: "/status" - interval: "15s" - timeout: "15s" - type: "http" - name: 'cdap_docker' - image: "caskdata/cdap-standalone:4.1.2" - relationships: - - type: dcae.relationships.component_contained_in - target: docker_cdap_host - type: dcae.nodes.DockerContainerForPlatforms - diff --git a/blueprints/cdap_broker.yaml-template b/blueprints/cdap_broker.yaml-template deleted file mode 100644 index 3c29634..0000000 --- a/blueprints/cdap_broker.yaml-template +++ /dev/null @@ -1,97 +0,0 @@ -# -*- indent-tabs-mode: nil -*- # vi: set expandtab: -# -# ============LICENSE_START==================================================== -# org.onap.dcae -# ============================================================================= -# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. -# ============================================================================= -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END====================================================== - -tosca_definitions_version: cloudify_dsl_1_3 - -description: > - This blueprint is for managing the CDAP infrastructure - -imports: - - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/cdapcloudify/14/cdapcloudify_types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml - -inputs: - location_id: - type: string - default: "" - cdap_cluster_name: - type: string - default: "cdap" - -node_templates: - - broker_deleter: - #does nothing on install, but deletes all registered apps when broker is uninstalled - #uninstalling the broker without doing this leaves them in purgatory forever, unless CDAP was also uninstalled, but that may or may not be true or in the same blueprint. - type: dcae.nodes.broker_deleter - interfaces: - cloudify.interfaces.lifecycle: - delete: - inputs: - connected_broker_dns_name: { get_property: [cdap_broker, name] } - relationships: - - type: cloudify.relationships.depends_on - target: cdap_broker - - cdap_broker: - type: dcae.nodes.DockerContainerForPlatforms - properties: - name: 'cdap_broker' - application_config: - bindingttw: 5 - hcinterval: 60s - autoderegisterafter: 10m - pipelinehealthlimit: 2 - host_port: 7777 - container_port: 7777 - docker_config: - healthcheck: - type: "http" - #broker has a semi healthcheck endpoint at root right now, TODO would be to add a real /healtcheck endpoint - endpoint: "/" - interval: "120s" - timeout: "60s" - image: "{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/org.onap.dcaegen2.platform.cdapbroker:v4.0.0" - interfaces: - cloudify.interfaces.lifecycle: - start: - inputs: - envs: - CDAP_CLUSTER_TO_MANAGE: { get_input: cdap_cluster_name } - volumes: - - host: - path: '/tmp/log/cdapbroker/' - container: - bind: '/tmp/log/cdapbroker/' #Broker EELF log directory - mode: 'rw' - relationships: - - type: dcae.relationships.component_contained_in - target: docker_host - - docker_host: - type: dcae.nodes.SelectedDockerHost - properties: - location_id: - { get_input: location_id } - docker_host_override: - 'platform_dockerhost' - #WARNING: ASSUMES THIS EXISTS AND IS ALREADY REGISTERED diff --git a/blueprints/cdapbp7.yaml-template b/blueprints/cdapbp7.yaml-template deleted file mode 100644 index 7fddaa1..0000000 --- a/blueprints/cdapbp7.yaml-template +++ /dev/null @@ -1,1054 +0,0 @@ -# -*- indent-tabs-mode: nil -*- # vi: set expandtab: -# -# ============LICENSE_START==================================================== -# org.onap.dcae -# ============================================================================= -# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. -# ============================================================================= -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END====================================================== - -tosca_definitions_version: cloudify_dsl_1_3 - -imports: - - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml - - http://www.getcloudify.org/spec/openstack-plugin/1.4/plugin.yaml - - http://www.getcloudify.org/spec/fabric-plugin/1.4.1/plugin.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/dnsdesig/dns_types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/sshkeyshare/sshkey_types.yaml - -inputs: - centos7image_id: - type: string - default: '' - ubuntu1404image_id: - type: string - default: '' - ubuntu1604image_id: - type: string - flavor_id: - type: string - security_group: - type: string - public_net: - type: string - private_net: - type: string - openstack: {} - keypair: - type: string - location_prefix: - type: string - location_domain: - type: string - key_filename: - type: string - codesource_url: - type: string - codesource_version: - type: string - - vm_init_cdap: - type: string - default: | - wget -qO- $CODE_SOURCE/${CODE_VERSION}/cloud_init/cdap-init.sh >/tmp/cdap-init.sh - sh /tmp/cdap-init.sh "$CODE_SOURCE" "$CODE_VERSION" "$CLUSTER_INDEX" "$CLUSTER_SIZE" "$CLUSTER_FQDNS" "$CLUSTER_LOCAL_IPS" "$CLUSTER_FLOATING_IPS" "$DATACENTER" "$REGISTERED_NAME" - location_id: - default: "solutioning-central" - cdap_cluster_name: - type: string - default: "cdap" - -node_templates: - key_pair: - type: cloudify.openstack.nodes.KeyPair - properties: - private_key_path: { get_input: key_filename } - use_external_resource: True - resource_id: { get_input: keypair } - openstack_config: &open_conf - get_input: openstack - private_net: - type: cloudify.openstack.nodes.Network - properties: - use_external_resource: True - resource_id: { get_input: private_net } - openstack_config: *open_conf - security_group: - type: cloudify.openstack.nodes.SecurityGroup - properties: - use_external_resource: True - resource_id: { get_input: security_group } - openstack_config: *open_conf - - sharedsshkey_cdap: - type: ccsdk.nodes.ssh.keypair - hostdeps_cdap: - type: cloudify.nodes.Root - relationships: - - type: cloudify.relationships.depends_on - target: dns_cdap00 - - type: cloudify.relationships.depends_on - target: fixedip_cdap00 - - type: cloudify.relationships.depends_on - target: dns_cdap01 - - type: cloudify.relationships.depends_on - target: fixedip_cdap01 - - type: cloudify.relationships.depends_on - target: dns_cdap02 - - type: cloudify.relationships.depends_on - target: fixedip_cdap02 - - type: cloudify.relationships.depends_on - target: dns_cdap03 - - type: cloudify.relationships.depends_on - target: fixedip_cdap03 - - type: cloudify.relationships.depends_on - target: dns_cdap04 - - type: cloudify.relationships.depends_on - target: fixedip_cdap04 - - type: cloudify.relationships.depends_on - target: dns_cdap05 - - type: cloudify.relationships.depends_on - target: fixedip_cdap05 - - type: cloudify.relationships.depends_on - target: dns_cdap06 - - type: cloudify.relationships.depends_on - target: fixedip_cdap06 - fixedip_cdap00: - type: cloudify.openstack.nodes.Port - properties: - port: - extra_dhcp_opts: - - opt_name: 'domain-name' - opt_value: { get_input: location_domain } - openstack_config: *open_conf - relationships: - - type: cloudify.relationships.contained_in - target: private_net - floatingip_cdap00: - type: cloudify.openstack.nodes.FloatingIP - properties: - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - floating_network_name: { get_input: public_net } - dns_cdap00: - type: ccsdk.nodes.dns.arecord - properties: - fqdn: { concat: [ { get_input: location_prefix }, 'cdap00.', { get_input: location_domain } ] } - openstack: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - ip_addresses: - - { get_attribute: [ floatingip_cdap00, floating_ip_address ] } - relationships: - - type: cloudify.relationships.depends_on - target: floatingip_cdap00 - host_cdap00: - type: cloudify.openstack.nodes.Server - properties: - install_agent: false - image: { get_input: ubuntu1604image_id } - flavor: { get_input: flavor_id } - management_network_name: { get_input: private_net } - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - name: { concat: [ { get_input: location_prefix }, 'cdap00' ] } - userdata: - concat: - - |- - #!/bin/sh - mkdir /root/.sshkey - echo ' - - { get_attribute: [ sharedsshkey_cdap, public ] } - - |- - ' >/root/.sshkey/id_rsa.pub - echo ' - - { get_attribute: [ sharedsshkey_cdap, base64private ] } - - |- - ' | base64 -d >/root/.sshkey/id_rsa - chmod 700 /root/.sshkey - chmod 600 /root/.sshkey/* - set -x - CLUSTER_INDEX=00 - CLUSTER_SIZE=7 - CLUSTER_FQDNS= - - { get_property: [ dns_cdap00, fqdn ] } - - ',' - - { get_property: [ dns_cdap01, fqdn ] } - - ',' - - { get_property: [ dns_cdap02, fqdn ] } - - ',' - - { get_property: [ dns_cdap03, fqdn ] } - - ',' - - { get_property: [ dns_cdap04, fqdn ] } - - ',' - - { get_property: [ dns_cdap05, fqdn ] } - - ',' - - { get_property: [ dns_cdap06, fqdn ] } - - "\nCLUSTER_FLOATING_IPS=" - - { get_attribute: [ floatingip_cdap00, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap01, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap02, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap03, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap04, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap05, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap06, floating_ip_address ] } - - "\nCLUSTER_LOCAL_IPS=" - - { get_attribute: [ fixedip_cdap00, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap01, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap02, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap03, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap04, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap05, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap06, fixed_ip_address ] } - - "\nCODE_SOURCE=" - - { get_input: codesource_url } - - "\nCODE_VERSION=" - - { get_input: codesource_version } - - "\n" - - "DATACENTER=" - - { get_input: location_id } - - "\n" - - { get_input: vm_init_cdap } - relationships: - - type: cloudify.openstack.server_connected_to_port - target: fixedip_cdap00 - - type: cloudify.openstack.server_connected_to_security_group - target: security_group - - type: cloudify.openstack.server_connected_to_floating_ip - target: floatingip_cdap00 - - type: cloudify.openstack.server_connected_to_keypair - target: key_pair - - type: cloudify.relationships.depends_on - target: hostdeps_cdap - - type: cloudify.relationships.depends_on - target: sharedsshkey_cdap - fixedip_cdap01: - type: cloudify.openstack.nodes.Port - properties: - port: - extra_dhcp_opts: - - opt_name: 'domain-name' - opt_value: { get_input: location_domain } - openstack_config: *open_conf - relationships: - - type: cloudify.relationships.contained_in - target: private_net - floatingip_cdap01: - type: cloudify.openstack.nodes.FloatingIP - properties: - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - floating_network_name: { get_input: public_net } - dns_cdap01: - type: ccsdk.nodes.dns.arecord - properties: - fqdn: { concat: [ { get_input: location_prefix }, 'cdap01.', { get_input: location_domain } ] } - openstack: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - ip_addresses: - - { get_attribute: [ floatingip_cdap01, floating_ip_address ] } - relationships: - - type: cloudify.relationships.depends_on - target: floatingip_cdap01 - host_cdap01: - type: cloudify.openstack.nodes.Server - properties: - install_agent: false - image: { get_input: ubuntu1604image_id } - flavor: { get_input: flavor_id } - management_network_name: { get_input: private_net } - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - name: { concat: [ { get_input: location_prefix }, 'cdap01' ] } - userdata: - concat: - - |- - #!/bin/sh - mkdir /root/.sshkey - echo ' - - { get_attribute: [ sharedsshkey_cdap, public ] } - - |- - ' >/root/.sshkey/id_rsa.pub - echo ' - - { get_attribute: [ sharedsshkey_cdap, base64private ] } - - |- - ' | base64 -d >/root/.sshkey/id_rsa - chmod 700 /root/.sshkey - chmod 600 /root/.sshkey/* - set -x - CLUSTER_INDEX=01 - CLUSTER_SIZE=7 - CLUSTER_FQDNS= - - { get_property: [ dns_cdap00, fqdn ] } - - ',' - - { get_property: [ dns_cdap01, fqdn ] } - - ',' - - { get_property: [ dns_cdap02, fqdn ] } - - ',' - - { get_property: [ dns_cdap03, fqdn ] } - - ',' - - { get_property: [ dns_cdap04, fqdn ] } - - ',' - - { get_property: [ dns_cdap05, fqdn ] } - - ',' - - { get_property: [ dns_cdap06, fqdn ] } - - "\nCLUSTER_FLOATING_IPS=" - - { get_attribute: [ floatingip_cdap00, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap01, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap02, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap03, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap04, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap05, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap06, floating_ip_address ] } - - "\nCLUSTER_LOCAL_IPS=" - - { get_attribute: [ fixedip_cdap00, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap01, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap02, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap03, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap04, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap05, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap06, fixed_ip_address ] } - - "\nCODE_SOURCE=" - - { get_input: codesource_url } - - "\nCODE_VERSION=" - - { get_input: codesource_version } - - "\n" - - "DATACENTER=" - - { get_input: location_id } - - "\n" - - { get_input: vm_init_cdap } - relationships: - - type: cloudify.openstack.server_connected_to_port - target: fixedip_cdap01 - - type: cloudify.openstack.server_connected_to_security_group - target: security_group - - type: cloudify.openstack.server_connected_to_floating_ip - target: floatingip_cdap01 - - type: cloudify.openstack.server_connected_to_keypair - target: key_pair - - type: cloudify.relationships.depends_on - target: hostdeps_cdap - - type: cloudify.relationships.depends_on - target: sharedsshkey_cdap - fixedip_cdap02: - type: cloudify.openstack.nodes.Port - properties: - port: - extra_dhcp_opts: - - opt_name: 'domain-name' - opt_value: { get_input: location_domain } - openstack_config: *open_conf - relationships: - - type: cloudify.relationships.contained_in - target: private_net - floatingip_cdap02: - type: cloudify.openstack.nodes.FloatingIP - properties: - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - floating_network_name: { get_input: public_net } - dns_cdap02: - type: ccsdk.nodes.dns.arecord - properties: - fqdn: { concat: [ { get_input: location_prefix }, 'cdap02.', { get_input: location_domain } ] } - openstack: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - ip_addresses: - - { get_attribute: [ floatingip_cdap02, floating_ip_address ] } - relationships: - - type: cloudify.relationships.depends_on - target: floatingip_cdap02 - host_cdap02: - type: cloudify.openstack.nodes.Server - properties: - install_agent: false - image: { get_input: ubuntu1604image_id } - flavor: { get_input: flavor_id } - management_network_name: { get_input: private_net } - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - name: { concat: [ { get_input: location_prefix }, 'cdap02' ] } - userdata: - concat: - - |- - #!/bin/sh - mkdir /root/.sshkey - echo ' - - { get_attribute: [ sharedsshkey_cdap, public ] } - - |- - ' >/root/.sshkey/id_rsa.pub - echo ' - - { get_attribute: [ sharedsshkey_cdap, base64private ] } - - |- - ' | base64 -d >/root/.sshkey/id_rsa - chmod 700 /root/.sshkey - chmod 600 /root/.sshkey/* - set -x - CLUSTER_INDEX=02 - CLUSTER_SIZE=7 - CLUSTER_FQDNS= - - { get_property: [ dns_cdap00, fqdn ] } - - ',' - - { get_property: [ dns_cdap01, fqdn ] } - - ',' - - { get_property: [ dns_cdap02, fqdn ] } - - ',' - - { get_property: [ dns_cdap03, fqdn ] } - - ',' - - { get_property: [ dns_cdap04, fqdn ] } - - ',' - - { get_property: [ dns_cdap05, fqdn ] } - - ',' - - { get_property: [ dns_cdap06, fqdn ] } - - "\nCLUSTER_FLOATING_IPS=" - - { get_attribute: [ floatingip_cdap00, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap01, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap02, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap03, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap04, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap05, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap06, floating_ip_address ] } - - "\nCLUSTER_LOCAL_IPS=" - - { get_attribute: [ fixedip_cdap00, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap01, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap02, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap03, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap04, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap05, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap06, fixed_ip_address ] } - - "\nCODE_SOURCE=" - - { get_input: codesource_url } - - "\nCODE_VERSION=" - - { get_input: codesource_version } - - "\n" - - "DATACENTER=" - - { get_input: location_id } - - "\n" - - "REGISTERED_NAME=" - - { get_input: cdap_cluster_name } - - "\n" - - { get_input: vm_init_cdap } - relationships: - - type: cloudify.openstack.server_connected_to_port - target: fixedip_cdap02 - - type: cloudify.openstack.server_connected_to_security_group - target: security_group - - type: cloudify.openstack.server_connected_to_floating_ip - target: floatingip_cdap02 - - type: cloudify.openstack.server_connected_to_keypair - target: key_pair - - type: cloudify.relationships.depends_on - target: hostdeps_cdap - - type: cloudify.relationships.depends_on - target: sharedsshkey_cdap - - fixedip_cdap03: - type: cloudify.openstack.nodes.Port - properties: - port: - extra_dhcp_opts: - - opt_name: 'domain-name' - opt_value: { get_input: location_domain } - openstack_config: *open_conf - relationships: - - type: cloudify.relationships.contained_in - target: private_net - floatingip_cdap03: - type: cloudify.openstack.nodes.FloatingIP - properties: - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - floating_network_name: { get_input: public_net } - dns_cdap03: - type: ccsdk.nodes.dns.arecord - properties: - fqdn: { concat: [ { get_input: location_prefix }, 'cdap03.', { get_input: location_domain } ] } - openstack: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - ip_addresses: - - { get_attribute: [ floatingip_cdap03, floating_ip_address ] } - relationships: - - type: cloudify.relationships.depends_on - target: floatingip_cdap03 - host_cdap03: - type: cloudify.openstack.nodes.Server - properties: - install_agent: false - image: { get_input: ubuntu1604image_id } - flavor: { get_input: flavor_id } - management_network_name: { get_input: private_net } - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - name: { concat: [ { get_input: location_prefix }, 'cdap03' ] } - userdata: - concat: - - |- - #!/bin/sh - mkdir /root/.sshkey - echo ' - - { get_attribute: [ sharedsshkey_cdap, public ] } - - |- - ' >/root/.sshkey/id_rsa.pub - echo ' - - { get_attribute: [ sharedsshkey_cdap, base64private ] } - - |- - ' | base64 -d >/root/.sshkey/id_rsa - chmod 700 /root/.sshkey - chmod 600 /root/.sshkey/* - set -x - CLUSTER_INDEX=03 - CLUSTER_SIZE=7 - CLUSTER_FQDNS= - - { get_property: [ dns_cdap00, fqdn ] } - - ',' - - { get_property: [ dns_cdap01, fqdn ] } - - ',' - - { get_property: [ dns_cdap02, fqdn ] } - - ',' - - { get_property: [ dns_cdap03, fqdn ] } - - ',' - - { get_property: [ dns_cdap04, fqdn ] } - - ',' - - { get_property: [ dns_cdap05, fqdn ] } - - ',' - - { get_property: [ dns_cdap06, fqdn ] } - - "\nCLUSTER_FLOATING_IPS=" - - { get_attribute: [ floatingip_cdap00, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap01, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap02, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap03, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap04, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap05, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap06, floating_ip_address ] } - - "\nCLUSTER_LOCAL_IPS=" - - { get_attribute: [ fixedip_cdap00, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap01, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap02, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap03, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap04, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap05, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap06, fixed_ip_address ] } - - "\nCODE_SOURCE=" - - { get_input: codesource_url } - - "\nCODE_VERSION=" - - { get_input: codesource_version } - - "\n" - - "DATACENTER=" - - { get_input: location_id } - - "\n" - - { get_input: vm_init_cdap } - relationships: - - type: cloudify.openstack.server_connected_to_port - target: fixedip_cdap03 - - type: cloudify.openstack.server_connected_to_security_group - target: security_group - - type: cloudify.openstack.server_connected_to_floating_ip - target: floatingip_cdap03 - - type: cloudify.openstack.server_connected_to_keypair - target: key_pair - - type: cloudify.relationships.depends_on - target: hostdeps_cdap - - type: cloudify.relationships.depends_on - target: sharedsshkey_cdap - fixedip_cdap04: - type: cloudify.openstack.nodes.Port - properties: - port: - extra_dhcp_opts: - - opt_name: 'domain-name' - opt_value: { get_input: location_domain } - openstack_config: *open_conf - relationships: - - type: cloudify.relationships.contained_in - target: private_net - floatingip_cdap04: - type: cloudify.openstack.nodes.FloatingIP - properties: - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - floating_network_name: { get_input: public_net } - dns_cdap04: - type: ccsdk.nodes.dns.arecord - properties: - fqdn: { concat: [ { get_input: location_prefix }, 'cdap04.', { get_input: location_domain } ] } - openstack: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - ip_addresses: - - { get_attribute: [ floatingip_cdap04, floating_ip_address ] } - relationships: - - type: cloudify.relationships.depends_on - target: floatingip_cdap04 - host_cdap04: - type: cloudify.openstack.nodes.Server - properties: - install_agent: false - image: { get_input: ubuntu1604image_id } - flavor: { get_input: flavor_id } - management_network_name: { get_input: private_net } - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - name: { concat: [ { get_input: location_prefix }, 'cdap04' ] } - userdata: - concat: - - |- - #!/bin/sh - mkdir /root/.sshkey - echo ' - - { get_attribute: [ sharedsshkey_cdap, public ] } - - |- - ' >/root/.sshkey/id_rsa.pub - echo ' - - { get_attribute: [ sharedsshkey_cdap, base64private ] } - - |- - ' | base64 -d >/root/.sshkey/id_rsa - chmod 700 /root/.sshkey - chmod 600 /root/.sshkey/* - set -x - CLUSTER_INDEX=04 - CLUSTER_SIZE=7 - CLUSTER_FQDNS= - - { get_property: [ dns_cdap00, fqdn ] } - - ',' - - { get_property: [ dns_cdap01, fqdn ] } - - ',' - - { get_property: [ dns_cdap02, fqdn ] } - - ',' - - { get_property: [ dns_cdap03, fqdn ] } - - ',' - - { get_property: [ dns_cdap04, fqdn ] } - - ',' - - { get_property: [ dns_cdap05, fqdn ] } - - ',' - - { get_property: [ dns_cdap06, fqdn ] } - - "\nCLUSTER_FLOATING_IPS=" - - { get_attribute: [ floatingip_cdap00, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap01, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap02, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap03, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap04, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap05, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap06, floating_ip_address ] } - - "\nCLUSTER_LOCAL_IPS=" - - { get_attribute: [ fixedip_cdap00, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap01, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap02, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap03, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap04, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap05, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap06, fixed_ip_address ] } - - "\nCODE_SOURCE=" - - { get_input: codesource_url } - - "\nCODE_VERSION=" - - { get_input: codesource_version } - - "\n" - - "DATACENTER=" - - { get_input: location_id } - - "\n" - - { get_input: vm_init_cdap } - relationships: - - type: cloudify.openstack.server_connected_to_port - target: fixedip_cdap04 - - type: cloudify.openstack.server_connected_to_security_group - target: security_group - - type: cloudify.openstack.server_connected_to_floating_ip - target: floatingip_cdap04 - - type: cloudify.openstack.server_connected_to_keypair - target: key_pair - - type: cloudify.relationships.depends_on - target: hostdeps_cdap - - type: cloudify.relationships.depends_on - target: sharedsshkey_cdap - fixedip_cdap05: - type: cloudify.openstack.nodes.Port - properties: - port: - extra_dhcp_opts: - - opt_name: 'domain-name' - opt_value: { get_input: location_domain } - openstack_config: *open_conf - relationships: - - type: cloudify.relationships.contained_in - target: private_net - floatingip_cdap05: - type: cloudify.openstack.nodes.FloatingIP - properties: - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - floating_network_name: { get_input: public_net } - dns_cdap05: - type: ccsdk.nodes.dns.arecord - properties: - fqdn: { concat: [ { get_input: location_prefix }, 'cdap05.', { get_input: location_domain } ] } - openstack: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - ip_addresses: - - { get_attribute: [ floatingip_cdap05, floating_ip_address ] } - relationships: - - type: cloudify.relationships.depends_on - target: floatingip_cdap05 - host_cdap05: - type: cloudify.openstack.nodes.Server - properties: - install_agent: false - image: { get_input: ubuntu1604image_id } - flavor: { get_input: flavor_id } - management_network_name: { get_input: private_net } - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - name: { concat: [ { get_input: location_prefix }, 'cdap05' ] } - userdata: - concat: - - |- - #!/bin/sh - mkdir /root/.sshkey - echo ' - - { get_attribute: [ sharedsshkey_cdap, public ] } - - |- - ' >/root/.sshkey/id_rsa.pub - echo ' - - { get_attribute: [ sharedsshkey_cdap, base64private ] } - - |- - ' | base64 -d >/root/.sshkey/id_rsa - chmod 700 /root/.sshkey - chmod 600 /root/.sshkey/* - set -x - CLUSTER_INDEX=05 - CLUSTER_SIZE=7 - CLUSTER_FQDNS= - - { get_property: [ dns_cdap00, fqdn ] } - - ',' - - { get_property: [ dns_cdap01, fqdn ] } - - ',' - - { get_property: [ dns_cdap02, fqdn ] } - - ',' - - { get_property: [ dns_cdap03, fqdn ] } - - ',' - - { get_property: [ dns_cdap04, fqdn ] } - - ',' - - { get_property: [ dns_cdap05, fqdn ] } - - ',' - - { get_property: [ dns_cdap06, fqdn ] } - - "\nCLUSTER_FLOATING_IPS=" - - { get_attribute: [ floatingip_cdap00, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap01, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap02, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap03, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap04, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap05, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap06, floating_ip_address ] } - - "\nCLUSTER_LOCAL_IPS=" - - { get_attribute: [ fixedip_cdap00, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap01, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap02, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap03, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap04, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap05, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap06, fixed_ip_address ] } - - "\nCODE_SOURCE=" - - { get_input: codesource_url } - - "\nCODE_VERSION=" - - { get_input: codesource_version } - - "\n" - - "DATACENTER=" - - { get_input: location_id } - - "\n" - - { get_input: vm_init_cdap } - relationships: - - type: cloudify.openstack.server_connected_to_port - target: fixedip_cdap05 - - type: cloudify.openstack.server_connected_to_security_group - target: security_group - - type: cloudify.openstack.server_connected_to_floating_ip - target: floatingip_cdap05 - - type: cloudify.openstack.server_connected_to_keypair - target: key_pair - - type: cloudify.relationships.depends_on - target: hostdeps_cdap - - type: cloudify.relationships.depends_on - target: sharedsshkey_cdap - fixedip_cdap06: - type: cloudify.openstack.nodes.Port - properties: - port: - extra_dhcp_opts: - - opt_name: 'domain-name' - opt_value: { get_input: location_domain } - openstack_config: *open_conf - relationships: - - type: cloudify.relationships.contained_in - target: private_net - floatingip_cdap06: - type: cloudify.openstack.nodes.FloatingIP - properties: - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - floating_network_name: { get_input: public_net } - dns_cdap06: - type: ccsdk.nodes.dns.arecord - properties: - fqdn: { concat: [ { get_input: location_prefix }, 'cdap06.', { get_input: location_domain } ] } - openstack: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - ip_addresses: - - { get_attribute: [ floatingip_cdap06, floating_ip_address ] } - relationships: - - type: cloudify.relationships.depends_on - target: floatingip_cdap06 - host_cdap06: - type: cloudify.openstack.nodes.Server - properties: - install_agent: false - image: { get_input: ubuntu1604image_id } - flavor: { get_input: flavor_id } - management_network_name: { get_input: private_net } - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - name: { concat: [ { get_input: location_prefix }, 'cdap06' ] } - userdata: - concat: - - |- - #!/bin/sh - mkdir /root/.sshkey - echo ' - - { get_attribute: [ sharedsshkey_cdap, public ] } - - |- - ' >/root/.sshkey/id_rsa.pub - echo ' - - { get_attribute: [ sharedsshkey_cdap, base64private ] } - - |- - ' | base64 -d >/root/.sshkey/id_rsa - chmod 700 /root/.sshkey - chmod 600 /root/.sshkey/* - set -x - CLUSTER_INDEX=06 - CLUSTER_SIZE=7 - CLUSTER_FQDNS= - - { get_property: [ dns_cdap00, fqdn ] } - - ',' - - { get_property: [ dns_cdap01, fqdn ] } - - ',' - - { get_property: [ dns_cdap02, fqdn ] } - - ',' - - { get_property: [ dns_cdap03, fqdn ] } - - ',' - - { get_property: [ dns_cdap04, fqdn ] } - - ',' - - { get_property: [ dns_cdap05, fqdn ] } - - ',' - - { get_property: [ dns_cdap06, fqdn ] } - - "\nCLUSTER_FLOATING_IPS=" - - { get_attribute: [ floatingip_cdap00, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap01, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap02, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap03, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap04, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap05, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap06, floating_ip_address ] } - - "\nCLUSTER_LOCAL_IPS=" - - { get_attribute: [ fixedip_cdap00, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap01, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap02, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap03, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap04, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap05, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap06, fixed_ip_address ] } - - "\nCODE_SOURCE=" - - { get_input: codesource_url } - - "\nCODE_VERSION=" - - { get_input: codesource_version } - - "\n" - - "DATACENTER=" - - { get_input: location_id } - - "\n" - - { get_input: vm_init_cdap } - relationships: - - type: cloudify.openstack.server_connected_to_port - target: fixedip_cdap06 - - type: cloudify.openstack.server_connected_to_security_group - target: security_group - - type: cloudify.openstack.server_connected_to_floating_ip - target: floatingip_cdap06 - - type: cloudify.openstack.server_connected_to_keypair - target: key_pair - - type: cloudify.relationships.depends_on - target: hostdeps_cdap - - type: cloudify.relationships.depends_on - target: sharedsshkey_cdap diff --git a/blueprints/centos_vm.yaml-template b/blueprints/centos_vm.yaml-template deleted file mode 100644 index aa3bdb4..0000000 --- a/blueprints/centos_vm.yaml-template +++ /dev/null @@ -1,243 +0,0 @@ -# -*- indent-tabs-mode: nil -*- # vi: set expandtab: -# -# ============LICENSE_START========================================== -# org.onap.dcae -# =================================================================== -# Copyright © 2017 AT&T Intellectual Property. All rights reserved. -# =================================================================== -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END============================================ -# -# ECOMP and OpenECOMP are trademarks -# and service marks of AT&T Intellectual Property. -# - -tosca_definitions_version: cloudify_dsl_1_3 - -imports: - - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml - - http://www.getcloudify.org/spec/openstack-plugin/1.4/plugin.yaml - - http://www.getcloudify.org/spec/fabric-plugin/1.4.1/plugin.yaml - - types/dns_types.yaml - - types/sshkey_types.yaml - -inputs: - centos7image_id: - type: string - ubuntu1604image_id: - type: string - flavor_id: - type: string - security_group: - type: string - public_net: - type: string - private_net: - type: string - openstack: {} - keypair: - type: string - location_prefix: - type: string - location_domain: - type: string - key_filename: - type: string - codesource_url: - type: string - codesource_version: - type: string - cname: - type: string - default: dcae-orcl - datacenter: - type: string - vm_init_clmg_00: - type: string - default: |- - #!/bin/sh - set -x - DATACENTER= - vm_init_clmg_01: - type: string - default: | - CONSULVER=0.8.3 - CONSULNAME=consul_${CONSULVER}_linux_amd64 - MYIP=`curl -Ss http://169.254.169.254/2009-04-04/meta-data/local-ipv4` - MYNAME=`hostname` - if [ ! -z "$(echo $MYNAME |grep '.')" ]; then MYNAME="$(echo $MYNAME | cut -f1 -d '.')"; fi - echo >>/etc/hosts - echo $MYIP $MYNAME >>/etc/hosts - mkdir -p /opt/consul/config /opt/consul/data /opt/consul/bin - yum install -y unzip - # Download Consul - curl -Ss https://releases.hashicorp.com/consul/${CONSULVER}/${CONSULNAME}.zip > ${CONSULNAME}.zip - unzip -d /opt/consul/bin ${CONSULNAME}.zip - rm ${CONSULNAME}.zip - chmod +x /opt/consul/bin/consul - cat < /opt/consul/config/consul.json - { - "bind_addr" : "0.0.0.0", - "client_addr" : "0.0.0.0", - "data_dir" : "/opt/consul/data", - "datacenter": "$DATACENTER", - "rejoin_after_leave": true, - "http_api_response_headers": { - "Access-Control-Allow-Origin" : "*" - }, - "server": false, - "ui": false, - "enable_syslog": true, - "log_level": "info" - } - EOF - cat < /lib/systemd/system/consul.service - [Unit] - Description=Consul - Requires=network-online.target - After=network.target - [Service] - Type=simple - ExecStart=/opt/consul/bin/consul agent -config-dir=/opt/consul/config - ExecReload=/bin/kill -HUP \$MAINPID - [Install] - WantedBy=multi-user.target - EOF - systemctl enable consul - systemctl start consul - yum install -y python-psycopg2 - -node_templates: - key_pair: - type: cloudify.openstack.nodes.KeyPair - properties: - private_key_path: { get_input: key_filename } - use_external_resource: True - resource_id: { get_input: keypair } - openstack_config: &open_conf - get_input: openstack - private_net: - type: cloudify.openstack.nodes.Network - properties: - use_external_resource: True - resource_id: { get_input: private_net } - openstack_config: *open_conf - security_group: - type: cloudify.openstack.nodes.SecurityGroup - properties: - use_external_resource: True - resource_id: { get_input: security_group } - openstack_config: *open_conf - fixedip_vm00: - type: cloudify.openstack.nodes.Port - properties: - port: - extra_dhcp_opts: - - opt_name: 'domain-name' - opt_value: { get_input: location_domain } - openstack_config: *open_conf - relationships: - - type: cloudify.relationships.contained_in - target: private_net - floatingip_vm00: - type: cloudify.openstack.nodes.FloatingIP - properties: - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - floating_network_name: { get_input: public_net } - dns_vm00: - type: ccsdk.nodes.dns.arecord - properties: - fqdn: { concat: [ { get_input: location_prefix }, 'orcl00.', { get_input: location_domain } ] } - openstack: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - ip_addresses: - - { get_attribute: [ floatingip_vm00, floating_ip_address ] } - relationships: - - type: cloudify.relationships.depends_on - target: floatingip_vm00 - dns_cm: - type: ccsdk.nodes.dns.arecord - properties: - fqdn: { concat: [ 'cloudify-manager-', { get_input: datacenter}, '.', { get_input: location_domain } ] } - openstack: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - ip_addresses: - - { get_attribute: [ floatingip_vm00, floating_ip_address ] } - relationships: - - type: cloudify.relationships.depends_on - target: floatingip_vm00 - dns_cname: - type: ccsdk.nodes.dns.cnamerecord - properties: - fqdn: { concat: [ { get_input: cname }, '.', { get_input: location_domain } ] } - openstack: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - cname: { get_property: [ dns_vm00, fqdn ] } - relationships: - - type: cloudify.relationships.depends_on - target: dns_vm00 - host_vm00: - type: cloudify.openstack.nodes.Server - properties: - install_agent: false - image: { get_input: centos7image_id } - flavor: { get_input: flavor_id } - management_network_name: { get_input: private_net } - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - name: { concat: [ { get_input: location_prefix }, 'orcl00' ] } - userdata: - concat: - - { get_input: vm_init_clmg_00 } - - { get_input: datacenter } - - |+ - - - { get_input: vm_init_clmg_01 } - relationships: - - type: cloudify.openstack.server_connected_to_port - target: fixedip_vm00 - - type: cloudify.openstack.server_connected_to_security_group - target: security_group - - type: cloudify.openstack.server_connected_to_floating_ip - target: floatingip_vm00 - - type: cloudify.openstack.server_connected_to_keypair - target: key_pair - - type: cloudify.relationships.depends_on - target: dns_vm00 - - type: cloudify.relationships.depends_on - target: dns_cm - -outputs: - public_ip: - value: { get_attribute: [floatingip_vm00, floating_ip_address] } diff --git a/blueprints/config_binding_service.yaml-template b/blueprints/config_binding_service.yaml-template deleted file mode 100644 index 28dfb43..0000000 --- a/blueprints/config_binding_service.yaml-template +++ /dev/null @@ -1,62 +0,0 @@ -# -*- indent-tabs-mode: nil -*- # vi: set expandtab: -# -# ============LICENSE_START==================================================== -# ============================================================================= -# Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved. -# ============================================================================= -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END====================================================== - -tosca_definitions_version: cloudify_dsl_1_3 - -description: > - This blueprint installs the config binding service - -imports: - - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml -inputs: - location_id: - type: string - default: "" - - docker_host_override: - description: Target docker host to deploy applications to - default: 'platform_dockerhost' - -node_templates: - # Config binding service - service-config-binding: - type: dcae.nodes.DockerContainerForPlatforms - properties: - name: 'config_binding_service' - host_port: 10000 - container_port: 10000 - image: "{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/org.onap.dcaegen2.platform.configbinding:2.1.5" - docker_config: - healthcheck: - type: "http" - endpoint: "/healthcheck" - - relationships: - - type: dcae.relationships.component_contained_in - target: docker_host - - docker_host: - type: dcae.nodes.SelectedDockerHost - properties: - location_id: - { get_input: location_id } - docker_host_override: - { get_input: docker_host_override } diff --git a/blueprints/consul_cluster.yaml-template b/blueprints/consul_cluster.yaml-template deleted file mode 100644 index a4ae89e..0000000 --- a/blueprints/consul_cluster.yaml-template +++ /dev/null @@ -1,384 +0,0 @@ -# -*- indent-tabs-mode: nil -*- # vi: set expandtab: -# -# ============LICENSE_START========================================== -# org.onap.dcae -# =================================================================== -# Copyright © 2017 AT&T Intellectual Property. All rights reserved. -# =================================================================== -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END============================================ -# -# ECOMP and OpenECOMP are trademarks -# and service marks of AT&T Intellectual Property. -# - -tosca_definitions_version: cloudify_dsl_1_3 - -imports: - - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml - - http://www.getcloudify.org/spec/openstack-plugin/1.4/plugin.yaml - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/dnsdesig/dns_types.yaml" - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/sshkeyshare/sshkey_types.yaml" - -inputs: - centos7image_id: - type: string - ubuntu1604image_id: - type: string - flavor_id: - type: string - security_group: - type: string - public_net: - type: string - private_net: - type: string - openstack: {} - keypair: - type: string - location_prefix: - type: string - location_domain: - type: string - key_filename: - type: string - codesource_url: - type: string - codesource_version: - type: string - datacenter: - type: string - vm_init_cnsl_00: - type: string - default: |- - #!/bin/sh - set -x - DATACENTER= - vm_init_cnsl_01: - type: string - default: | - CONSULVER=0.8.3 - CONSULNAME=consul_${CONSULVER}_linux_amd64 - MYIP=`wget -qO- http://169.254.169.254/2009-04-04/meta-data/local-ipv4` - MYNAME=`hostname` - echo >>/etc/hosts - echo $MYIP $MYNAME >>/etc/hosts - mkdir -p /opt/consul/config /opt/consul/data /opt/consul/bin - - # Download Consul - apt-get update - apt-get install unzip - wget https://releases.hashicorp.com/consul/${CONSULVER}/${CONSULNAME}.zip - unzip -d /opt/consul/bin ${CONSULNAME}.zip - rm ${CONSULNAME}.zip - chmod +x /opt/consul/bin/consul - - # NOTE: Not using port 80 for http to avoid port collision of user facing services - # particularly for more large scale deployments of Consul. - cat < /opt/consul/config/consul.json - { - "bind_addr" : "$MYIP", - "client_addr" : "0.0.0.0", - "bootstrap_expect" : 3, - "data_dir" : "/opt/consul/data", - "datacenter": "$DATACENTER", - "http_api_response_headers": { - "Access-Control-Allow-Origin" : "*" - }, - "server": true, - "ui": true, - "enable_syslog": true, - "log_level": "info", - "ports": { - "dns": 53 - } - } - EOF - cat < /lib/systemd/system/consul.service - [Unit] - Description=Consul - Requires=network-online.target - After=network.target - [Service] - Type=simple - ExecStart=/opt/consul/bin/consul agent -config-dir=/opt/consul/config - ExecReload=/bin/kill -HUP \$MAINPID - [Install] - WantedBy=multi-user.target - EOF - systemctl enable consul - systemctl start consul -node_templates: - key_pair: - type: cloudify.openstack.nodes.KeyPair - properties: - private_key_path: { get_input: key_filename } - use_external_resource: True - resource_id: { get_input: keypair } - openstack_config: &open_conf - get_input: openstack - private_net: - type: cloudify.openstack.nodes.Network - properties: - use_external_resource: True - resource_id: { get_input: private_net } - openstack_config: *open_conf - security_group: - type: cloudify.openstack.nodes.SecurityGroup - properties: - use_external_resource: True - resource_id: { get_input: security_group } - openstack_config: *open_conf - fixedip_cnsl00: - type: cloudify.openstack.nodes.Port - properties: - port: - extra_dhcp_opts: - - opt_name: 'domain-name' - opt_value: { get_input: location_domain } - openstack_config: *open_conf - relationships: - - type: cloudify.relationships.contained_in - target: private_net - floatingip_cnsl00: - type: cloudify.openstack.nodes.FloatingIP - properties: - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - floating_network_name: { get_input: public_net } - dns_cnsl00: - type: ccsdk.nodes.dns.arecord - properties: - fqdn: { concat: [ { get_input: location_prefix }, 'cnsl00.', { get_input: location_domain } ] } - openstack: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - ip_addresses: - - { get_attribute: [ floatingip_cnsl00, floating_ip_address ] } - relationships: - - type: cloudify.relationships.depends_on - target: floatingip_cnsl00 - host_cnsl00: - type: cloudify.openstack.nodes.Server - properties: - install_agent: false - image: { get_input: ubuntu1604image_id } - flavor: { get_input: flavor_id } - management_network_name: { get_input: private_net } - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - name: { concat: [ { get_input: location_prefix }, 'cnsl00' ] } - userdata: - concat: - - { get_input: vm_init_cnsl_00 } - - { get_input: datacenter } - - |+ - - - { get_input: vm_init_cnsl_01 } - - concat: - - 'until /opt/consul/bin/consul join ' - - { get_attribute: [host_cnsl01, ip] } - - '; do sleep 5; done; ' - - concat: - - 'until /opt/consul/bin/consul join ' - - { get_attribute: [host_cnsl02, ip]} - - '; do sleep 5; done' - - relationships: - - type: cloudify.openstack.server_connected_to_port - target: fixedip_cnsl00 - - type: cloudify.openstack.server_connected_to_security_group - target: security_group - - type: cloudify.openstack.server_connected_to_floating_ip - target: floatingip_cnsl00 - - type: cloudify.openstack.server_connected_to_keypair - target: key_pair - - type: cloudify.relationships.depends_on - target: dns_cnsl00 - - type: cloudify.relationships.depends_on - target: host_cnsl01 - - type: cloudify.relationships.depends_on - target: host_cnsl02 - fixedip_cnsl01: - type: cloudify.openstack.nodes.Port - properties: - port: - extra_dhcp_opts: - - opt_name: 'domain-name' - opt_value: { get_input: location_domain } - openstack_config: *open_conf - relationships: - - type: cloudify.relationships.contained_in - target: private_net - floatingip_cnsl01: - type: cloudify.openstack.nodes.FloatingIP - properties: - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - floating_network_name: { get_input: public_net } - dns_cnsl01: - type: ccsdk.nodes.dns.arecord - properties: - fqdn: { concat: [ { get_input: location_prefix }, 'cnsl01.', { get_input: location_domain } ] } - openstack: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - ip_addresses: - - { get_attribute: [ floatingip_cnsl01, floating_ip_address ] } - relationships: - - type: cloudify.relationships.depends_on - target: floatingip_cnsl01 - host_cnsl01: - type: cloudify.openstack.nodes.Server - properties: - install_agent: false - image: { get_input: ubuntu1604image_id } - flavor: { get_input: flavor_id } - management_network_name: { get_input: private_net } - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - name: { concat: [ { get_input: location_prefix }, 'cnsl01' ] } - userdata: - concat: - - { get_input: vm_init_cnsl_00 } - - { get_input: datacenter } - - |+ - - - { get_input: vm_init_cnsl_01 } - relationships: - - type: cloudify.openstack.server_connected_to_port - target: fixedip_cnsl01 - - type: cloudify.openstack.server_connected_to_security_group - target: security_group - - type: cloudify.openstack.server_connected_to_floating_ip - target: floatingip_cnsl01 - - type: cloudify.openstack.server_connected_to_keypair - target: key_pair - - type: cloudify.relationships.depends_on - target: dns_cnsl01 - fixedip_cnsl02: - type: cloudify.openstack.nodes.Port - properties: - port: - extra_dhcp_opts: - - opt_name: 'domain-name' - opt_value: { get_input: location_domain } - openstack_config: *open_conf - relationships: - - type: cloudify.relationships.contained_in - target: private_net - floatingip_cnsl02: - type: cloudify.openstack.nodes.FloatingIP - properties: - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - floating_network_name: { get_input: public_net } - dns_cnsl02: - type: ccsdk.nodes.dns.arecord - properties: - fqdn: { concat: [ { get_input: location_prefix }, 'cnsl02.', { get_input: location_domain } ] } - openstack: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - ip_addresses: - - { get_attribute: [ floatingip_cnsl02, floating_ip_address ] } - relationships: - - type: cloudify.relationships.depends_on - target: floatingip_cnsl02 - dns_cluster: - type: ccsdk.nodes.dns.arecord - properties: - fqdn: { concat: [ 'dcae-cnsl.', { get_input: location_domain } ] } - openstack: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - ip_addresses: - - { get_attribute: [ floatingip_cnsl00, floating_ip_address ] } - - { get_attribute: [ floatingip_cnsl01, floating_ip_address ] } - - { get_attribute: [ floatingip_cnsl02, floating_ip_address ] } - - relationships: - - type: cloudify.relationships.depends_on - target: floatingip_cnsl00 - - type: cloudify.relationships.depends_on - target: floatingip_cnsl01 - - type: cloudify.relationships.depends_on - target: floatingip_cnsl02 - host_cnsl02: - type: cloudify.openstack.nodes.Server - properties: - install_agent: false - image: { get_input: ubuntu1604image_id } - flavor: { get_input: flavor_id } - management_network_name: { get_input: private_net } - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - name: { concat: [ { get_input: location_prefix }, 'cnsl02' ] } - userdata: - concat: - - { get_input: vm_init_cnsl_00 } - - { get_input: datacenter } - - |+ - - - { get_input: vm_init_cnsl_01 } - relationships: - - type: cloudify.openstack.server_connected_to_port - target: fixedip_cnsl02 - - type: cloudify.openstack.server_connected_to_security_group - target: security_group - - type: cloudify.openstack.server_connected_to_floating_ip - target: floatingip_cnsl02 - - type: cloudify.openstack.server_connected_to_keypair - target: key_pair - - type: cloudify.relationships.depends_on - target: dns_cnsl02 - -outputs: - public_ip: - value: { get_attribute: [floatingip_cnsl00, floating_ip_address] } diff --git a/blueprints/heartbeat-service.yaml-template b/blueprints/heartbeat-service.yaml-template deleted file mode 100644 index 2654c71..0000000 --- a/blueprints/heartbeat-service.yaml-template +++ /dev/null @@ -1,61 +0,0 @@ -tosca_definitions_version: cloudify_dsl_1_3 -imports: -- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml" -- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml" -inputs: - dcae_CL_publish_url: - type: string - default: "http://10.0.11.1:3904/events/unauthenticated.DCAE_CL_OUTPUT" - ves_heartbeat_url: - type: string - default: "http://10.0.11.1:3904/events/unauthenticated.SEC_HEARTBEAT_OUTPUT" - docker_host_override: - type: string - default: "component_dockerhost" - dh_location_id: - type: string - default: "zone1" - tag_version: - type: string - default: "nexus3.onap.org:10001/onap/org.onap.dcaegen2.platform.heartbeat:2.0" - -node_templates: - docker_service_host: - type: dcae.nodes.SelectedDockerHost - properties: - docker_host_override: - get_input: docker_host_override - location_id: - get_input: dh_location_id - heartbeatService: - type: dcae.nodes.DockerContainerForComponentsUsingDmaap - properties: - application_config: - heartbeat_config: '{"vnfs":[{"heartbeatcountmissed":3, "heartbeatinterval": 60, "closedLoopControlName":"ControlLoopEvent1"},{"heartbeatcountmissed":3, "heartbeatinterval": 60, "closedLoopControlName":"ControlLoopEvent1"},{"heartbeatcountmissed":3, "heartbeatinterval": 60, "closedLoopControlName":"ControlLoopEvent1"}]}' - streams_publishes: - dcae_cl_out: - dmaap_info: - topic_url: - get_input: dcae_CL_publish_url - type: message_router - streams_subscribes: - heartbeat_input: - dmaap_info: - topic_url: - get_input: ves_heartbeat_url - type: message_router - docker_config: - healthcheck: - script: /app/bin/check_health.py - interval: 18s - timeout: 30s - type: docker - image: - get_input: tag_version - location_id: - get_input: dh_location_id - service_component_type: dcaegen2-services-heartbeat - relationships: - - target: docker_service_host - type: dcae.relationships.component_contained_in - diff --git a/blueprints/holmes-engine.yaml-template b/blueprints/holmes-engine.yaml-template deleted file mode 100644 index 4661299..0000000 --- a/blueprints/holmes-engine.yaml-template +++ /dev/null @@ -1,98 +0,0 @@ -tosca_definitions_version: cloudify_dsl_1_3 -imports: -- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml" -- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dcaepolicyplugin/1/dcaepolicyplugin_types.yaml" -- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml" -- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/1.1.0/pgaas_types.yaml" -inputs: - dcae_CL_publish_url: - type: string - default: "http://10.0.11.1:3904/events/unauthenticated.DCAE_CL_OUTPUT" - ves_fault_publish_url: - type: string - default: "http://10.0.11.1:3904/events/unauthenticated.SEC_FAULT_OUTPUT" - docker_host_override: - type: string - default: "component_dockerhost" - dh_location_id: - type: string - default: "zone1" - msb_hostname: - type: string - default: "" - location_domain: - type: string - location_prefix: - type: string - pgaas_cluster_name: - type: string - # use the single-VM PG instance - default: pgvm - database_name: - type: string - default: holmes -node_templates: - pgaasvm: - type: dcae.nodes.pgaas.database - properties: - writerfqdn: { concat: [ { get_input: location_prefix }, '-', { get_input: pgaas_cluster_name }, '-write.', { get_input: location_domain } ] } - name: { get_input: database_name } - use_existing: true - docker_holmes_host: - type: dcae.nodes.SelectedDockerHost - properties: - docker_host_override: - get_input: docker_host_override - location_id: - get_input: dh_location_id - holmesengine: - type: dcae.nodes.DockerContainerForComponentsUsingDmaap - interfaces: - cloudify.interfaces.lifecycle: - start: - inputs: - envs: - URL_JDBC: - { get_attribute: [ pgaasvm, admin, host ] } - JDBC_PASSWORD: - { get_attribute: [ pgaasvm, admin, password ] } - JDBC_USERNAME: - { get_attribute: [ pgaasvm, admin, user ] } - MSB_ADDR: - get_input: msb_hostname - properties: - application_config: - msb.hostname: - get_input: msb_hostname - msb.uri: /api/microservices/v1/services - services_calls: {} - streams_publishes: - dcae_cl_out: - dmaap_info: - topic_url: - get_input: dcae_CL_publish_url - type: message_router - streams_subscribes: - ves_fault: - dmaap_info: - topic_url: - get_input: ves_fault_publish_url - type: message_router - docker_config: - healthcheck: - endpoint: /api/holmes-engine-mgmt/v1/healthcheck - interval: 15s - timeout: 1s - type: http - ports: - - 9102:9102 - image: "{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/holmes/engine-management:v1.0.0" - location_id: - get_input: dh_location_id - service_component_type: dcae-analytics-holmes-engine-management - relationships: - - type: cloudify.relationships.depends_on - target: pgaasvm - - target: docker_holmes_host - type: dcae.relationships.component_contained_in - diff --git a/blueprints/holmes-rules.yaml-template b/blueprints/holmes-rules.yaml-template deleted file mode 100644 index dc0ab7d..0000000 --- a/blueprints/holmes-rules.yaml-template +++ /dev/null @@ -1,81 +0,0 @@ -tosca_definitions_version: cloudify_dsl_1_3 -imports: -- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml" -- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dcaepolicyplugin/1/dcaepolicyplugin_types.yaml" -- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml" -- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/1.1.0/pgaas_types.yaml" -inputs: - docker_host_override: - type: string - default: "component_dockerhost" - dh_location_id: - type: string - default: "zone1" - msb_hostname: - type: string - default: "" - location_domain: - type: string - location_prefix: - type: string - pgaas_cluster_name: - type: string - # use the single-VM PG instance - default: pgvm - database_name: - type: string - default: holmes -node_templates: - pgaasvm: - type: dcae.nodes.pgaas.database - properties: - writerfqdn: { concat: [ { get_input: location_prefix }, '-', { get_input: pgaas_cluster_name }, '-write.', { get_input: location_domain } ] } - name: { get_input: database_name } - docker_holmes_host: - type: dcae.nodes.SelectedDockerHost - properties: - docker_host_override: - get_input: docker_host_override - location_id: - get_input: dh_location_id - holmesrules: - type: dcae.nodes.DockerContainerForComponentsUsingDmaap - interfaces: - cloudify.interfaces.lifecycle: - start: - inputs: - envs: - URL_JDBC: - { get_attribute: [ pgaasvm, admin, host ] } - JDBC_PASSWORD: - { get_attribute: [ pgaasvm, admin, password ] } - JDBC_USERNAME: - { get_attribute: [ pgaasvm, admin, user ] } - MSB_ADDR: - get_input: msb_hostname - properties: - application_config: - holmes.default.rule.volte.scenario1: "ControlLoop-VOLTE-2179b738-fd36-4843-a71a-a8c24c70c55b$$$package org.onap.holmes.droolsRule;\n\nimport org.onap.holmes.common.dmaap.DmaapService;\nimport org.onap.holmes.common.api.stat.VesAlarm;\nimport org.onap.holmes.common.aai.CorrelationUtil;\nimport org.onap.holmes.common.dmaap.entity.PolicyMsg;\nimport org.onap.holmes.common.dropwizard.ioc.utils.ServiceLocatorHolder;\nimport org.onap.holmes.common.utils.DroolsLog;\n \n\nrule \"Relation_analysis_Rule\"\nsalience 200\nno-loop true\n when\n $root : VesAlarm(alarmIsCleared == 0,\n $sourceId: sourceId, sourceId != null && !sourceId.equals(\"\"),\n\t\t\t$sourceName: sourceName, sourceName != null && !sourceName.equals(\"\"),\n\t\t\t$startEpochMicrosec: startEpochMicrosec,\n eventName in (\"Fault_MultiCloud_VMFailure\"),\n $eventId: eventId)\n $child : VesAlarm( eventId != $eventId, parentId == null,\n CorrelationUtil.getInstance().isTopologicallyRelated(sourceId, $sourceId, $sourceName),\n eventName in (\"Fault_MME_eNodeB out of service alarm\"),\n startEpochMicrosec < $startEpochMicrosec + 60000 && startEpochMicrosec > $startEpochMicrosec - 60000 )\n then\n\t\tDroolsLog.printInfo(\"===========================================================\");\n\t\tDroolsLog.printInfo(\"Relation_analysis_Rule: rootId=\" + $root.getEventId() + \", childId=\" + $child.getEventId());\n\t\t$child.setParentId($root.getEventId());\n\t\tupdate($child);\n\t\t\nend\n\nrule \"root_has_child_handle_Rule\"\nsalience 150\nno-loop true\n\twhen\n\t\t$root : VesAlarm(alarmIsCleared == 0, rootFlag == 0, $eventId: eventId)\n\t\t$child : VesAlarm(eventId != $eventId, parentId == $eventId)\n\tthen\n\t\tDroolsLog.printInfo(\"===========================================================\");\n\t\tDroolsLog.printInfo(\"root_has_child_handle_Rule: rootId=\" + $root.getEventId() + \", childId=\" + $child.getEventId());\n\t\tDmaapService dmaapService = ServiceLocatorHolder.getLocator().getService(DmaapService.class);\n\t\tPolicyMsg policyMsg = dmaapService.getPolicyMsg($root, $child, \"org.onap.holmes.droolsRule\");\n dmaapService.publishPolicyMsg(policyMsg, \"unauthenticated.DCAE_CL_OUTPUT\");\n\t\t$root.setRootFlag(1);\n\t\tupdate($root);\nend\n\nrule \"root_no_child_handle_Rule\"\nsalience 100\nno-loop true\n when\n $root : VesAlarm(alarmIsCleared == 0, rootFlag == 0,\n sourceId != null && !sourceId.equals(\"\"),\n\t\t\tsourceName != null && !sourceName.equals(\"\"),\n eventName in (\"Fault_MultiCloud_VMFailure\"))\n then\n\t\tDroolsLog.printInfo(\"===========================================================\");\n\t\tDroolsLog.printInfo(\"root_no_child_handle_Rule: rootId=\" + $root.getEventId());\n\t\tDmaapService dmaapService = ServiceLocatorHolder.getLocator().getService(DmaapService.class);\n\t\tPolicyMsg policyMsg = dmaapService.getPolicyMsg($root, null, \"org.onap.holmes.droolsRule\");\n dmaapService.publishPolicyMsg(policyMsg, \"unauthenticated.DCAE_CL_OUTPUT\");\n\t\t$root.setRootFlag(1);\n\t\tupdate($root);\nend\n\nrule \"root_cleared_handle_Rule\"\nsalience 100\nno-loop true\n when\n $root : VesAlarm(alarmIsCleared == 1, rootFlag == 1)\n then\n\t\tDroolsLog.printInfo(\"===========================================================\");\n\t\tDroolsLog.printInfo(\"root_cleared_handle_Rule: rootId=\" + $root.getEventId());\n\t\tDmaapService dmaapService = ServiceLocatorHolder.getLocator().getService(DmaapService.class);\n\t\tPolicyMsg policyMsg = dmaapService.getPolicyMsg($root, null, \"org.onap.holmes.droolsRule\");\n dmaapService.publishPolicyMsg(policyMsg, \"unauthenticated.DCAE_CL_OUTPUT\");\n\t\tretract($root);\nend\n\nrule \"child_handle_Rule\"\nsalience 100\nno-loop true\n when\n $child : VesAlarm(alarmIsCleared == 1, rootFlag == 0)\n then\n\t\tDroolsLog.printInfo(\"===========================================================\");\n\t\tDroolsLog.printInfo(\"child_handle_Rule: childId=\" + $child.getEventId());\n\t\tretract($child);\nend" - msb.hostname: - get_input: msb_hostname - msb.uri: /api/microservices/v1/services - services_calls: {} - streams_publishes: {} - streams_subscribes: {} - docker_config: - healthcheck: - endpoint: /api/holmes-rule-mgmt/v1/healthcheck - interval: 15s - timeout: 1s - type: http - ports: - - 9101:9101 - image: "{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/holmes/rule-management:v1.0.0" - location_id: - get_input: dh_location_id - service_component_type: dcae-analytics-holmes-rule-management - relationships: - - type: cloudify.relationships.depends_on - target: pgaasvm - - target: docker_holmes_host - type: dcae.relationships.component_contained_in diff --git a/blueprints/inventory.yaml-template b/blueprints/inventory.yaml-template deleted file mode 100644 index c427f8c..0000000 --- a/blueprints/inventory.yaml-template +++ /dev/null @@ -1,196 +0,0 @@ -# -*- indent-tabs-mode: nil -*- # vi: set expandtab: -# -# ============LICENSE_START==================================================== -# org.onap.dcae -# ============================================================================= -# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. -# ============================================================================= -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END====================================================== - -tosca_definitions_version: cloudify_dsl_1_3 - -description: > - This blueprint is used to install and to uninstall DCAE inventory and DCAE service change - handler which are platform services. These applications are Docker containers. This blueprint - depends upon the deployment of a Docker host and the deployment of a central postgres that is - registered with Consul. - -imports: - - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml - -inputs: - - location_id: - description: Location of where to deploy to - - docker_host_override: - description: Target docker host to deploy applications to - sdc_address: - description: SDC host - sdc_uri: - description: SDC url - sdc_msg_bus_address: - description: Message router hostname that SDC will send distribution events through - sdc_user: - description: SDC username - sdc_password: - description: SDC password - sdc_environment_name: - description: SDC environment name - sdc_use_secure_https: - description: Boolean to toggle whether to do certificate validation for https calls to SDC API - type: boolean - default: false - sdc_use_https_dmaap: - description: Boolean to toggle whether to use https for calls to message router API - type: boolean - default: false - - postgres_user_inventory: - description: Postgres user for inventory - postgres_password_inventory: - description: Postgres password for inventory - - service_change_handler_image: - description: Full uri to service change handler Docker image - inventory_image: - description: Full uri to inventory Docker image - -node_templates: - - service-change-handler: - type: dcae.nodes.DockerContainerForPlatforms - properties: - name: - "service-change-handler" - application_config: - asdcDistributionClient: - asdcAddress: { get_input: sdc_address } - asdcUri: { get_input: sdc_uri } - msgBusAddress: { get_input: sdc_msg_bus_address } - user: { get_input: sdc_user } - password: { get_input: sdc_password } - pollingInterval: 20 - pollingTimeout: 20 - consumerGroup: dcae - consumerId: dcae-sch - environmentName: { get_input: sdc_environment_name } - keyStorePath: - keyStorePassword: - activateServerTLSAuth: { get_input: sdc_use_secure_https } - useHttpsWithDmaap: { get_input: sdc_use_https_dmaap } - isFilterInEmptyResources: false - dcaeInventoryClient: - uri: http://inventory:8080 - docker_config: - healthcheck: - type: "docker" - interval: "30s" - timeout: "3s" - script: "/opt/health.sh" - image: - { get_input: service_change_handler_image } - relationships: - - type: cloudify.relationships.depends_on - target: inventory - - type: dcae.relationships.component_contained_in - target: docker_host - - inventory: - type: dcae.nodes.DockerContainerForPlatforms - properties: - name: - "inventory" - application_config: - database: - driverClass: org.postgresql.Driver - user: { get_input: postgres_user_inventory } - password: { get_input: postgres_password_inventory } - # NOTE: The database name here has been changed to the default "postgres" database - # to use the private postgres instance and not the central postgres database. - url: jdbc:postgresql://pstg-write:5432/postgres - properties: - charSet: UTF-8 - maxWaitForConnection: 1s - validationQuery: "/* MyService Health Check */ SELECT 1" - minSize: 2 - maxSize: 8 - initialSize: 2 - checkConnectionWhileIdle: false - evictionInterval: 10s - minIdleTime: 1 minute - databusControllerConnection: - host: databus-controller-hostname - port: 8443 - mechId: - password: - required: false - httpClient: - minThreads: 1 - maxThreads: 128 - gzipEnabled: false - gzipEnabledForRequests: false - timeout: 5000milliseconds - connectionTimeout: 5000milliseconds - docker_config: - healthcheck: - type: "http" - interval: "30s" - timeout: "3s" - endpoint: "/dcae-service-types" - image: - { get_input: inventory_image } - host_port: - 8080 - container_port: - 8080 - relationships: - - type: dcae.relationships.component_contained_in - target: docker_host - - type: cloudify.relationships.depends_on - target: postgres - - postgres: - type: dcae.nodes.DockerContainer - properties: - name: - "pstg-write" - image: - "postgres:9.5.2" - relationships: - - type: dcae.relationships.component_contained_in - target: docker_host - interfaces: - cloudify.interfaces.lifecycle: - start: - inputs: - envs: - PGDATA: - "/var/lib/postgresql/data/pgdata" - POSTGRES_PASSWORD: - { get_input: postgres_password_inventory } - SERVICE_NAME: - "pstg-write" - ports: - - "5432:5432" - - docker_host: - type: dcae.nodes.SelectedDockerHost - properties: - location_id: - { get_input: location_id } - docker_host_override: - { get_input: docker_host_override } diff --git a/blueprints/k8s-config_binding_service.yaml-template b/blueprints/k8s-config_binding_service.yaml-template deleted file mode 100644 index 1822025..0000000 --- a/blueprints/k8s-config_binding_service.yaml-template +++ /dev/null @@ -1,53 +0,0 @@ -# -*- indent-tabs-mode: nil -*- # vi: set expandtab: -# -# ============LICENSE_START==================================================== -# ============================================================================= -# Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved. -# ============================================================================= -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END====================================================== - -tosca_definitions_version: cloudify_dsl_1_3 - -description: > - This blueprint installs the config binding service - -imports: - - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/k8splugin/1.4.5/k8splugin_types.yaml - -inputs: - - cbs_image: - description: Docker image for config binding service - default: {{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/org.onap.dcaegen2.platform.configbinding.app-app:2.2.3 - replicas: - description: Number of instances to launch - type: integer - default: 1 - -node_templates: - # Config binding service - service-config-binding: - type: dcae.nodes.ContainerizedPlatformComponent - properties: - name: 'config-binding-service' - container_port: 10000 - image: { get_input: cbs_image } - docker_config: - healthcheck: - type: "http" - endpoint: "/healthcheck" - replicas: {get_input: replicas} - log_info: - log_directory: "/opt/logs" diff --git a/blueprints/k8s-dashboard.yaml-template b/blueprints/k8s-dashboard.yaml-template new file mode 100644 index 0000000..80a6bcc --- /dev/null +++ b/blueprints/k8s-dashboard.yaml-template @@ -0,0 +1,114 @@ +# +# ============LICENSE_START==================================================== +# org.onap.dcae +# ============================================================================= +# Copyright (c) 2019 AT&T Intellectual Property. All rights reserved. +# ============================================================================= +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END====================================================== + +tosca_definitions_version: cloudify_dsl_1_3 + +imports: +- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/k8splugin/1.4.5/k8splugin_types.yaml" +- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/1.1.0/pgaas_types.yaml" +inputs: + database_cluster_name: + type: string + default: 'dcae-pg-primary.onap' + database_cluster_fqdn: + type: string + default: 'dcae-pg-primary.onap.svc.cluster.local' + database_name: + type: string + default: 'dashboard_pg' + postgres_port: + description: 'Postgres port for dashboard' + default: '5432' + dashboard_docker_image: + description: 'Docker image for dashboard' + default: 'nexus3.onap.org:10001/onap/org.onap.ccsdk.dashboard.ccsdk-app-os:1.1.0-SNAPSHOT-latest' + cloudify_ip: + type: string + default: 'dcae-cloudify-manager' + cloudify_user: + type: string + default: 'admin' + cloudify_password: + type: string + default: 'admin' + consul_url: + type: string + default: 'consul-server.onap.svc.cluster.local' + external_port: + type: string + description: Kubernetes node port for standard http + default: "30418" + external_tls_port: + type: string + description: Kubernetes node port for standard https + default: "30419" + replicas: + type: integer + description: number of instances + default: 1 +node_templates: + pgaasdb: + type: dcae.nodes.pgaas.database + properties: + writerfqdn: { get_input: database_cluster_name } + name: { get_input: database_name } + dashboard_deployment: + type: dcae.nodes.ContainerizedPlatformComponent + interfaces: + cloudify.interfaces.lifecycle: + start: + inputs: + envs: + postgres_ip: + { get_input: database_cluster_fqdn } + postgres_db_name: + { get_input: database_name } + postgres_password_dashboard: + { get_attribute: [ pgaasdb, admin, password ] } + postgres_user_dashboard: + { get_attribute: [ pgaasdb, admin, user ] } + postgres_port: { get_input: postgres_port } + cloudify_user: { get_input: cloudify_user } + cloudify_password: { get_input: cloudify_password } + consul_url: http://consul-server.onap.svc.cluster.local + #consul_url: concat: ["http://", { get_input: consul_url }] + cfy_url: http://dcae-cloudify-manager:8080 + #cfy_url: concat: ["http://", { get_input: cloudify_ip },":8080"] + inventory_url: http://inventory:8080 + dhandler_url: https://deployment-handler:8443 + ports: + - concat: ["8080:", { get_input: external_port }] + - concat: ["8443:", { get_input: external_tls_port }] + properties: + name: + "dcae-dashboard" + image: + { get_input: dashboard_docker_image } + replicas: {get_input: replicas} + dns_name: 'dcae-dashboard' + docker_config: + healthcheck: + endpoint: /ccsdk-app/health + interval: 15s + timeout: 1s + type: http + relationships: + - type: cloudify.relationships.depends_on + target: pgaasdb + diff --git a/blueprints/k8s-deployment_handler.yaml-template b/blueprints/k8s-deployment_handler.yaml-template deleted file mode 100644 index c28a4d4..0000000 --- a/blueprints/k8s-deployment_handler.yaml-template +++ /dev/null @@ -1,87 +0,0 @@ -# -*- indent-tabs-mode: nil -*- # vi: set expandtab: -# -# ============LICENSE_START========================================== -# org.onap.dcae -# =================================================================== -# Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. -# =================================================================== -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END============================================ - -tosca_definitions_version: cloudify_dsl_1_3 - -description: > - This blueprint deploys/manages the DCAE deployment handler as a Docker container - -imports: - - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/k8splugin/1.4.5/k8splugin_types.yaml - -inputs: - - deployment_handler_image: - description: Docker image for deployment handler - default: {{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/org.onap.dcaegen2.platform.deployment-handler:3.2.0 - application_config: - description: deployment handler application configuration (to override defaults) - default: {} - host_port: - description: port on Kubernetes host where DH API will be exposed - default: 0 - host_log_root: - description: root directory for logs in the Docker host file system - default: '/opt/onap/log' - -node_templates: - - # Deployment Handler - deployment-handler: - type: dcae.nodes.ContainerizedPlatformComponent - properties: - name: - 'deployment_handler' - dns_name: - 'deployment-handler' - image: - { get_input: deployment_handler_image } - application_config: - { get_input: application_config } - host_port: - { get_input: host_port } - container_port: - 8443 - docker_config: - healthcheck: - type: 'https' - interval: '300s' - timeout: '5s' - endpoint: '/' - msb_registration: - port: '8443' - url_path: '/' - version: 'v4' - log_info: - log_directory: '/opt/app/dh/log' - tls_info: - cert_directory: '/opt/app/dh/etc/cert/' - use_tls: true - # Inject CM password through environment variable - # so that it does not appear in Consul - interfaces: - cloudify.interfaces.lifecycle: - start: - inputs: - envs: - CLOUDIFY_PASSWORD: { get_secret: cmpass } - CLOUDIFY_USER: admin - diff --git a/blueprints/k8s-helm-override.yaml-template b/blueprints/k8s-helm-override.yaml-template new file mode 100644 index 0000000..31213d2 --- /dev/null +++ b/blueprints/k8s-helm-override.yaml-template @@ -0,0 +1,75 @@ +# ============LICENSE_START========================================== +# =================================================================== +# Copyright (c) 2019 AT&T +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#============LICENSE_END============================================ +tosca_definitions_version: cloudify_dsl_1_3 + +imports: + - http://www.getcloudify.org/spec/cloudify/4.3.1/types.yaml + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/helm/4.0.0/helm-type.yaml" + +inputs: + tiller-server-ip: + description: IP address of Kubernetes master node + tiller-server-port: + description: Nodeport of tiller server + namespace: + description: Target namespace to be installed under (requires to be new) + chart-repo-url: + default: https://nexus.onap.org/content/sites/oom-helm-staging + chart-version : + description: Chart version for identified component-name + stable-repo-url: + description: URL for stable repository + type: string + default: 'https://kubernetes-charts.storage.googleapis.com' + config-url: + default: '' + config-format: + default: 'yaml' + component-name: + description: onap component name +node_templates: + onap_env: + type: onap.nodes.component + properties: + tiller-server-ip: { get_input: tiller-server-ip } + tiller-server-port: { get_input: tiller-server-port } + component-name: onap + chart-repo-url: { get_input: chart-repo-url } + chart-version: { get_input: chart-version } + namespace: { get_input: namespace } + stable-repo-url: { get_input: stable-repo-url} + config: '{ "aaf": {"enabled": false}, "aai": {"enabled": false}, "appc": {"enabled": false}, "clamp": {"enabled": false}, "cli": {"enabled": false}, "consul": {"enabled": false}, "dcaegen2": {"enabled": false}, "dmaap": {"enabled": false}, "esr": {"enabled": false}, "log": {"enabled": false}, "sniro-emulator": {"enabled": false}, "msb": {"enabled": false}, "multicloud": {"enabled": false}, "nbi": {"enabled": false}, "oof": {"enabled": false}, "policy": {"enabled": false}, "pomba": {"enabled": false}, "portal": {"enabled": false}, "robot": {"enabled": false}, "sdc": {"enabled": false}, "sdnc": {"enabled": false}, "so": {"enabled": false}, "uui": {"enabled": false}, "vfc": {"enabled": false}, "vid": {"enabled": false}, "vnfsdk": {"enabled": false} }' + + dcaecomponent: + type: onap.nodes.component + properties: + tiller-server-ip: { get_input: tiller-server-ip } + tiller-server-port: { get_input: tiller-server-port } + component-name: { get_input: component-name } + chart-repo-url: { get_input: chart-repo-url } + chart-version: { get_input: chart-version } + namespace: { get_input: namespace } + stable-repo-url: { get_input: stable-repo-url} + config-url: { get_input: config-url} + config-format: { get_input: config-format} + relationships: + - type: cloudify.relationships.connected_to + target: onap_env +outputs: + dcaecomponent_install_status: + value: { get_attribute: [ dcaecomponent, install-status ] } + diff --git a/blueprints/k8s-helm.yaml-template b/blueprints/k8s-helm.yaml-template new file mode 100644 index 0000000..d2562e0 --- /dev/null +++ b/blueprints/k8s-helm.yaml-template @@ -0,0 +1,60 @@ +# ============LICENSE_START========================================== +# =================================================================== +# Copyright (c) 2019 AT&T +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#============LICENSE_END============================================ +tosca_definitions_version: cloudify_dsl_1_3 + +imports: + - http://www.getcloudify.org/spec/cloudify/4.3.1/types.yaml + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/helm/4.0.0/helm-type.yaml" + +inputs: + tiller-server-ip: + description: IP address of Kubernetes master node + tiller-server-port: + description: Nodeport of tiller server + namespace: + description: Target namespace to be installed under (requires to be new) + chart-repo-url: + default: https://nexus.onap.org/content/sites/oom-helm-staging + chart-version : + description: Chart version for identified component-name + stable-repo-url: + description: URL for stable repository + type: string + default: 'https://kubernetes-charts.storage.googleapis.com' + config-url: + default: '' + config-format: + default: 'yaml' + component-name: + description: onap component name +node_templates: + dcaecomponent: + type: onap.nodes.component + properties: + tiller-server-ip: { get_input: tiller-server-ip } + tiller-server-port: { get_input: tiller-server-port } + component-name: { get_input: component-name } + chart-repo-url: { get_input: chart-repo-url } + chart-version: { get_input: chart-version } + namespace: { get_input: namespace } + stable-repo-url: { get_input: stable-repo-url} + config-url: { get_input: config-url} + config-format: { get_input: config-format} +outputs: + dcaecomponent_install_status: + value: { get_attribute: [ dcaecomponent, install-status ] } + diff --git a/blueprints/k8s-inventory.yaml-template b/blueprints/k8s-inventory.yaml-template deleted file mode 100644 index 499cdd5..0000000 --- a/blueprints/k8s-inventory.yaml-template +++ /dev/null @@ -1,180 +0,0 @@ -# -*- indent-tabs-mode: nil -*- # vi: set expandtab: -# -# ============LICENSE_START==================================================== -# org.onap.dcae -# ============================================================================= -# Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved. -# ============================================================================= -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END====================================================== - -tosca_definitions_version: cloudify_dsl_1_3 - -description: > - This blueprint is used to install and to uninstall DCAE inventory and DCAE service change - handler which are platform services. These applications are Docker containers. This blueprint - depends upon the deployment of a Docker host and the deployment of a central postgres that is - registered with Consul. - -imports: - - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/k8splugin/1.4.5/k8splugin_types.yaml - -inputs: - - sdc_address: - description: SDC host - sdc_uri: - description: SDC url - sdc_msg_bus_address: - description: Message router hostname that SDC will send distribution events through - sdc_user: - description: SDC username - sdc_password: - description: SDC password - sdc_environment_name: - description: SDC environment name - sdc_use_secure_https: - description: Boolean to toggle whether to do certificate validation for https calls to SDC API - type: boolean - default: false - sdc_use_https_dmaap: - description: Boolean to toggle whether to use https for calls to message router API - type: boolean - default: false - - postgres_user_inventory: - description: Postgres user for inventory - postgres_password_inventory: - description: Postgres password for inventory - - service_change_handler_image: - description: Full uri to service change handler Docker image - default: "{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/org.onap.dcaegen2.platform.servicechange-handler:1.1.5" - inventory_image: - description: Full uri to inventory Docker image - default: "{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/org.onap.dcaegen2.platform.inventory-api:3.0.1" - -node_templates: - - service-change-handler: - type: dcae.nodes.ContainerizedPlatformComponent - properties: - name: - "service-change-handler" - application_config: - asdcDistributionClient: - asdcAddress: { get_input: sdc_address } - asdcUri: { get_input: sdc_uri } - msgBusAddress: { get_input: sdc_msg_bus_address } - user: { get_input: sdc_user } - password: { get_input: sdc_password } - pollingInterval: 20 - pollingTimeout: 20 - consumerGroup: dcae - consumerId: dcae-sch - environmentName: { get_input: sdc_environment_name } - keyStorePath: - keyStorePassword: - activateServerTLSAuth: { get_input: sdc_use_secure_https } - useHttpsWithDmaap: { get_input: sdc_use_https_dmaap } - isFilterInEmptyResources: false - dcaeInventoryClient: - uri: http://inventory:8080 - docker_config: - healthcheck: - type: "docker" - interval: "30s" - timeout: "3s" - script: "/opt/health.sh" - image: - { get_input: service_change_handler_image } - relationships: - - type: cloudify.relationships.depends_on - target: inventory - - inventory: - type: dcae.nodes.ContainerizedPlatformComponent - properties: - name: - "inventory" - application_config: - database: - driverClass: org.postgresql.Driver - user: { get_input: postgres_user_inventory } - password: { get_input: postgres_password_inventory } - # NOTE: The database name here has been changed to the default "postgres" database - # to use the private postgres instance and not the central postgres database. - url: jdbc:postgresql://pstg-write:5432/postgres - properties: - charSet: UTF-8 - maxWaitForConnection: 1s - validationQuery: "/* MyService Health Check */ SELECT 1" - minSize: 2 - maxSize: 8 - initialSize: 2 - checkConnectionWhileIdle: false - evictionInterval: 10s - minIdleTime: 1 minute - databusControllerConnection: - host: databus-controller-hostname - port: 8443 - mechId: - password: - required: false - httpClient: - minThreads: 1 - maxThreads: 128 - gzipEnabled: false - gzipEnabledForRequests: false - timeout: 5000milliseconds - connectionTimeout: 5000milliseconds - docker_config: - healthcheck: - type: "http" - interval: "30s" - timeout: "3s" - endpoint: "/dcae-service-types" - image: - { get_input: inventory_image } - container_port: - 8080 - relationships: - - type: cloudify.relationships.depends_on - target: postgres - interfaces: - cloudify.interfaces.lifecycle: - start: - inputs: - max_wait: 1800 - - postgres: - type: dcae.nodes.ContainerizedApplication - properties: - name: - "pstg-write" - image: - "postgres:9.5.2" - interfaces: - cloudify.interfaces.lifecycle: - start: - inputs: - envs: - PGDATA: - "/var/lib/postgresql/data/pgdata" - POSTGRES_PASSWORD: - { get_input: postgres_password_inventory } - SERVICE_NAME: - "pstg-write" - ports: - - "5432:0" diff --git a/blueprints/k8s-policy_handler.yaml-template b/blueprints/k8s-policy_handler.yaml-template deleted file mode 100644 index 3b2e071..0000000 --- a/blueprints/k8s-policy_handler.yaml-template +++ /dev/null @@ -1,60 +0,0 @@ -# -*- indent-tabs-mode: nil -*- # vi: set expandtab: -# -# ============LICENSE_START======================================================= -# org.onap.dcae -# ================================================================================ -# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. -# ================================================================================ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END========================================================= - -tosca_definitions_version: cloudify_dsl_1_3 - -description: > - This blueprint deploys/manages the DCAE policy-handler as a Docker container - -imports: - - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/k8splugin/1.4.5/k8splugin_types.yaml - - -inputs: - - policy_handler_image: - description: Docker image for policy_handler - default: '{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/org.onap.dcaegen2.platform.policy-handler:5.0.0' - - application_config: - description: policy handler application configuration - requires info on policy-engine - default: {} - -node_templates: - policy_handler: - type: dcae.nodes.ContainerizedPlatformComponent - properties: - name: 'policy_handler' - dns_name: 'policy-handler' - image: { get_input: policy_handler_image } - application_config: { get_input: application_config } - docker_config: - healthcheck: - type: 'http' - interval: '300s' - timeout: '25s' - endpoint: '/healthcheck' - log_info: - log_directory: '/opt/app/policy_handler/logs' - container_port: 25577 - tls_info: - cert_directory: '/opt/app/policy_handler/etc/tls/certs/' - use_tls: true diff --git a/blueprints/k8s-snmptrap.yaml-template b/blueprints/k8s-snmptrap.yaml-template index 177efd1..6111e32 100644 --- a/blueprints/k8s-snmptrap.yaml-template +++ b/blueprints/k8s-snmptrap.yaml-template @@ -2,7 +2,7 @@ # # ============LICENSE_START==================================================== # ============================================================================= -# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. +# Copyright (c) 2018-2019 AT&T Intellectual Property. All rights reserved. # ============================================================================= # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -73,6 +73,10 @@ inputs: default: title: Collector for receiving SNMP traps and publishing to DMAAP/MR version: 1.4.0 + external_port: + type: string + description: Kubernetes node port on which collector is exposed + default: "30470" replicas: type: integer description: number of instances @@ -85,7 +89,7 @@ node_templates: start: inputs: ports: - - '6162:0' + - concat: ["6162/udp:", { get_input: external_port }] properties: application_config: StormWatchPolicy: '' @@ -108,15 +112,6 @@ node_templates: get_input: sec_fault_unsecure_topic type: message_router -# TBA under DCAEGEN2-796 -# docker_config: -# healthcheck: -# interval: 300s -# script: /opt/app/snmptrap/bin/snmptrapd.sh status -# timeout: 120s -# type: docker -# ports: -# - 6162/udp:162 image: get_input: tag_version replicas: {get_input: replicas} diff --git a/blueprints/k8s-ves.yaml-template b/blueprints/k8s-ves.yaml-template index d29de01..29071f4 100644 --- a/blueprints/k8s-ves.yaml-template +++ b/blueprints/k8s-ves.yaml-template @@ -2,7 +2,7 @@ # # ============LICENSE_START==================================================== # ============================================================================= -# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. +# Copyright (c) 2018-2019 AT&T Intellectual Property. All rights reserved. # ============================================================================= # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -49,6 +49,10 @@ inputs: type: string description: Kubernetes node port on which collector is exposed default: "30235" + external_tls_port: + type: string + description: Kubernetes node port on which collector is exposed for https + default: "30417" replicas: type: integer description: number of instances @@ -61,6 +65,7 @@ node_templates: inputs: ports: - concat: ["8080:", { get_input: external_port }] + - concat: ["8443:", { get_input: external_tls_port }] properties: application_config: collector.dmaap.streamid: fault=ves-fault|syslog=ves-syslog|heartbeat=ves-heartbeat|measurementsForVfScaling=ves-measurement|mobileFlow=ves-mobileflow|other=ves-other|stateChange=ves-statechange|thresholdCrossingAlert=ves-thresholdCrossingAlert|voiceQuality=ves-voicequality|sipSignaling=ves-sipsignaling|notification=ves-notification|pnfRegistration=ves-pnfRegistration diff --git a/blueprints/pgaas-cluster.yaml-template b/blueprints/pgaas-cluster.yaml-template deleted file mode 100644 index d7b0cd0..0000000 --- a/blueprints/pgaas-cluster.yaml-template +++ /dev/null @@ -1,435 +0,0 @@ -# -*- indent-tabs-mode: nil -*- # vi: set expandtab: -# -# ============LICENSE_START==================================================== -# org.onap.dcae -# ============================================================================= -# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. -# ============================================================================= -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END====================================================== - -tosca_definitions_version: cloudify_dsl_1_3 - -description: |- - This blueprint is used to install and to uninstall a central postgres as a platform service. - This blueprint depends upon the deployment of the pgaas_plugin, the PGaaS Cinder volume, and Consul. - This blueprint is part of a suite of three blueprints that allow a PGaaS - cluster to be created that has persistent databases stored in Cinder. - pgaas-disk allocates the cinder volumes. It must be run first. - pgaas-cluster creates the PG service and attaches the cinder volumes. It must be run second. - pgaas-database creates a database. It must be run third, for each persistent database. - If the cluster is uninstalled, the persistent databases are unaffected. - If a database blueprint is uninstalled, the persistent database goes away. - If the disk blueprint is uninstalled, all persistent databases go away, along with the server instance. - -imports: - - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml - - http://www.getcloudify.org/spec/openstack-plugin/1.4/plugin.yaml - - http://www.getcloudify.org/spec/fabric-plugin/1.4.1/plugin.yaml - - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/dnsdesig/dns_types.yaml" - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml" - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/1.1.0/pgaas_types.yaml" - -inputs: - blueprint_version: - type: string - default: '2018-04-27T00:31:38+0000' - - # pgaas-specific info - pgaas_cluster_name: - type: string - default: pgcl - -{{ ONAPTEMPLATE_STANDARD_INPUTS_TYPES }} - - vm_init_pgrs: - type: string - default: | - #!/bin/sh - echo All output will be found in /tmp/ins.out and /tmp/ins.err - exec > /tmp/ins.out 2> /tmp/ins.err - set -x - if [ "$(dnsdomainname 2>/dev/null)" = "" ] - then - echo WARNING WARNING WARNING - echo The DNS DHCP settings did not work properly. - for i in $(seq 20) - do - echo Sleeping... - sleep 10 - if [ "$(dnsdomainname 2>/dev/null)" != "" ] - then break - fi - echo The DNS DHCP settings still did not work properly. - done - if [ "$(dnsdomainname 2>/dev/null)" = "" ] - then - echo Exiting - exit 1 - fi - fi - - CONFDIR=/var/config/DCAE/chef/ - mkdir -p $CONFDIR - - CONF=$CONFDIR/pgaas-postgres.conf - cat < $CONF - master: ${MASTER%%.*} - secondmaster: notused - DRTR_NODE_KSTOREFILE: /opt/app/dcae-certificate/keystore.jks - DRTR_NODE_KSTOREPASS: "No Certificate" - DRTR_NODE_PVTKEYPASS: "No Certificate" - PG_NODES: $PG_NODES - PG_JAVA_HOME : /opt/app/java/jdk/jdk170 - PG_CLUSTER: central - EOF - - apt-get update - - # invoking apt-get separately allows a failure to be ignored - for i in openjdk-7-jdk openjdk-8-jdk python-pip python3-pip curl gawk; do apt-get install -y $i;done - pip install pyyaml - - # prevent servers from starting - echo "exit 101" > /usr/sbin/policy-rc.d; chmod a+x /usr/sbin/policy-rc.d - - # invoking apt-get separately allows a failure to be ignored - for i in postgresql libpq5 repmgr python-psycopg2 python3-psycopg2 libgetopt-java; do apt-get install -y $i; done - - # allow servers to autostart again - rm -f /usr/sbin/policy-rc.d - - ( umask 077; sed 's/^/*:*:*:postgres:/' < /root/.pgrspw > ~postgres/.pgpass; chown postgres:postgres ~postgres/.pgpass ) - - if [ ! -f $CONF ] - then echo "$CONF does not exist" 1>&2; exit 1 - fi - - echo Look in /tmp/pgaas.out for output from installing PGaaS - NEXUS={{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_storage_pgaas_debs_releases }}/debs - for pkg in cdf.deb-1.0.0 pgaas.deb-1.0.0 - do - OUT=/tmp/$pkg - curl -s -k -f -o $OUT $NEXUS/$pkg - dpkg --install $OUT - done - - case $(hostname) in - *00 ) WRITE=-write ;; - *01 ) WRITE= ;; - esac - curl -v -X PUT -H "Content-Type: application/json" "http://${LOCATION_PREFIX}cnsl00.${LOCATION_DOMAIN}:8500/v1/agent/service/register" -d "{\"name\" : \"${CLUSTER_NAME}${WRITE}\", \"Address\" : \"${LOCAL_IP}\", \"Port\" : 5432}" - - echo ALL DONE - -node_templates: - key_pair: - type: cloudify.openstack.nodes.KeyPair - properties: - private_key_path: { get_input: key_filename } - use_external_resource: True - resource_id: { get_input: keypair } - openstack_config: &open_conf - get_input: openstack - private_net: - type: cloudify.openstack.nodes.Network - properties: - use_external_resource: True - resource_id: { get_input: private_net } - openstack_config: *open_conf - security_group: - type: cloudify.openstack.nodes.SecurityGroup - properties: - use_external_resource: True - resource_id: { get_input: security_group } - openstack_config: *open_conf - - fixedip_pgrs00: - type: cloudify.openstack.nodes.Port - properties: - port: - extra_dhcp_opts: - - opt_name: 'domain-name' - opt_value: { get_input: location_domain } - openstack_config: *open_conf - relationships: - - type: cloudify.relationships.contained_in - target: private_net - floatingip_pgrs00: - type: cloudify.openstack.nodes.FloatingIP - properties: - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - floating_network_name: { get_input: public_net } - dns_pgrs00: - type: ccsdk.nodes.dns.arecord - properties: - fqdn: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '00.', { get_input: location_domain } ] } - openstack: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - ip_addresses: - - { get_attribute: [ floatingip_pgrs00, floating_ip_address ] } - relationships: - - type: cloudify.relationships.depends_on - target: floatingip_pgrs00 - host_pgrs00: - type: cloudify.openstack.nodes.Server - properties: - install_agent: false - image: { get_input: ubuntu1604image_id } - flavor: { get_input: flavor_id } - management_network_name: { get_input: private_net } - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - name: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '00' ] } - userdata: - concat: - - |- - #!/bin/sh - mkdir /root/.sshkey - echo ' - - { get_attribute: [ pgaas_cluster, public ] } - - |- - ' >/root/.sshkey/id_rsa.pub - echo ' - - { get_attribute: [ pgaas_cluster, base64private ] } - - |- - ' | base64 -d >/root/.sshkey/id_rsa - chmod 700 /root/.sshkey - chmod 600 /root/.sshkey/* - ( umask 077; echo -n postgres | cat - /root/.sshkey/id_rsa | md5sum | awk '{ print $1 }' > /root/.pgrspw ) - set -x - - "\n" - - "CLUSTER_NAME='" - - { get_input: pgaas_cluster_name } - - "'\n" - - "LOCATION_PREFIX='" - - { get_input: location_prefix } - - "'\n" - - "LOCATION_DOMAIN='" - - { get_input: location_domain } - - "'\n" - - "MASTER='" - - { get_property: [ dns_pgrs00, fqdn ] } - - "'\n" - - "LOCAL_IP='" - - { get_attribute: [ floatingip_pgrs00, floating_ip_address ] } - - "'\n" - - "PG_NODES='" - - { get_property: [ dns_pgrs00, fqdn ] } - - '|' - - { get_property: [ dns_pgrs01, fqdn ] } - - "'\n" - - { get_input: vm_init_pgrs } - relationships: - - type: cloudify.openstack.server_connected_to_port - target: fixedip_pgrs00 - - type: cloudify.openstack.server_connected_to_security_group - target: security_group - - type: cloudify.openstack.server_connected_to_floating_ip - target: floatingip_pgrs00 - - type: cloudify.openstack.server_connected_to_keypair - target: key_pair - - type: cloudify.relationships.depends_on - target: dns_pgrs00 - - type: cloudify.relationships.depends_on - target: pgaas_cluster - fixedip_pgrs01: - type: cloudify.openstack.nodes.Port - properties: - port: - extra_dhcp_opts: - - opt_name: 'domain-name' - opt_value: { get_input: location_domain } - openstack_config: *open_conf - relationships: - - type: cloudify.relationships.contained_in - target: private_net - floatingip_pgrs01: - type: cloudify.openstack.nodes.FloatingIP - properties: - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - floating_network_name: { get_input: public_net } - dns_pgrs01: - type: ccsdk.nodes.dns.arecord - properties: - fqdn: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '01.', { get_input: location_domain } ] } - openstack: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - ip_addresses: - - { get_attribute: [ floatingip_pgrs01, floating_ip_address ] } - relationships: - - type: cloudify.relationships.depends_on - target: floatingip_pgrs01 - host_pgrs01: - type: cloudify.openstack.nodes.Server - properties: - install_agent: false - image: { get_input: ubuntu1604image_id } - flavor: { get_input: flavor_id } - management_network_name: { get_input: private_net } - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - name: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '01' ] } - userdata: - concat: - - |- - #!/bin/sh - mkdir /root/.sshkey - echo ' - - { get_attribute: [ pgaas_cluster, public ] } - - |- - ' >/root/.sshkey/id_rsa.pub - echo ' - - { get_attribute: [ pgaas_cluster, base64private ] } - - |- - ' | base64 -d >/root/.sshkey/id_rsa - chmod 700 /root/.sshkey - chmod 600 /root/.sshkey/* - ( umask 077; echo -n postgres | cat - /root/.sshkey/id_rsa | md5sum | awk '{ print $1 }' > /root/.pgrspw ) - set -x - - "\n" - - "CLUSTER_NAME='" - - { get_input: pgaas_cluster_name } - - "'\n" - - "LOCATION_PREFIX='" - - { get_input: location_prefix } - - "'\n" - - "LOCATION_DOMAIN='" - - { get_input: location_domain } - - "'\n" - - "MASTER='" - - { get_property: [ dns_pgrs00, fqdn ] } - - "'\n" - - "LOCAL_IP='" - - { get_attribute: [ floatingip_pgrs01, floating_ip_address ] } - - "'\n" - - "PG_NODES='" - - { get_property: [ dns_pgrs00, fqdn ] } - - '|' - - { get_property: [ dns_pgrs01, fqdn ] } - - "'\n" - - { get_input: vm_init_pgrs } - relationships: - - type: cloudify.openstack.server_connected_to_port - target: fixedip_pgrs01 - - type: cloudify.openstack.server_connected_to_security_group - target: security_group - - type: cloudify.openstack.server_connected_to_floating_ip - target: floatingip_pgrs01 - - type: cloudify.openstack.server_connected_to_keypair - target: key_pair - - type: cloudify.relationships.depends_on - target: dns_pgrs01 - - type: cloudify.relationships.depends_on - target: pgaas_cluster - - # cinder connections - volume_pgrs00: - type: cloudify.openstack.nodes.Volume - properties: - resource_id: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '00' ] } - openstack_config: *open_conf - use_external_resource: True - relationships: - - type: cloudify.openstack.volume_attached_to_server - target: host_pgrs00 - - volume_pgrs01: - type: cloudify.openstack.nodes.Volume - properties: - resource_id: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '01' ] } - openstack_config: *open_conf - use_external_resource: True - relationships: - - type: cloudify.openstack.volume_attached_to_server - target: host_pgrs01 - - # CNAME records - dns_pgrs_rw: - type: ccsdk.nodes.dns.cnamerecord - properties: - fqdn: { concat: [ { get_input: location_prefix }, '-', { get_input: pgaas_cluster_name }, '-write.', { get_input: location_domain } ] } - openstack: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - cname: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '00.', { get_input: location_domain } ] } - - dns_pgrs_ro: - type: ccsdk.nodes.dns.cnamerecord - properties: - fqdn: { concat: [ { get_input: location_prefix }, '-', { get_input: pgaas_cluster_name }, '.', { get_input: location_domain } ] } - openstack: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - cname: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '00.', { get_input: location_domain } ] } - - # tie to pgaas_plugin database - pgaas_cluster: - type: dcae.nodes.pgaas.cluster - properties: - writerfqdn: { get_property: [ dns_pgrs_rw, fqdn ] } - use_existing: true - relationships: - - type: cloudify.relationships.depends_on - target: dns_pgrs_rw - - type: cloudify.relationships.depends_on - target: dns_pgrs_ro - -outputs: - public_ip00: - value: { get_attribute: [host_pgrs00, ip] } - public_ip01: - value: { get_attribute: [host_pgrs01, ip] } - writerfqdn: - value: { get_property: [ dns_pgrs_rw, fqdn ] } - readerfqdn: - value: { get_property: [ dns_pgrs_ro, fqdn ] } - dns_pgrs00: - value: { get_property: [ dns_pgrs00, fqdn ] } - dns_pgrs01: - value: { get_property: [ dns_pgrs01, fqdn ] } - blueprint_version: - value: { get_input: blueprint_version } diff --git a/blueprints/pgaas-database.yaml-template b/blueprints/pgaas-database.yaml-template deleted file mode 100644 index a89d638..0000000 --- a/blueprints/pgaas-database.yaml-template +++ /dev/null @@ -1,63 +0,0 @@ -# -*- indent-tabs-mode: nil -*- # vi: set expandtab: -# -# ============LICENSE_START==================================================== -# org.onap.dcae -# ============================================================================= -# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. -# ============================================================================= -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END====================================================== - -tosca_definitions_version: cloudify_dsl_1_3 - -description: |- - This blueprint is used to install and to uninstall a persistent database into the central postgres as a platform service. - This blueprint depends upon the deployment of the pgaas_plugin, the PGaaS Cinder volume, the PGaaS service, and Consul. - This blueprint is part of a suite of three blueprints that allow a PGaaS - cluster to be created that has persistent databases stored in Cinder. - pgaas-disk allocates the cinder volumes. It must be run first. - pgaas-cluster creates the PG service and attaches the cinder volumes. It must be run second. - pgaas-database creates a database. It must be run third, for each persistent database. - If the cluster is uninstalled, the persistent databases are unaffected. - If a database blueprint is uninstalled, the persistent database goes away. - If the disk blueprint is uninstalled, all persistent databases go away, along with the server instance. - -imports: - - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml - - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/1.1.0/pgaas_types.yaml" - -inputs: - blueprint_version: - type: string - default: '2018-03-29T14:28:59+0000' - - # pgaas-specific info - pgaas_cluster_name: - type: string - default: pgcl - database_description: - type: string - default: 'This is a sample database' - database_name: - type: string - default: sample - -{{ ONAPTEMPLATE_STANDARD_INPUTS_TYPES }} - -node_templates: - pgaasdbtest: - type: dcae.nodes.pgaas.database - properties: - writerfqdn: { concat: [ { get_input: location_prefix }, '-', { get_input: pgaas_cluster_name }, '-write.', { get_input: location_domain } ] } - name: { get_input: database_name } diff --git a/blueprints/pgaas-disk.yaml-template b/blueprints/pgaas-disk.yaml-template deleted file mode 100644 index 3f96bae..0000000 --- a/blueprints/pgaas-disk.yaml-template +++ /dev/null @@ -1,123 +0,0 @@ -# -*- indent-tabs-mode: nil -*- # vi: set expandtab: -# -# ============LICENSE_START==================================================== -# org.onap.dcae -# ============================================================================= -# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. -# ============================================================================= -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END====================================================== - -tosca_definitions_version: cloudify_dsl_1_3 - -description: |- - This blueprint is used to install and to uninstall the cinder volumes for - a central postgres as a platform service. - This blueprint depends upon the deployment of Consul and the pgaas_plugin. - This blueprint is part of a suite of three blueprints that allow a PGaaS - cluster to be created that has persistent databases stored in Cinder. - pgaas-disk allocates the cinder volumes. It must be run first. - pgaas-cluster creates the PG service and attaches the cinder volumes. It must be run second. - pgaas-database creates a database. It must be run third, for each persistent database. - If the cluster is uninstalled, the persistent databases are unaffected. - If a database blueprint is uninstalled, the persistent database goes away. - If the disk blueprint is uninstalled, all persistent databases go away, along with the server instance. - -imports: - - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml - - http://www.getcloudify.org/spec/openstack-plugin/1.4/plugin.yaml - - http://www.getcloudify.org/spec/fabric-plugin/1.4.1/plugin.yaml - - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/dnsdesig/dns_types.yaml" - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/sshkeyshare/sshkey_types.yaml" - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml" - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/1.1.0/pgaas_types.yaml" - -inputs: - blueprint_version: - type: string - default: '2018-04-27T00:31:38+0000' - - # pgaas-specific info - pgaas_cluster_name: - type: string - default: pgcl - cinder_volume_size: - type: string - default: 300 - -{{ ONAPTEMPLATE_STANDARD_INPUTS_TYPES }} - -node_templates: - key_pair: - type: cloudify.openstack.nodes.KeyPair - properties: - private_key_path: { get_input: key_filename } - use_external_resource: True - resource_id: { get_input: keypair } - openstack_config: &open_conf - get_input: openstack - - sharedsshkey_pgrs: - type: ccsdk.nodes.ssh.keypair - - private_net: - type: cloudify.openstack.nodes.Network - properties: - use_external_resource: True - resource_id: { get_input: private_net } - openstack_config: *open_conf - - security_group: - type: cloudify.openstack.nodes.SecurityGroup - properties: - use_external_resource: True - resource_id: { get_input: security_group } - openstack_config: *open_conf - - volume_pgrs00: - type: cloudify.openstack.nodes.Volume - properties: - resource_id: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '00' ] } - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - size: { get_input: cinder_volume_size } - - volume_pgrs01: - type: cloudify.openstack.nodes.Volume - properties: - resource_id: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '01' ] } - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - size: { get_input: cinder_volume_size } - - pgaas_cluster: - type: dcae.nodes.pgaas.cluster - properties: - writerfqdn: { concat: [ { get_input: location_prefix }, '-', { get_input: pgaas_cluster_name }, '-write.', { get_input: location_domain } ] } - readerfqdn: { concat: [ { get_input: location_prefix }, '-', { get_input: pgaas_cluster_name }, '.', { get_input: location_domain } ] } - relationships: - - type: dcae.relationships.pgaas_cluster_uses_sshkeypair - target: sharedsshkey_pgrs - -outputs: - blueprint_version: - value: { get_input: blueprint_version } diff --git a/blueprints/pgaas-getdbinfo.yaml-template b/blueprints/pgaas-getdbinfo.yaml-template deleted file mode 100644 index 8672f04..0000000 --- a/blueprints/pgaas-getdbinfo.yaml-template +++ /dev/null @@ -1,92 +0,0 @@ -# -*- indent-tabs-mode: nil -*- # vi: set expandtab: -# -# ============LICENSE_START==================================================== -# org.onap.dcae -# ============================================================================= -# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. -# ============================================================================= -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END====================================================== - -tosca_definitions_version: cloudify_dsl_1_3 - -description: |- - This blueprint is an example of how an application can access the needed information about - a persistent database created as part of a PGaaS cluster. - - For a given database "dbname" on a given PGaaS cluster "PGCLUSTERNAME", - there are three roles created: - admin role: has complete administrative control over that database - user role: has complete read and write access on that database - viewer role: only has read access on that database - The various attributes will return the appropriate information - that can be used with that role: host fqdn, role name and password. - -imports: - - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml - - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/1.1.0/pgaas_types.yaml" - -inputs: - location_domain: - type: string - location_prefix: - type: string - pgaas_cluster_name: - type: string - default: pgcl - database_name: - type: string - default: sample - -node_templates: - pgclustername_dbname: - type: dcae.nodes.pgaas.database - properties: - writerfqdn: { concat: [ { get_input: location_prefix }, '-', { get_input: pgaas_cluster_name }, '-write.', { get_input: location_domain } ] } - name: { get_input: database_name } - use_existing: true - -outputs: - # admin role has control over table/index/view creation/dropping - pgclustername_dbname_admin_host: - description: Hostname for PGCLUSTERNAME dbname database - value: { get_attribute: [ pgclustername_dbname, admin, host ] } - pgclustername_dbname_admin_user: - description: Admin Username for PGCLUSTERNAME dbname database - value: { get_attribute: [ pgclustername_dbname, admin, user ] } - pgclustername_dbname_admin_password: - description: Admin Password for PGCLUSTERNAME dbname database - value: { get_attribute: [ pgclustername_dbname, admin, password ] } - - # user role can read and write the tables - pgclustername_dbname_user_host: - description: Hostname for PGCLUSTERNAME dbname database - value: { get_attribute: [ pgclustername_dbname, user, host ] } - pgclustername_dbname_user_user: - description: User Username for PGCLUSTERNAME dbname database - value: { get_attribute: [ pgclustername_dbname, user, user ] } - pgclustername_dbname_user_password: - description: User Password for PGCLUSTERNAME dbname database - value: { get_attribute: [ pgclustername_dbname, user, password ] } - - # viewer role can only read from the tables - pgclustername_dbname_viewer_host: - description: Hostname for PGCLUSTERNAME dbname database - value: { get_attribute: [ pgclustername_dbname, viewer, host ] } - pgclustername_dbname_viewer_user: - description: Viewer Username for PGCLUSTERNAME dbname database - value: { get_attribute: [ pgclustername_dbname, viewer, user ] } - pgclustername_dbname_viewer_password: - description: Viewer Password for PGCLUSTERNAME dbname database - value: { get_attribute: [ pgclustername_dbname, viewer, password ] } diff --git a/blueprints/pgaas-onevm.yaml-template b/blueprints/pgaas-onevm.yaml-template deleted file mode 100644 index be2d044..0000000 --- a/blueprints/pgaas-onevm.yaml-template +++ /dev/null @@ -1,300 +0,0 @@ -# -*- indent-tabs-mode: nil -*- # vi: set expandtab: -# -# ============LICENSE_START==================================================== -# org.onap.dcae -# ============================================================================= -# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. -# ============================================================================= -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END====================================================== - -tosca_definitions_version: cloudify_dsl_1_3 - -description: |- - This blueprint is used to install and to uninstall a single-VM central postgres as a platform service. - This blueprint depends upon the deployment of the pgaas_plugin and Consul. - -imports: - - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml - - http://www.getcloudify.org/spec/openstack-plugin/1.4/plugin.yaml - - http://www.getcloudify.org/spec/fabric-plugin/1.4.1/plugin.yaml - - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/dnsdesig/dns_types.yaml" - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/sshkeyshare/sshkey_types.yaml" - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml" - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/1.1.0/pgaas_types.yaml" - -inputs: - blueprint_version: - type: string - default: '2018-04-27T00:31:38+0000' - - # pgaas-specific info - pgaas_cluster_name: - type: string - default: pgvm - -{{ ONAPTEMPLATE_STANDARD_INPUTS_TYPES }} - - vm_init_pgrs: - type: string - default: | - #!/bin/sh - echo All output will be found in /tmp/ins.out and /tmp/ins.err - exec > /tmp/ins.out 2> /tmp/ins.err - set -x - if [ "$(dnsdomainname 2>/dev/null)" = "" ] - then - echo WARNING WARNING WARNING - echo The DNS DHCP settings did not work properly. - for i in $(seq 20) - do - echo Sleeping... - sleep 10 - if [ "$(dnsdomainname 2>/dev/null)" != "" ] - then break - fi - echo The DNS DHCP settings still did not work properly. - done - if [ "$(dnsdomainname 2>/dev/null)" = "" ] - then - echo Exiting - exit 1 - fi - fi - - CONFDIR=/var/config/DCAE/chef/ - mkdir -p $CONFDIR - - CONF=$CONFDIR/pgaas-postgres.conf - cat < $CONF - master: ${MASTER%%.*} - secondmaster: notused - DRTR_NODE_KSTOREFILE: /opt/app/dcae-certificate/keystore.jks - DRTR_NODE_KSTOREPASS: "No Certificate" - DRTR_NODE_PVTKEYPASS: "No Certificate" - PG_NODES: $PG_NODES - PG_JAVA_HOME : /opt/app/java/jdk/jdk170 - PG_CLUSTER: central - EOF - - apt-get update - - # invoking apt-get separately allows a failure to be ignored - for i in openjdk-7-jdk openjdk-8-jdk python-pip python3-pip curl gawk; do apt-get install -y $i;done - pip install pyyaml - - # prevent servers from starting - echo "exit 101" > /usr/sbin/policy-rc.d; chmod a+x /usr/sbin/policy-rc.d - - # invoking apt-get separately allows a failure to be ignored - for i in postgresql libpq5 repmgr python-psycopg2 python3-psycopg2 libgetopt-java; do apt-get install -y $i; done - - # allow servers to autostart again - rm -f /usr/sbin/policy-rc.d - - ( umask 077; sed 's/^/*:*:*:postgres:/' < /root/.pgrspw > ~postgres/.pgpass; chown postgres:postgres ~postgres/.pgpass ) - - if [ ! -f $CONF ] - then echo "$CONF does not exist" 1>&2; exit 1 - fi - - echo Look in /tmp/pgaas.out for output from installing PGaaS - NEXUS={{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_storage_pgaas_debs_releases }}/debs - for pkg in cdf.deb-1.0.0 pgaas.deb-1.0.0 - do - OUT=/tmp/$pkg - curl -s -k -f -o $OUT $NEXUS/$pkg - dpkg --install $OUT - done - - curl -v -X PUT -H "Content-Type: application/json" "http://${LOCATION_PREFIX}cnsl00.${LOCATION_DOMAIN}:8500/v1/agent/service/register" -d "{\"name\" : \"${CLUSTER_NAME}-write\", \"Address\" : \"${LOCAL_IP}\", \"Port\" : 5432}\"" - curl -v -X PUT -H "Content-Type: application/json" "http://${LOCATION_PREFIX}cnsl00.${LOCATION_DOMAIN}:8500/v1/agent/service/register" -d "{\"name\" : \"${CLUSTER_NAME}\", \"Address\" : \"${LOCAL_IP}\", \"Port\" : 5432}" - - echo ALL DONE - -node_templates: - key_pair: - type: cloudify.openstack.nodes.KeyPair - properties: - private_key_path: { get_input: key_filename } - use_external_resource: True - resource_id: { get_input: keypair } - openstack_config: &open_conf - get_input: openstack - private_net: - type: cloudify.openstack.nodes.Network - properties: - use_external_resource: True - resource_id: { get_input: private_net } - openstack_config: *open_conf - security_group: - type: cloudify.openstack.nodes.SecurityGroup - properties: - use_external_resource: True - resource_id: { get_input: security_group } - openstack_config: *open_conf - - sharedsshkey_pgrs: - type: ccsdk.nodes.ssh.keypair - - fixedip_pgrs00: - type: cloudify.openstack.nodes.Port - properties: - port: - extra_dhcp_opts: - - opt_name: 'domain-name' - opt_value: { get_input: location_domain } - openstack_config: *open_conf - relationships: - - type: cloudify.relationships.contained_in - target: private_net - floatingip_pgrs00: - type: cloudify.openstack.nodes.FloatingIP - properties: - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - floating_network_name: { get_input: public_net } - dns_pgrs00: - type: ccsdk.nodes.dns.arecord - properties: - fqdn: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '00.', { get_input: location_domain } ] } - openstack: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - ip_addresses: - - { get_attribute: [ floatingip_pgrs00, floating_ip_address ] } - relationships: - - type: cloudify.relationships.depends_on - target: floatingip_pgrs00 - host_pgrs00: - type: cloudify.openstack.nodes.Server - properties: - install_agent: false - image: { get_input: ubuntu1604image_id } - flavor: { get_input: flavor_id } - management_network_name: { get_input: private_net } - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - name: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '00' ] } - userdata: - concat: - - |- - #!/bin/sh - mkdir /root/.sshkey - echo ' - - { get_attribute: [ sharedsshkey_pgrs, public ] } - - |- - ' >/root/.sshkey/id_rsa.pub - echo ' - - { get_attribute: [ sharedsshkey_pgrs, base64private ] } - - |- - ' | base64 -d >/root/.sshkey/id_rsa - chmod 700 /root/.sshkey - chmod 600 /root/.sshkey/* - ( umask 077; echo -n postgres | cat - /root/.sshkey/id_rsa | md5sum | awk '{ print $1 }' > /root/.pgrspw ) - set -x - - "\n" - - "CLUSTER_NAME='" - - { get_input: pgaas_cluster_name } - - "'\n" - - "LOCATION_PREFIX='" - - { get_input: location_prefix } - - "'\n" - - "LOCATION_DOMAIN='" - - { get_input: location_domain } - - "'\n" - - "MASTER='" - - { get_property: [ dns_pgrs00, fqdn ] } - - "'\n" - - "LOCAL_IP='" - - { get_attribute: [ floatingip_pgrs00, floating_ip_address ] } - - "'\n" - - "PG_NODES='" - - { get_property: [ dns_pgrs00, fqdn ] } - - "'\n" - - { get_input: vm_init_pgrs } - relationships: - - type: cloudify.openstack.server_connected_to_port - target: fixedip_pgrs00 - - type: cloudify.openstack.server_connected_to_security_group - target: security_group - - type: cloudify.openstack.server_connected_to_floating_ip - target: floatingip_pgrs00 - - type: cloudify.openstack.server_connected_to_keypair - target: key_pair - - type: cloudify.relationships.depends_on - target: dns_pgrs00 - - type: cloudify.relationships.depends_on - target: sharedsshkey_pgrs - # CNAME records - dns_pgrs_rw: - type: ccsdk.nodes.dns.cnamerecord - properties: - fqdn: { concat: [ { get_input: location_prefix }, '-', { get_input: pgaas_cluster_name }, '-write.', { get_input: location_domain } ] } - openstack: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - cname: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '00.', { get_input: location_domain } ] } - - dns_pgrs_ro: - type: ccsdk.nodes.dns.cnamerecord - properties: - fqdn: { concat: [ { get_input: location_prefix }, '-', { get_input: pgaas_cluster_name }, '.', { get_input: location_domain } ] } - openstack: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - cname: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '00.', { get_input: location_domain } ] } - - # tie to pgaas_plugin database - pgaas_cluster: - type: dcae.nodes.pgaas.cluster - properties: - writerfqdn: { get_property: [ dns_pgrs_rw, fqdn ] } - readerfqdn: { get_property: [ dns_pgrs_ro, fqdn ] } - relationships: - - type: dcae.relationships.pgaas_cluster_uses_sshkeypair - target: sharedsshkey_pgrs - - type: cloudify.relationships.depends_on - target: dns_pgrs_rw - - type: cloudify.relationships.depends_on - target: dns_pgrs_ro - -outputs: - public_ip00: - value: { get_attribute: [host_pgrs00, ip] } - writerfqdn: - value: { get_property: [ dns_pgrs_rw, fqdn ] } - readerfqdn: - value: { get_property: [ dns_pgrs_ro, fqdn ] } - dns_pgrs00: - value: { get_property: [ dns_pgrs00, fqdn ] } - blueprint_version: - value: { get_input: blueprint_version } diff --git a/blueprints/pgaas.yaml-template b/blueprints/pgaas.yaml-template deleted file mode 100644 index 4a7e16a..0000000 --- a/blueprints/pgaas.yaml-template +++ /dev/null @@ -1,412 +0,0 @@ -# -*- indent-tabs-mode: nil -*- # vi: set expandtab: -# -# ============LICENSE_START==================================================== -# org.onap.dcae -# ============================================================================= -# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. -# ============================================================================= -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END====================================================== - -tosca_definitions_version: cloudify_dsl_1_3 - -description: |- - This blueprint is used to install and to uninstall a two-VM central postgres as a platform service. - This blueprint depends upon the deployment of the pgaas_plugin and Consul. - -imports: - - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml - - http://www.getcloudify.org/spec/openstack-plugin/1.4/plugin.yaml - - http://www.getcloudify.org/spec/fabric-plugin/1.4.1/plugin.yaml - - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/dnsdesig/dns_types.yaml" - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/sshkeyshare/sshkey_types.yaml" - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml" - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/1.1.0/pgaas_types.yaml" - -inputs: - blueprint_version: - type: string - default: '2018-04-27T00:31:38+0000' - - # pgaas-specific info - pgaas_cluster_name: - type: string - default: pstg - -{{ ONAPTEMPLATE_STANDARD_INPUTS_TYPES }} - - vm_init_pgrs: - type: string - default: | - #!/bin/sh - echo All output will be found in /tmp/ins.out and /tmp/ins.err - exec > /tmp/ins.out 2> /tmp/ins.err - set -x - if [ "$(dnsdomainname 2>/dev/null)" = "" ] - then - echo WARNING WARNING WARNING - echo The DNS DHCP settings did not work properly. - for i in $(seq 20) - do - echo Sleeping... - sleep 10 - if [ "$(dnsdomainname 2>/dev/null)" != "" ] - then break - fi - echo The DNS DHCP settings still did not work properly. - done - if [ "$(dnsdomainname 2>/dev/null)" = "" ] - then - echo Exiting - exit 1 - fi - fi - - CONFDIR=/var/config/DCAE/chef/ - mkdir -p $CONFDIR - - CONF=$CONFDIR/pgaas-postgres.conf - cat < $CONF - master: ${MASTER%%.*} - secondmaster: notused - DRTR_NODE_KSTOREFILE: /opt/app/dcae-certificate/keystore.jks - DRTR_NODE_KSTOREPASS: "No Certificate" - DRTR_NODE_PVTKEYPASS: "No Certificate" - PG_NODES: $PG_NODES - PG_JAVA_HOME : /opt/app/java/jdk/jdk170 - PG_CLUSTER: central - EOF - - apt-get update - - # invoking apt-get separately allows a failure to be ignored - for i in openjdk-7-jdk openjdk-8-jdk python-pip python3-pip curl gawk; do apt-get install -y $i;done - pip install pyyaml - - # prevent servers from starting - echo "exit 101" > /usr/sbin/policy-rc.d; chmod a+x /usr/sbin/policy-rc.d - - # invoking apt-get separately allows a failure to be ignored - for i in postgresql libpq5 repmgr python-psycopg2 python3-psycopg2 libgetopt-java; do apt-get install -y $i; done - - # allow servers to autostart again - rm -f /usr/sbin/policy-rc.d - - ( umask 077; sed 's/^/*:*:*:postgres:/' < /root/.pgrspw > ~postgres/.pgpass; chown postgres:postgres ~postgres/.pgpass ) - - if [ ! -f $CONF ] - then echo "$CONF does not exist" 1>&2; exit 1 - fi - - echo Look in /tmp/pgaas.out for output from installing PGaaS - NEXUS={{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_storage_pgaas_debs_releases }}/debs - for pkg in cdf.deb-1.0.0 pgaas.deb-1.0.0 - do - OUT=/tmp/$pkg - curl -s -k -f -o $OUT $NEXUS/$pkg - dpkg --install $OUT - done - - case $(hostname) in - *00 ) WRITE=-write ;; - *01 ) WRITE= ;; - esac - curl -v -X PUT -H "Content-Type: application/json" "http://${LOCATION_PREFIX}cnsl00.${LOCATION_DOMAIN}:8500/v1/agent/service/register" -d "{\"name\" : \"${CLUSTER_NAME}${WRITE}\", \"Address\" : \"${LOCAL_IP}\", \"Port\" : 5432}" - - echo ALL DONE - -node_templates: - key_pair: - type: cloudify.openstack.nodes.KeyPair - properties: - private_key_path: { get_input: key_filename } - use_external_resource: True - resource_id: { get_input: keypair } - openstack_config: &open_conf - get_input: openstack - private_net: - type: cloudify.openstack.nodes.Network - properties: - use_external_resource: True - resource_id: { get_input: private_net } - openstack_config: *open_conf - security_group: - type: cloudify.openstack.nodes.SecurityGroup - properties: - use_external_resource: True - resource_id: { get_input: security_group } - openstack_config: *open_conf - - sharedsshkey_pgrs: - type: ccsdk.nodes.ssh.keypair - - fixedip_pgrs00: - type: cloudify.openstack.nodes.Port - properties: - port: - extra_dhcp_opts: - - opt_name: 'domain-name' - opt_value: { get_input: location_domain } - openstack_config: *open_conf - relationships: - - type: cloudify.relationships.contained_in - target: private_net - floatingip_pgrs00: - type: cloudify.openstack.nodes.FloatingIP - properties: - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - floating_network_name: { get_input: public_net } - dns_pgrs00: - type: ccsdk.nodes.dns.arecord - properties: - fqdn: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '00.', { get_input: location_domain } ] } - openstack: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - ip_addresses: - - { get_attribute: [ floatingip_pgrs00, floating_ip_address ] } - relationships: - - type: cloudify.relationships.depends_on - target: floatingip_pgrs00 - host_pgrs00: - type: cloudify.openstack.nodes.Server - properties: - install_agent: false - image: { get_input: ubuntu1604image_id } - flavor: { get_input: flavor_id } - management_network_name: { get_input: private_net } - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - name: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '00' ] } - userdata: - concat: - - |- - #!/bin/sh - mkdir /root/.sshkey - echo ' - - { get_attribute: [ sharedsshkey_pgrs, public ] } - - |- - ' >/root/.sshkey/id_rsa.pub - echo ' - - { get_attribute: [ sharedsshkey_pgrs, base64private ] } - - |- - ' | base64 -d >/root/.sshkey/id_rsa - chmod 700 /root/.sshkey - chmod 600 /root/.sshkey/* - ( umask 077; echo -n postgres | cat - /root/.sshkey/id_rsa | md5sum | awk '{ print $1 }' > /root/.pgrspw ) - set -x - - "\n" - - "CLUSTER_NAME='" - - { get_input: pgaas_cluster_name } - - "'\n" - - "LOCATION_PREFIX='" - - { get_input: location_prefix } - - "'\n" - - "LOCATION_DOMAIN='" - - { get_input: location_domain } - - "'\n" - - "MASTER='" - - { get_property: [ dns_pgrs00, fqdn ] } - - "'\n" - - "LOCAL_IP='" - - { get_attribute: [ floatingip_pgrs00, floating_ip_address ] } - - "'\n" - - "PG_NODES='" - - { get_property: [ dns_pgrs00, fqdn ] } - - '|' - - { get_property: [ dns_pgrs01, fqdn ] } - - "'\n" - - { get_input: vm_init_pgrs } - relationships: - - type: cloudify.openstack.server_connected_to_port - target: fixedip_pgrs00 - - type: cloudify.openstack.server_connected_to_security_group - target: security_group - - type: cloudify.openstack.server_connected_to_floating_ip - target: floatingip_pgrs00 - - type: cloudify.openstack.server_connected_to_keypair - target: key_pair - - type: cloudify.relationships.depends_on - target: dns_pgrs00 - - type: cloudify.relationships.depends_on - target: sharedsshkey_pgrs - fixedip_pgrs01: - type: cloudify.openstack.nodes.Port - properties: - port: - extra_dhcp_opts: - - opt_name: 'domain-name' - opt_value: { get_input: location_domain } - openstack_config: *open_conf - relationships: - - type: cloudify.relationships.contained_in - target: private_net - floatingip_pgrs01: - type: cloudify.openstack.nodes.FloatingIP - properties: - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - floating_network_name: { get_input: public_net } - dns_pgrs01: - type: ccsdk.nodes.dns.arecord - properties: - fqdn: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '01.', { get_input: location_domain } ] } - openstack: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - ip_addresses: - - { get_attribute: [ floatingip_pgrs01, floating_ip_address ] } - relationships: - - type: cloudify.relationships.depends_on - target: floatingip_pgrs01 - host_pgrs01: - type: cloudify.openstack.nodes.Server - properties: - install_agent: false - image: { get_input: ubuntu1604image_id } - flavor: { get_input: flavor_id } - management_network_name: { get_input: private_net } - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - name: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '01' ] } - userdata: - concat: - - |- - #!/bin/sh - mkdir /root/.sshkey - echo ' - - { get_attribute: [ sharedsshkey_pgrs, public ] } - - |- - ' >/root/.sshkey/id_rsa.pub - echo ' - - { get_attribute: [ sharedsshkey_pgrs, base64private ] } - - |- - ' | base64 -d >/root/.sshkey/id_rsa - chmod 700 /root/.sshkey - chmod 600 /root/.sshkey/* - ( umask 077; echo -n postgres | cat - /root/.sshkey/id_rsa | md5sum | awk '{ print $1 }' > /root/.pgrspw ) - set -x - - "\n" - - "CLUSTER_NAME='" - - { get_input: pgaas_cluster_name } - - "'\n" - - "LOCATION_PREFIX='" - - { get_input: location_prefix } - - "'\n" - - "LOCATION_DOMAIN='" - - { get_input: location_domain } - - "'\n" - - "MASTER='" - - { get_property: [ dns_pgrs00, fqdn ] } - - "'\n" - - "LOCAL_IP='" - - { get_attribute: [ floatingip_pgrs01, floating_ip_address ] } - - "'\n" - - "PG_NODES='" - - { get_property: [ dns_pgrs00, fqdn ] } - - '|' - - { get_property: [ dns_pgrs01, fqdn ] } - - "'\n" - - { get_input: vm_init_pgrs } - relationships: - - type: cloudify.openstack.server_connected_to_port - target: fixedip_pgrs01 - - type: cloudify.openstack.server_connected_to_security_group - target: security_group - - type: cloudify.openstack.server_connected_to_floating_ip - target: floatingip_pgrs01 - - type: cloudify.openstack.server_connected_to_keypair - target: key_pair - - type: cloudify.relationships.depends_on - target: dns_pgrs01 - - type: cloudify.relationships.depends_on - target: sharedsshkey_pgrs - - # CNAME records - dns_pgrs_rw: - type: ccsdk.nodes.dns.cnamerecord - properties: - fqdn: { concat: [ { get_input: location_prefix }, '-', { get_input: pgaas_cluster_name }, '-write.', { get_input: location_domain } ] } - openstack: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - cname: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '00.', { get_input: location_domain } ] } - - dns_pgrs_ro: - type: ccsdk.nodes.dns.cnamerecord - properties: - fqdn: { concat: [ { get_input: location_prefix }, '-', { get_input: pgaas_cluster_name }, '.', { get_input: location_domain } ] } - openstack: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - cname: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '00.', { get_input: location_domain } ] } - - # tie to pgaas_plugin database - pgaas_cluster: - type: dcae.nodes.pgaas.cluster - properties: - writerfqdn: { get_property: [ dns_pgrs_rw, fqdn ] } - readerfqdn: { get_property: [ dns_pgrs_ro, fqdn ] } - relationships: - - type: dcae.relationships.pgaas_cluster_uses_sshkeypair - target: sharedsshkey_pgrs - - type: cloudify.relationships.depends_on - target: dns_pgrs_rw - - type: cloudify.relationships.depends_on - target: dns_pgrs_ro - -outputs: - public_ip00: - value: { get_attribute: [host_pgrs00, ip] } - public_ip01: - value: { get_attribute: [host_pgrs01, ip] } - writerfqdn: - value: { get_property: [ dns_pgrs_rw, fqdn ] } - readerfqdn: - value: { get_property: [ dns_pgrs_ro, fqdn ] } - dns_pgrs00: - value: { get_property: [ dns_pgrs00, fqdn ] } - dns_pgrs01: - value: { get_property: [ dns_pgrs01, fqdn ] } - blueprint_version: - value: { get_input: blueprint_version } diff --git a/blueprints/policy_handler.yaml-template b/blueprints/policy_handler.yaml-template deleted file mode 100644 index 29e66e6..0000000 --- a/blueprints/policy_handler.yaml-template +++ /dev/null @@ -1,70 +0,0 @@ -# -*- indent-tabs-mode: nil -*- # vi: set expandtab: -# -# ============LICENSE_START======================================================= -# Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved. -# ================================================================================ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END========================================================= -# -# ECOMP is a trademark and service mark of AT&T Intellectual Property. - -tosca_definitions_version: cloudify_dsl_1_3 - -description: > - This blueprint deploys/manages the DCAE policy-handler as a Docker container - -imports: - - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/3/dockerplugin_types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml - -inputs: - - location_id: - description: Deployment location - - docker_host_override: - description: Target docker host - default: 'platform_dockerhost' - - policy_handler_image: - description: Docker image for policy_handler - default: '{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/org.onap.dcaegen2.platform.policy-handler:5.0.0' - - application_config: - description: policy handler application configuration - requires info on policy-engine - default: {} - -node_templates: - policy_handler: - type: dcae.nodes.DockerContainerForPlatforms - properties: - name: 'policy_handler' - image: { get_input: policy_handler_image } - application_config: { get_input: application_config } - docker_config: - healthcheck: - type: 'http' - interval: '300s' - timeout: '25s' - endpoint: '/healthcheck' - relationships: - - type: dcae.relationships.component_contained_in - target: docker_host - - # Docker host - docker_host: - type: dcae.nodes.SelectedDockerHost - properties: - location_id: { get_input: location_id } - docker_host_override: { get_input: docker_host_override } diff --git a/blueprints/prh-service.yaml-template b/blueprints/prh-service.yaml-template deleted file mode 100644 index 797cac0..0000000 --- a/blueprints/prh-service.yaml-template +++ /dev/null @@ -1,61 +0,0 @@ -tosca_definitions_version: cloudify_dsl_1_3 -imports: -- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml" -- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml" -inputs: - prh_publish_url: - type: string - default: "http://10.0.11.1:3904/events/unauthenticated.SO_OUTPUT" - prh_subscribe_url: - type: string - default: "http://10.0.11.1:3904/events/unauthenticated.SEC_OTHER_OUTPUT" - docker_host_override: - type: string - default: "component_dockerhost" - dh_location_id: - type: string - default: "zone1" - tag_version: - type: string - default: "nexus3.onap.org:10001/onap/org.onap.dcaegen2.services.prh:1.0" - - -node_templates: - docker_service_host: - type: dcae.nodes.SelectedDockerHost - properties: - docker_host_override: - get_input: docker_host_override - location_id: - get_input: dh_location_id - heartbeatService: - type: dcae.nodes.DockerContainerForComponentsUsingDmaap - properties: - application_config: - streams_publishes: - dcae_cl_out: - dmaap_info: - topic_url: - get_input: prh_publish_url - type: message_router - streams_subscribes: - heartbeat_fault: - dmaap_info: - topic_url: - get_input: prh_subcribe_url - type: message_router - docker_config: - healthcheck: - script: /app/bin/check_health.py - interval: 18s - timeout: 30s - type: docker - image: - get_input: tag_version - location_id: - get_input: dh_location_id - service_component_type: dcaegen2-services-prh - relationships: - - target: docker_service_host - type: dcae.relationships.component_contained_in - diff --git a/blueprints/reference_templates/DeploymentHandler-README.md b/blueprints/reference_templates/DeploymentHandler-README.md new file mode 100644 index 0000000..8b76890 --- /dev/null +++ b/blueprints/reference_templates/DeploymentHandler-README.md @@ -0,0 +1,23 @@ +## Deployment Handler Installation Blueprint +[`DeploymentHandler.yaml`](./DeploymentHandler.yaml) is a Cloudify blueprint that can be used to deploy an instance of the DCAE Deployment Handler (DH) as a Docker container in the DCAE Docker environment. + +### Input parameters +Some deployment parameters can be controlled via inputs supplied to Cloudify at the time a deployment is created from the blueprint. +The table below describes the available input parameters. + +Parameter|Description|Required?|Default +---------|-----------|---------|------- +`location_id`|Location where DH is to be deployed; should point to a central site|Yes|None +`docker_host_override`|Registered service name of the Docker host where DH should be deployed|Yes|`platform_dockerhost` +`deployment_handler_image`|Fully qualified name of the Docker image to use for DH|Yes|Current stable version of image +`application_config`|Application-specific configuration parameters (see below)|No|`{}` +`host_log_root`|root directory for logs in the Docker host file system|Yes|`/opt/onap/log` + +### Application configuration +The DH has sensible defaults for its configuration. The `application_config` input can be used to supply additional configuration information to override defaults and/or to set values for optional parameters. The content of this input is a dictionary with parameter names as keys and parameter values as values. See the documentation for the DH for the available configuration parameters. + +### Additional configuration +`DeploymentHandler.yaml` relies on the DCAE Docker plugin to carry out the actual deployment. The plugin gathers information from the blueprint and the inputs and uses this information to make API calls to a Docker Engine running in the DCAE environment. + +Certain aspects of Docker behavior are controlled through inputs to the plugin's `create` operation. This includes mapping directories and files from the host file system into the Docker container's file system. It is also possible to pass environment variables to the container. The inputs to the `create` operation are specified inside the blueprint in the `interfaces` section of node definition for the deployment handler. + diff --git a/blueprints/reference_templates/DeploymentHandler.yaml-template b/blueprints/reference_templates/DeploymentHandler.yaml-template new file mode 100644 index 0000000..4856636 --- /dev/null +++ b/blueprints/reference_templates/DeploymentHandler.yaml-template @@ -0,0 +1,102 @@ +# -*- indent-tabs-mode: nil -*- # vi: set expandtab: +# +# ============LICENSE_START========================================== +# org.onap.dcae +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END============================================ +# +# ECOMP and OpenECOMP are trademarks +# and service marks of AT&T Intellectual Property. +# + +tosca_definitions_version: cloudify_dsl_1_3 + +description: > + This blueprint deploys/manages the DCAE deployment handler as a Docker container + +imports: + - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml + + +inputs: + + location_id: + description: Deployment location + + docker_host_override: + description: Target docker host + default: 'platform_dockerhost' + + deployment_handler_image: + description: Docker image for deployment handler + default: '{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/org.onap.dcaegen2.platform.deployment-handler:3.2.0' + + application_config: + description: deployment handler application configuration (to override defaults) + default: {} + + host_log_root: + description: root directory for logs in the Docker host file system + default: '/opt/onap/log' + +node_templates: + + # Deployment Handler + deployment-handler: + type: dcae.nodes.DockerContainerForPlatforms + properties: + name: + 'deployment_handler' + image: + { get_input: deployment_handler_image } + application_config: + { get_input: application_config } + host_port: + 8188 + container_port: + 8443 + docker_config: + healthcheck: + type: 'http' + interval: '300s' + timeout: '5s' + endpoint: '/' + relationships: + - type: dcae.relationships.component_contained_in + target: docker_host + interfaces: + cloudify.interfaces.lifecycle: + start: + inputs: + envs: + SOMEVAR: somevalue + #volumes: + #- host: + #path: { concat: [ { get_input: host_log_root }, '/dcae/deployment_handler' ] } + #container: + #bind: /opt/app/dh/log + #mode: rw + + # Docker host + docker_host: + type: dcae.nodes.SelectedDockerHost + properties: + location_id: + { get_input: location_id } + docker_host_override: + { get_input: docker_host_override } diff --git a/blueprints/reference_templates/DockerBP.yaml-template b/blueprints/reference_templates/DockerBP.yaml-template new file mode 100644 index 0000000..e655063 --- /dev/null +++ b/blueprints/reference_templates/DockerBP.yaml-template @@ -0,0 +1,345 @@ +# -*- indent-tabs-mode: nil -*- # vi: set expandtab: +# +# ============LICENSE_START==================================================== +# org.onap.dcae +# ============================================================================= +# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. +# ============================================================================= +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END====================================================== + +tosca_definitions_version: cloudify_dsl_1_3 + +imports: + - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml + - http://www.getcloudify.org/spec/openstack-plugin/1.4/plugin.yaml + - http://www.getcloudify.org/spec/fabric-plugin/1.4.1/plugin.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/dnsdesig/dns_types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/sshkeyshare/sshkey_types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml + + + +inputs: + registered_dockerhost_name: + description: the name that this Dockerhost is registered as + location_id: + description: the location ID for the location where the Docker hsot is being deployed + type: string + target_datacenter: + description: |- + This is the name of the target Consul datacenter that the docker host will try to join + type: string + registrator_image: + description: |- + Full uri to registrator Docker image. Note! You should be using the forked version of + registrator in order to have Consul health checks for Docker containers. + type: string + centos7image_id: + type: string + default: '' + ubuntu1604image_id: + type: string + flavor_id: + type: string + security_group: + type: string + public_net: + type: string + private_net: + type: string + openstack: {} + keypair: + type: string + location_prefix: + type: string + location_domain: + type: string + node_name: + description: Used to construct the fqdn of the docker host + type: string + default: dokr00 + key_filename: + type: string + codesource_url: + type: string + codesource_version: + type: string + vm_init_dokr_00: + type: string + default: |- + #!/bin/sh + set -x + DATACENTER= + vm_init_dokr_01: + type: string + default: |- + REGNAME= + vm_init_dokr_fqdn: + type: string + description: |- + The FQDN environment variable is to be used in the cloud init script for the Docker host. + This is to be applied as metadata on the Consul node for the Docker host under the key + "fqdn". + default: |- + FQDN= + vm_init_dokr_service_tags: + type: string + description: |- + Environment variable assigned to a list of strings that are to be used as tags to label + the docker host. These tags are used when registering the docker host as a service in + Consul. The format of this input parameter is a string that is a shell script variable + assignment of the variable SERVICE_TAGS. It must be either null or a json array of strings. + Here is a valid example of when the value is a json array: + + 'SERVICE_TAGS="[\"foo\", \"bar\"]"' + + Note how the double quotes per array element are escaped. + default: "SERVICE_TAGS=null" + vm_init_dokr_02: + type: string + default: | + MYIP=`wget -qO- http://169.254.169.254/2009-04-04/meta-data/local-ipv4` + while [ -z "$MYPUB" ]; do + MYPUB=`wget -qO- http://169.254.169.254/2009-04-04/meta-data/public-ipv4` + sleep 5 + done + echo "My public IP: $MYPUB" + MYNAME=`hostname` + echo >>/etc/hosts + echo $MYIP $MYNAME >>/etc/hosts + + # Grab nameservers to be used to setup recursors for Consul + cat < /tmp/grab_nameservers.py + with open("/etc/resolv.conf", "r") as f: + nss = [line.split(" ")[1].strip() for line in f.readlines() if line.startswith("nameserver")] + print("[\"{0}\"]".format("\",\"".join(nss))) + EOF + NAMESERVERS=$(python3 /tmp/grab_nameservers.py) + + mkdir -p /opt/consul/config /opt/consul/data /opt/consul/bin + # Download Consul from Nexus + apt-get update + DEBIAN_FRONTEND=noninteractive apt-get install -y -q unzip + CONSUL_BIN_DIR=/opt/consul/bin + curl -Ss https://releases.hashicorp.com/consul/0.8.3/consul_0.8.3_linux_amd64.zip > $CONSUL_BIN_DIR/consul_0.8.3_linux_amd64.zip + unzip $CONSUL_BIN_DIR/consul_0.8.3_linux_amd64.zip -d $CONSUL_BIN_DIR + # NOTE: The health check for the docker host is a simple existence look up for + # registrator (name is hardcoded). It does not check if registrator is running. + # This would require a script health check which means we might need to turn on + # "enable_script_check". + # NOTE: At the time of this change, there is no issue but there could be a + # chicken-and-egg issue where the health check might depend upon future downstream + # nodes (registrator) that downstream node requires a *healthy* docker host. + cat < /opt/consul/config/consul.json + { + "bind_addr" : "0.0.0.0", + "client_addr" : "0.0.0.0", + "advertise_addr" : "$MYIP", + "data_dir" : "/opt/consul/data", + "datacenter": "$DATACENTER", + "http_api_response_headers": { + "Access-Control-Allow-Origin" : "*" + }, + "rejoin_after_leave": true, + "server": false, + "ui": false, + "enable_syslog": true, + "log_level": "info", + "ports": { + "dns": 53 + }, + "recursors": $NAMESERVERS, + "service" : { + "id": "$REGNAME", + "name": "$REGNAME", + "address": "$MYPUB", + "port": 2376, + "tags": $SERVICE_TAGS, + "checks": [ + { + "http": "http://$MYPUB:2376/containers/registrator/json", + "interval": "30s" + } + ] + }, + "node_meta": { + "fqdn": "$FQDN" + } + } + EOF + + # Specify DOCKER_HOST environment variable to support healthchecks for Docker containers + # in Consul. Tried using the local unix socket but that did not work (possible bug in Consul) + # so forcing to use the http connection to Docker engine. + cat < /lib/systemd/system/consul.service + [Unit] + Description=Consul + Requires=network-online.target + After=network.target + [Service] + Type=simple + Environment=DOCKER_HOST=tcp://localhost:2376 + ExecStart=/opt/consul/bin/consul agent -config-dir=/opt/consul/config + ExecReload=/bin/kill -HUP \$MAINPID + [Install] + WantedBy=multi-user.target + EOF + systemctl enable consul + systemctl start consul + until /opt/consul/bin/consul join "cloudify-manager-${DATACENTER}" + do + echo Waiting to join Consul cluster + sleep 60 + done + + DEBIAN_FRONTEND=noninteractive apt-get install -y -q linux-image-extra-`uname -r` linux-image-extra-virtual apparmor dirmngr + DEBIAN_FRONTEND=noninteractive apt-get install -y -q docker.io + echo 'DOCKER_OPTS="--raw-logs -H tcp://0.0.0.0:2376 -H unix:///var/run/docker.sock"' >>/etc/default/docker + systemctl restart docker +node_templates: + key_pair: + type: cloudify.openstack.nodes.KeyPair + properties: + private_key_path: { get_input: key_filename } + use_external_resource: True + resource_id: { get_input: keypair } + openstack_config: &open_conf + get_input: openstack + private_net: + type: cloudify.openstack.nodes.Network + properties: + use_external_resource: True + resource_id: { get_input: private_net } + openstack_config: *open_conf + security_group: + type: cloudify.openstack.nodes.SecurityGroup + properties: + use_external_resource: True + resource_id: { get_input: security_group } + openstack_config: *open_conf + fixedip_dokr00: + type: cloudify.openstack.nodes.Port + properties: + port: + extra_dhcp_opts: + - opt_name: 'domain-name' + opt_value: { get_input: location_domain } + openstack_config: *open_conf + relationships: + - type: cloudify.relationships.contained_in + target: private_net + floatingip_dokr00: + type: cloudify.openstack.nodes.FloatingIP + properties: + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + floating_network_name: { get_input: public_net } + dns_dokr00: + type: ccsdk.nodes.dns.arecord + properties: + fqdn: { concat: [ { get_input: location_prefix }, { get_input: node_name }, '.', { get_input: location_domain } ] } + openstack: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + ip_addresses: + - { get_attribute: [ floatingip_dokr00, floating_ip_address ] } + relationships: + - type: cloudify.relationships.depends_on + target: floatingip_dokr00 + host_dokr00: + type: cloudify.openstack.nodes.Server + properties: + install_agent: false + image: { get_input: ubuntu1604image_id } + flavor: { get_input: flavor_id } + management_network_name: { get_input: private_net } + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + name: { concat: [ { get_input: location_prefix }, { get_input: node_name }] } + userdata: + concat: + - { get_input: vm_init_dokr_00 } + - { get_input: target_datacenter } + - |+ + + - { get_input: vm_init_dokr_01 } + - { get_input: registered_dockerhost_name } + - |+ + + - { get_input: vm_init_dokr_fqdn } + - { get_property: [ dns_dokr00, fqdn ] } + - |+ + + - { get_input: vm_init_dokr_service_tags } + - |+ + + - { get_input: vm_init_dokr_02 } + relationships: + - type: cloudify.openstack.server_connected_to_port + target: fixedip_dokr00 + - type: cloudify.openstack.server_connected_to_security_group + target: security_group + - type: cloudify.openstack.server_connected_to_floating_ip + target: floatingip_dokr00 + - type: cloudify.openstack.server_connected_to_keypair + target: key_pair + - type: cloudify.relationships.depends_on + target: dns_dokr00 + + registrator: + type: dcae.nodes.DockerContainer + properties: + name: + 'registrator' + image: + { get_input: registrator_image } + relationships: + - type: dcae.relationships.component_contained_in + target: docker_host + interfaces: + cloudify.interfaces.lifecycle: + start: + inputs: + envs: + EXTERNAL_IP: + get_attribute: [ floatingip_dokr00, floating_ip_address ] + volumes: + - host: + path: '/var/run/docker.sock' + container: + bind: '/tmp/docker.sock' + mode: 'ro' + + docker_host: + type: dcae.nodes.SelectedDockerHost + properties: + location_id: + { get_input: location_id } + docker_host_override: + { get_input: registered_dockerhost_name } + relationships: + - type: cloudify.relationships.depends_on #this is to avoid a race condition + target: host_dokr00 diff --git a/blueprints/reference_templates/README.txt b/blueprints/reference_templates/README.txt new file mode 100644 index 0000000..f6f038f --- /dev/null +++ b/blueprints/reference_templates/README.txt @@ -0,0 +1,42 @@ +Blueprints used for deployment of VM's and cluster for DCAE deployment (Amsterdam release) +========================================================================================= +centos_vm.yaml-template +DockerBP.yaml-template +consul_cluster.yaml-template +cdap-sdk.yaml-template +cdapbp7.yaml-template +pgaas-database.yaml-template +pgaas-cluster.yaml-template +pgaas-onevm.yaml-template +pgaas-getdbinfo.yaml-template +pgaas-disk.yaml-template +pgaas.yaml-template + + +Blueprint used for spinning up Platform components in VM's (Amsterdam release) +============================================================================== +centos_vm.yaml-template +inventory.yaml-template +cdap_broker.yaml-template +policy_handler.yaml-template +DeploymentHandler.yaml-template +config_binding_service.yaml-template + +Blueprint used for spinning up Service components in VM's (Amsterdam release) +============================================================================== +holmes-rules.yaml-template +holmes-engine.yaml-template +heartbeat-service.yaml-template +ves.yaml-template +tca.yaml-template +snmptrap-collector.yaml-template +prh-service.yaml-template +tcadocker-service.yaml-template + + +Blueprints used for K8S deployment through K8SPlugin +==================================================== +k8s-policy_handler.yaml-template +k8s-inventory.yaml-template +k8s-deployment_handler.yaml-template +k8s-config_binding_service.yaml-template diff --git a/blueprints/reference_templates/cdap-sdk.yaml-template b/blueprints/reference_templates/cdap-sdk.yaml-template new file mode 100644 index 0000000..cd1244f --- /dev/null +++ b/blueprints/reference_templates/cdap-sdk.yaml-template @@ -0,0 +1,71 @@ +# ============LICENSE_START==================================================== +# org.onap.dcae +# ============================================================================= +# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. +# ============================================================================= +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END====================================================== + + +tosca_definitions_version: cloudify_dsl_1_3 +imports: + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml + +inputs: + dh_override: + type: string + default: "component_dockerhost" + dh_location_id: + type: string + default: "dcaeams" + cdap_cluster_name: + type: string + default: "cdap" +node_templates: + docker_cdap_host: + properties: + docker_host_override: + get_input: dh_override + location_id: + get_input: dh_location_id + type: dcae.nodes.SelectedDockerHost + cdapdocker: + interfaces: + cloudify.interfaces.lifecycle: + stop: + inputs: + cleanup_image: true + start: + inputs: + ports: + - '11011:11011' + envs: + SERVICE_11015_NAME: { get_input: cdap_cluster_name } + SERVICE_11011_IGNORE: 'true' + properties: + host_port: 11015 + container_port: 11015 + docker_config: + healthcheck: + endpoint: "/status" + interval: "15s" + timeout: "15s" + type: "http" + name: 'cdap_docker' + image: "caskdata/cdap-standalone:4.1.2" + relationships: + - type: dcae.relationships.component_contained_in + target: docker_cdap_host + type: dcae.nodes.DockerContainerForPlatforms + diff --git a/blueprints/reference_templates/cdap_broker.yaml-template b/blueprints/reference_templates/cdap_broker.yaml-template new file mode 100644 index 0000000..3c29634 --- /dev/null +++ b/blueprints/reference_templates/cdap_broker.yaml-template @@ -0,0 +1,97 @@ +# -*- indent-tabs-mode: nil -*- # vi: set expandtab: +# +# ============LICENSE_START==================================================== +# org.onap.dcae +# ============================================================================= +# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. +# ============================================================================= +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END====================================================== + +tosca_definitions_version: cloudify_dsl_1_3 + +description: > + This blueprint is for managing the CDAP infrastructure + +imports: + - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/cdapcloudify/14/cdapcloudify_types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml + +inputs: + location_id: + type: string + default: "" + cdap_cluster_name: + type: string + default: "cdap" + +node_templates: + + broker_deleter: + #does nothing on install, but deletes all registered apps when broker is uninstalled + #uninstalling the broker without doing this leaves them in purgatory forever, unless CDAP was also uninstalled, but that may or may not be true or in the same blueprint. + type: dcae.nodes.broker_deleter + interfaces: + cloudify.interfaces.lifecycle: + delete: + inputs: + connected_broker_dns_name: { get_property: [cdap_broker, name] } + relationships: + - type: cloudify.relationships.depends_on + target: cdap_broker + + cdap_broker: + type: dcae.nodes.DockerContainerForPlatforms + properties: + name: 'cdap_broker' + application_config: + bindingttw: 5 + hcinterval: 60s + autoderegisterafter: 10m + pipelinehealthlimit: 2 + host_port: 7777 + container_port: 7777 + docker_config: + healthcheck: + type: "http" + #broker has a semi healthcheck endpoint at root right now, TODO would be to add a real /healtcheck endpoint + endpoint: "/" + interval: "120s" + timeout: "60s" + image: "{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/org.onap.dcaegen2.platform.cdapbroker:v4.0.0" + interfaces: + cloudify.interfaces.lifecycle: + start: + inputs: + envs: + CDAP_CLUSTER_TO_MANAGE: { get_input: cdap_cluster_name } + volumes: + - host: + path: '/tmp/log/cdapbroker/' + container: + bind: '/tmp/log/cdapbroker/' #Broker EELF log directory + mode: 'rw' + relationships: + - type: dcae.relationships.component_contained_in + target: docker_host + + docker_host: + type: dcae.nodes.SelectedDockerHost + properties: + location_id: + { get_input: location_id } + docker_host_override: + 'platform_dockerhost' + #WARNING: ASSUMES THIS EXISTS AND IS ALREADY REGISTERED diff --git a/blueprints/reference_templates/cdapbp7.yaml-template b/blueprints/reference_templates/cdapbp7.yaml-template new file mode 100644 index 0000000..7fddaa1 --- /dev/null +++ b/blueprints/reference_templates/cdapbp7.yaml-template @@ -0,0 +1,1054 @@ +# -*- indent-tabs-mode: nil -*- # vi: set expandtab: +# +# ============LICENSE_START==================================================== +# org.onap.dcae +# ============================================================================= +# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. +# ============================================================================= +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END====================================================== + +tosca_definitions_version: cloudify_dsl_1_3 + +imports: + - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml + - http://www.getcloudify.org/spec/openstack-plugin/1.4/plugin.yaml + - http://www.getcloudify.org/spec/fabric-plugin/1.4.1/plugin.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/dnsdesig/dns_types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/sshkeyshare/sshkey_types.yaml + +inputs: + centos7image_id: + type: string + default: '' + ubuntu1404image_id: + type: string + default: '' + ubuntu1604image_id: + type: string + flavor_id: + type: string + security_group: + type: string + public_net: + type: string + private_net: + type: string + openstack: {} + keypair: + type: string + location_prefix: + type: string + location_domain: + type: string + key_filename: + type: string + codesource_url: + type: string + codesource_version: + type: string + + vm_init_cdap: + type: string + default: | + wget -qO- $CODE_SOURCE/${CODE_VERSION}/cloud_init/cdap-init.sh >/tmp/cdap-init.sh + sh /tmp/cdap-init.sh "$CODE_SOURCE" "$CODE_VERSION" "$CLUSTER_INDEX" "$CLUSTER_SIZE" "$CLUSTER_FQDNS" "$CLUSTER_LOCAL_IPS" "$CLUSTER_FLOATING_IPS" "$DATACENTER" "$REGISTERED_NAME" + location_id: + default: "solutioning-central" + cdap_cluster_name: + type: string + default: "cdap" + +node_templates: + key_pair: + type: cloudify.openstack.nodes.KeyPair + properties: + private_key_path: { get_input: key_filename } + use_external_resource: True + resource_id: { get_input: keypair } + openstack_config: &open_conf + get_input: openstack + private_net: + type: cloudify.openstack.nodes.Network + properties: + use_external_resource: True + resource_id: { get_input: private_net } + openstack_config: *open_conf + security_group: + type: cloudify.openstack.nodes.SecurityGroup + properties: + use_external_resource: True + resource_id: { get_input: security_group } + openstack_config: *open_conf + + sharedsshkey_cdap: + type: ccsdk.nodes.ssh.keypair + hostdeps_cdap: + type: cloudify.nodes.Root + relationships: + - type: cloudify.relationships.depends_on + target: dns_cdap00 + - type: cloudify.relationships.depends_on + target: fixedip_cdap00 + - type: cloudify.relationships.depends_on + target: dns_cdap01 + - type: cloudify.relationships.depends_on + target: fixedip_cdap01 + - type: cloudify.relationships.depends_on + target: dns_cdap02 + - type: cloudify.relationships.depends_on + target: fixedip_cdap02 + - type: cloudify.relationships.depends_on + target: dns_cdap03 + - type: cloudify.relationships.depends_on + target: fixedip_cdap03 + - type: cloudify.relationships.depends_on + target: dns_cdap04 + - type: cloudify.relationships.depends_on + target: fixedip_cdap04 + - type: cloudify.relationships.depends_on + target: dns_cdap05 + - type: cloudify.relationships.depends_on + target: fixedip_cdap05 + - type: cloudify.relationships.depends_on + target: dns_cdap06 + - type: cloudify.relationships.depends_on + target: fixedip_cdap06 + fixedip_cdap00: + type: cloudify.openstack.nodes.Port + properties: + port: + extra_dhcp_opts: + - opt_name: 'domain-name' + opt_value: { get_input: location_domain } + openstack_config: *open_conf + relationships: + - type: cloudify.relationships.contained_in + target: private_net + floatingip_cdap00: + type: cloudify.openstack.nodes.FloatingIP + properties: + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + floating_network_name: { get_input: public_net } + dns_cdap00: + type: ccsdk.nodes.dns.arecord + properties: + fqdn: { concat: [ { get_input: location_prefix }, 'cdap00.', { get_input: location_domain } ] } + openstack: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + ip_addresses: + - { get_attribute: [ floatingip_cdap00, floating_ip_address ] } + relationships: + - type: cloudify.relationships.depends_on + target: floatingip_cdap00 + host_cdap00: + type: cloudify.openstack.nodes.Server + properties: + install_agent: false + image: { get_input: ubuntu1604image_id } + flavor: { get_input: flavor_id } + management_network_name: { get_input: private_net } + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + name: { concat: [ { get_input: location_prefix }, 'cdap00' ] } + userdata: + concat: + - |- + #!/bin/sh + mkdir /root/.sshkey + echo ' + - { get_attribute: [ sharedsshkey_cdap, public ] } + - |- + ' >/root/.sshkey/id_rsa.pub + echo ' + - { get_attribute: [ sharedsshkey_cdap, base64private ] } + - |- + ' | base64 -d >/root/.sshkey/id_rsa + chmod 700 /root/.sshkey + chmod 600 /root/.sshkey/* + set -x + CLUSTER_INDEX=00 + CLUSTER_SIZE=7 + CLUSTER_FQDNS= + - { get_property: [ dns_cdap00, fqdn ] } + - ',' + - { get_property: [ dns_cdap01, fqdn ] } + - ',' + - { get_property: [ dns_cdap02, fqdn ] } + - ',' + - { get_property: [ dns_cdap03, fqdn ] } + - ',' + - { get_property: [ dns_cdap04, fqdn ] } + - ',' + - { get_property: [ dns_cdap05, fqdn ] } + - ',' + - { get_property: [ dns_cdap06, fqdn ] } + - "\nCLUSTER_FLOATING_IPS=" + - { get_attribute: [ floatingip_cdap00, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap01, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap02, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap03, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap04, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap05, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap06, floating_ip_address ] } + - "\nCLUSTER_LOCAL_IPS=" + - { get_attribute: [ fixedip_cdap00, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap01, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap02, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap03, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap04, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap05, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap06, fixed_ip_address ] } + - "\nCODE_SOURCE=" + - { get_input: codesource_url } + - "\nCODE_VERSION=" + - { get_input: codesource_version } + - "\n" + - "DATACENTER=" + - { get_input: location_id } + - "\n" + - { get_input: vm_init_cdap } + relationships: + - type: cloudify.openstack.server_connected_to_port + target: fixedip_cdap00 + - type: cloudify.openstack.server_connected_to_security_group + target: security_group + - type: cloudify.openstack.server_connected_to_floating_ip + target: floatingip_cdap00 + - type: cloudify.openstack.server_connected_to_keypair + target: key_pair + - type: cloudify.relationships.depends_on + target: hostdeps_cdap + - type: cloudify.relationships.depends_on + target: sharedsshkey_cdap + fixedip_cdap01: + type: cloudify.openstack.nodes.Port + properties: + port: + extra_dhcp_opts: + - opt_name: 'domain-name' + opt_value: { get_input: location_domain } + openstack_config: *open_conf + relationships: + - type: cloudify.relationships.contained_in + target: private_net + floatingip_cdap01: + type: cloudify.openstack.nodes.FloatingIP + properties: + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + floating_network_name: { get_input: public_net } + dns_cdap01: + type: ccsdk.nodes.dns.arecord + properties: + fqdn: { concat: [ { get_input: location_prefix }, 'cdap01.', { get_input: location_domain } ] } + openstack: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + ip_addresses: + - { get_attribute: [ floatingip_cdap01, floating_ip_address ] } + relationships: + - type: cloudify.relationships.depends_on + target: floatingip_cdap01 + host_cdap01: + type: cloudify.openstack.nodes.Server + properties: + install_agent: false + image: { get_input: ubuntu1604image_id } + flavor: { get_input: flavor_id } + management_network_name: { get_input: private_net } + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + name: { concat: [ { get_input: location_prefix }, 'cdap01' ] } + userdata: + concat: + - |- + #!/bin/sh + mkdir /root/.sshkey + echo ' + - { get_attribute: [ sharedsshkey_cdap, public ] } + - |- + ' >/root/.sshkey/id_rsa.pub + echo ' + - { get_attribute: [ sharedsshkey_cdap, base64private ] } + - |- + ' | base64 -d >/root/.sshkey/id_rsa + chmod 700 /root/.sshkey + chmod 600 /root/.sshkey/* + set -x + CLUSTER_INDEX=01 + CLUSTER_SIZE=7 + CLUSTER_FQDNS= + - { get_property: [ dns_cdap00, fqdn ] } + - ',' + - { get_property: [ dns_cdap01, fqdn ] } + - ',' + - { get_property: [ dns_cdap02, fqdn ] } + - ',' + - { get_property: [ dns_cdap03, fqdn ] } + - ',' + - { get_property: [ dns_cdap04, fqdn ] } + - ',' + - { get_property: [ dns_cdap05, fqdn ] } + - ',' + - { get_property: [ dns_cdap06, fqdn ] } + - "\nCLUSTER_FLOATING_IPS=" + - { get_attribute: [ floatingip_cdap00, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap01, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap02, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap03, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap04, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap05, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap06, floating_ip_address ] } + - "\nCLUSTER_LOCAL_IPS=" + - { get_attribute: [ fixedip_cdap00, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap01, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap02, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap03, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap04, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap05, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap06, fixed_ip_address ] } + - "\nCODE_SOURCE=" + - { get_input: codesource_url } + - "\nCODE_VERSION=" + - { get_input: codesource_version } + - "\n" + - "DATACENTER=" + - { get_input: location_id } + - "\n" + - { get_input: vm_init_cdap } + relationships: + - type: cloudify.openstack.server_connected_to_port + target: fixedip_cdap01 + - type: cloudify.openstack.server_connected_to_security_group + target: security_group + - type: cloudify.openstack.server_connected_to_floating_ip + target: floatingip_cdap01 + - type: cloudify.openstack.server_connected_to_keypair + target: key_pair + - type: cloudify.relationships.depends_on + target: hostdeps_cdap + - type: cloudify.relationships.depends_on + target: sharedsshkey_cdap + fixedip_cdap02: + type: cloudify.openstack.nodes.Port + properties: + port: + extra_dhcp_opts: + - opt_name: 'domain-name' + opt_value: { get_input: location_domain } + openstack_config: *open_conf + relationships: + - type: cloudify.relationships.contained_in + target: private_net + floatingip_cdap02: + type: cloudify.openstack.nodes.FloatingIP + properties: + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + floating_network_name: { get_input: public_net } + dns_cdap02: + type: ccsdk.nodes.dns.arecord + properties: + fqdn: { concat: [ { get_input: location_prefix }, 'cdap02.', { get_input: location_domain } ] } + openstack: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + ip_addresses: + - { get_attribute: [ floatingip_cdap02, floating_ip_address ] } + relationships: + - type: cloudify.relationships.depends_on + target: floatingip_cdap02 + host_cdap02: + type: cloudify.openstack.nodes.Server + properties: + install_agent: false + image: { get_input: ubuntu1604image_id } + flavor: { get_input: flavor_id } + management_network_name: { get_input: private_net } + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + name: { concat: [ { get_input: location_prefix }, 'cdap02' ] } + userdata: + concat: + - |- + #!/bin/sh + mkdir /root/.sshkey + echo ' + - { get_attribute: [ sharedsshkey_cdap, public ] } + - |- + ' >/root/.sshkey/id_rsa.pub + echo ' + - { get_attribute: [ sharedsshkey_cdap, base64private ] } + - |- + ' | base64 -d >/root/.sshkey/id_rsa + chmod 700 /root/.sshkey + chmod 600 /root/.sshkey/* + set -x + CLUSTER_INDEX=02 + CLUSTER_SIZE=7 + CLUSTER_FQDNS= + - { get_property: [ dns_cdap00, fqdn ] } + - ',' + - { get_property: [ dns_cdap01, fqdn ] } + - ',' + - { get_property: [ dns_cdap02, fqdn ] } + - ',' + - { get_property: [ dns_cdap03, fqdn ] } + - ',' + - { get_property: [ dns_cdap04, fqdn ] } + - ',' + - { get_property: [ dns_cdap05, fqdn ] } + - ',' + - { get_property: [ dns_cdap06, fqdn ] } + - "\nCLUSTER_FLOATING_IPS=" + - { get_attribute: [ floatingip_cdap00, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap01, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap02, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap03, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap04, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap05, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap06, floating_ip_address ] } + - "\nCLUSTER_LOCAL_IPS=" + - { get_attribute: [ fixedip_cdap00, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap01, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap02, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap03, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap04, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap05, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap06, fixed_ip_address ] } + - "\nCODE_SOURCE=" + - { get_input: codesource_url } + - "\nCODE_VERSION=" + - { get_input: codesource_version } + - "\n" + - "DATACENTER=" + - { get_input: location_id } + - "\n" + - "REGISTERED_NAME=" + - { get_input: cdap_cluster_name } + - "\n" + - { get_input: vm_init_cdap } + relationships: + - type: cloudify.openstack.server_connected_to_port + target: fixedip_cdap02 + - type: cloudify.openstack.server_connected_to_security_group + target: security_group + - type: cloudify.openstack.server_connected_to_floating_ip + target: floatingip_cdap02 + - type: cloudify.openstack.server_connected_to_keypair + target: key_pair + - type: cloudify.relationships.depends_on + target: hostdeps_cdap + - type: cloudify.relationships.depends_on + target: sharedsshkey_cdap + + fixedip_cdap03: + type: cloudify.openstack.nodes.Port + properties: + port: + extra_dhcp_opts: + - opt_name: 'domain-name' + opt_value: { get_input: location_domain } + openstack_config: *open_conf + relationships: + - type: cloudify.relationships.contained_in + target: private_net + floatingip_cdap03: + type: cloudify.openstack.nodes.FloatingIP + properties: + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + floating_network_name: { get_input: public_net } + dns_cdap03: + type: ccsdk.nodes.dns.arecord + properties: + fqdn: { concat: [ { get_input: location_prefix }, 'cdap03.', { get_input: location_domain } ] } + openstack: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + ip_addresses: + - { get_attribute: [ floatingip_cdap03, floating_ip_address ] } + relationships: + - type: cloudify.relationships.depends_on + target: floatingip_cdap03 + host_cdap03: + type: cloudify.openstack.nodes.Server + properties: + install_agent: false + image: { get_input: ubuntu1604image_id } + flavor: { get_input: flavor_id } + management_network_name: { get_input: private_net } + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + name: { concat: [ { get_input: location_prefix }, 'cdap03' ] } + userdata: + concat: + - |- + #!/bin/sh + mkdir /root/.sshkey + echo ' + - { get_attribute: [ sharedsshkey_cdap, public ] } + - |- + ' >/root/.sshkey/id_rsa.pub + echo ' + - { get_attribute: [ sharedsshkey_cdap, base64private ] } + - |- + ' | base64 -d >/root/.sshkey/id_rsa + chmod 700 /root/.sshkey + chmod 600 /root/.sshkey/* + set -x + CLUSTER_INDEX=03 + CLUSTER_SIZE=7 + CLUSTER_FQDNS= + - { get_property: [ dns_cdap00, fqdn ] } + - ',' + - { get_property: [ dns_cdap01, fqdn ] } + - ',' + - { get_property: [ dns_cdap02, fqdn ] } + - ',' + - { get_property: [ dns_cdap03, fqdn ] } + - ',' + - { get_property: [ dns_cdap04, fqdn ] } + - ',' + - { get_property: [ dns_cdap05, fqdn ] } + - ',' + - { get_property: [ dns_cdap06, fqdn ] } + - "\nCLUSTER_FLOATING_IPS=" + - { get_attribute: [ floatingip_cdap00, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap01, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap02, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap03, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap04, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap05, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap06, floating_ip_address ] } + - "\nCLUSTER_LOCAL_IPS=" + - { get_attribute: [ fixedip_cdap00, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap01, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap02, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap03, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap04, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap05, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap06, fixed_ip_address ] } + - "\nCODE_SOURCE=" + - { get_input: codesource_url } + - "\nCODE_VERSION=" + - { get_input: codesource_version } + - "\n" + - "DATACENTER=" + - { get_input: location_id } + - "\n" + - { get_input: vm_init_cdap } + relationships: + - type: cloudify.openstack.server_connected_to_port + target: fixedip_cdap03 + - type: cloudify.openstack.server_connected_to_security_group + target: security_group + - type: cloudify.openstack.server_connected_to_floating_ip + target: floatingip_cdap03 + - type: cloudify.openstack.server_connected_to_keypair + target: key_pair + - type: cloudify.relationships.depends_on + target: hostdeps_cdap + - type: cloudify.relationships.depends_on + target: sharedsshkey_cdap + fixedip_cdap04: + type: cloudify.openstack.nodes.Port + properties: + port: + extra_dhcp_opts: + - opt_name: 'domain-name' + opt_value: { get_input: location_domain } + openstack_config: *open_conf + relationships: + - type: cloudify.relationships.contained_in + target: private_net + floatingip_cdap04: + type: cloudify.openstack.nodes.FloatingIP + properties: + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + floating_network_name: { get_input: public_net } + dns_cdap04: + type: ccsdk.nodes.dns.arecord + properties: + fqdn: { concat: [ { get_input: location_prefix }, 'cdap04.', { get_input: location_domain } ] } + openstack: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + ip_addresses: + - { get_attribute: [ floatingip_cdap04, floating_ip_address ] } + relationships: + - type: cloudify.relationships.depends_on + target: floatingip_cdap04 + host_cdap04: + type: cloudify.openstack.nodes.Server + properties: + install_agent: false + image: { get_input: ubuntu1604image_id } + flavor: { get_input: flavor_id } + management_network_name: { get_input: private_net } + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + name: { concat: [ { get_input: location_prefix }, 'cdap04' ] } + userdata: + concat: + - |- + #!/bin/sh + mkdir /root/.sshkey + echo ' + - { get_attribute: [ sharedsshkey_cdap, public ] } + - |- + ' >/root/.sshkey/id_rsa.pub + echo ' + - { get_attribute: [ sharedsshkey_cdap, base64private ] } + - |- + ' | base64 -d >/root/.sshkey/id_rsa + chmod 700 /root/.sshkey + chmod 600 /root/.sshkey/* + set -x + CLUSTER_INDEX=04 + CLUSTER_SIZE=7 + CLUSTER_FQDNS= + - { get_property: [ dns_cdap00, fqdn ] } + - ',' + - { get_property: [ dns_cdap01, fqdn ] } + - ',' + - { get_property: [ dns_cdap02, fqdn ] } + - ',' + - { get_property: [ dns_cdap03, fqdn ] } + - ',' + - { get_property: [ dns_cdap04, fqdn ] } + - ',' + - { get_property: [ dns_cdap05, fqdn ] } + - ',' + - { get_property: [ dns_cdap06, fqdn ] } + - "\nCLUSTER_FLOATING_IPS=" + - { get_attribute: [ floatingip_cdap00, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap01, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap02, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap03, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap04, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap05, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap06, floating_ip_address ] } + - "\nCLUSTER_LOCAL_IPS=" + - { get_attribute: [ fixedip_cdap00, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap01, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap02, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap03, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap04, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap05, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap06, fixed_ip_address ] } + - "\nCODE_SOURCE=" + - { get_input: codesource_url } + - "\nCODE_VERSION=" + - { get_input: codesource_version } + - "\n" + - "DATACENTER=" + - { get_input: location_id } + - "\n" + - { get_input: vm_init_cdap } + relationships: + - type: cloudify.openstack.server_connected_to_port + target: fixedip_cdap04 + - type: cloudify.openstack.server_connected_to_security_group + target: security_group + - type: cloudify.openstack.server_connected_to_floating_ip + target: floatingip_cdap04 + - type: cloudify.openstack.server_connected_to_keypair + target: key_pair + - type: cloudify.relationships.depends_on + target: hostdeps_cdap + - type: cloudify.relationships.depends_on + target: sharedsshkey_cdap + fixedip_cdap05: + type: cloudify.openstack.nodes.Port + properties: + port: + extra_dhcp_opts: + - opt_name: 'domain-name' + opt_value: { get_input: location_domain } + openstack_config: *open_conf + relationships: + - type: cloudify.relationships.contained_in + target: private_net + floatingip_cdap05: + type: cloudify.openstack.nodes.FloatingIP + properties: + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + floating_network_name: { get_input: public_net } + dns_cdap05: + type: ccsdk.nodes.dns.arecord + properties: + fqdn: { concat: [ { get_input: location_prefix }, 'cdap05.', { get_input: location_domain } ] } + openstack: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + ip_addresses: + - { get_attribute: [ floatingip_cdap05, floating_ip_address ] } + relationships: + - type: cloudify.relationships.depends_on + target: floatingip_cdap05 + host_cdap05: + type: cloudify.openstack.nodes.Server + properties: + install_agent: false + image: { get_input: ubuntu1604image_id } + flavor: { get_input: flavor_id } + management_network_name: { get_input: private_net } + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + name: { concat: [ { get_input: location_prefix }, 'cdap05' ] } + userdata: + concat: + - |- + #!/bin/sh + mkdir /root/.sshkey + echo ' + - { get_attribute: [ sharedsshkey_cdap, public ] } + - |- + ' >/root/.sshkey/id_rsa.pub + echo ' + - { get_attribute: [ sharedsshkey_cdap, base64private ] } + - |- + ' | base64 -d >/root/.sshkey/id_rsa + chmod 700 /root/.sshkey + chmod 600 /root/.sshkey/* + set -x + CLUSTER_INDEX=05 + CLUSTER_SIZE=7 + CLUSTER_FQDNS= + - { get_property: [ dns_cdap00, fqdn ] } + - ',' + - { get_property: [ dns_cdap01, fqdn ] } + - ',' + - { get_property: [ dns_cdap02, fqdn ] } + - ',' + - { get_property: [ dns_cdap03, fqdn ] } + - ',' + - { get_property: [ dns_cdap04, fqdn ] } + - ',' + - { get_property: [ dns_cdap05, fqdn ] } + - ',' + - { get_property: [ dns_cdap06, fqdn ] } + - "\nCLUSTER_FLOATING_IPS=" + - { get_attribute: [ floatingip_cdap00, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap01, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap02, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap03, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap04, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap05, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap06, floating_ip_address ] } + - "\nCLUSTER_LOCAL_IPS=" + - { get_attribute: [ fixedip_cdap00, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap01, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap02, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap03, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap04, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap05, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap06, fixed_ip_address ] } + - "\nCODE_SOURCE=" + - { get_input: codesource_url } + - "\nCODE_VERSION=" + - { get_input: codesource_version } + - "\n" + - "DATACENTER=" + - { get_input: location_id } + - "\n" + - { get_input: vm_init_cdap } + relationships: + - type: cloudify.openstack.server_connected_to_port + target: fixedip_cdap05 + - type: cloudify.openstack.server_connected_to_security_group + target: security_group + - type: cloudify.openstack.server_connected_to_floating_ip + target: floatingip_cdap05 + - type: cloudify.openstack.server_connected_to_keypair + target: key_pair + - type: cloudify.relationships.depends_on + target: hostdeps_cdap + - type: cloudify.relationships.depends_on + target: sharedsshkey_cdap + fixedip_cdap06: + type: cloudify.openstack.nodes.Port + properties: + port: + extra_dhcp_opts: + - opt_name: 'domain-name' + opt_value: { get_input: location_domain } + openstack_config: *open_conf + relationships: + - type: cloudify.relationships.contained_in + target: private_net + floatingip_cdap06: + type: cloudify.openstack.nodes.FloatingIP + properties: + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + floating_network_name: { get_input: public_net } + dns_cdap06: + type: ccsdk.nodes.dns.arecord + properties: + fqdn: { concat: [ { get_input: location_prefix }, 'cdap06.', { get_input: location_domain } ] } + openstack: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + ip_addresses: + - { get_attribute: [ floatingip_cdap06, floating_ip_address ] } + relationships: + - type: cloudify.relationships.depends_on + target: floatingip_cdap06 + host_cdap06: + type: cloudify.openstack.nodes.Server + properties: + install_agent: false + image: { get_input: ubuntu1604image_id } + flavor: { get_input: flavor_id } + management_network_name: { get_input: private_net } + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + name: { concat: [ { get_input: location_prefix }, 'cdap06' ] } + userdata: + concat: + - |- + #!/bin/sh + mkdir /root/.sshkey + echo ' + - { get_attribute: [ sharedsshkey_cdap, public ] } + - |- + ' >/root/.sshkey/id_rsa.pub + echo ' + - { get_attribute: [ sharedsshkey_cdap, base64private ] } + - |- + ' | base64 -d >/root/.sshkey/id_rsa + chmod 700 /root/.sshkey + chmod 600 /root/.sshkey/* + set -x + CLUSTER_INDEX=06 + CLUSTER_SIZE=7 + CLUSTER_FQDNS= + - { get_property: [ dns_cdap00, fqdn ] } + - ',' + - { get_property: [ dns_cdap01, fqdn ] } + - ',' + - { get_property: [ dns_cdap02, fqdn ] } + - ',' + - { get_property: [ dns_cdap03, fqdn ] } + - ',' + - { get_property: [ dns_cdap04, fqdn ] } + - ',' + - { get_property: [ dns_cdap05, fqdn ] } + - ',' + - { get_property: [ dns_cdap06, fqdn ] } + - "\nCLUSTER_FLOATING_IPS=" + - { get_attribute: [ floatingip_cdap00, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap01, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap02, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap03, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap04, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap05, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap06, floating_ip_address ] } + - "\nCLUSTER_LOCAL_IPS=" + - { get_attribute: [ fixedip_cdap00, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap01, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap02, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap03, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap04, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap05, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap06, fixed_ip_address ] } + - "\nCODE_SOURCE=" + - { get_input: codesource_url } + - "\nCODE_VERSION=" + - { get_input: codesource_version } + - "\n" + - "DATACENTER=" + - { get_input: location_id } + - "\n" + - { get_input: vm_init_cdap } + relationships: + - type: cloudify.openstack.server_connected_to_port + target: fixedip_cdap06 + - type: cloudify.openstack.server_connected_to_security_group + target: security_group + - type: cloudify.openstack.server_connected_to_floating_ip + target: floatingip_cdap06 + - type: cloudify.openstack.server_connected_to_keypair + target: key_pair + - type: cloudify.relationships.depends_on + target: hostdeps_cdap + - type: cloudify.relationships.depends_on + target: sharedsshkey_cdap diff --git a/blueprints/reference_templates/centos_vm.yaml-template b/blueprints/reference_templates/centos_vm.yaml-template new file mode 100644 index 0000000..aa3bdb4 --- /dev/null +++ b/blueprints/reference_templates/centos_vm.yaml-template @@ -0,0 +1,243 @@ +# -*- indent-tabs-mode: nil -*- # vi: set expandtab: +# +# ============LICENSE_START========================================== +# org.onap.dcae +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END============================================ +# +# ECOMP and OpenECOMP are trademarks +# and service marks of AT&T Intellectual Property. +# + +tosca_definitions_version: cloudify_dsl_1_3 + +imports: + - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml + - http://www.getcloudify.org/spec/openstack-plugin/1.4/plugin.yaml + - http://www.getcloudify.org/spec/fabric-plugin/1.4.1/plugin.yaml + - types/dns_types.yaml + - types/sshkey_types.yaml + +inputs: + centos7image_id: + type: string + ubuntu1604image_id: + type: string + flavor_id: + type: string + security_group: + type: string + public_net: + type: string + private_net: + type: string + openstack: {} + keypair: + type: string + location_prefix: + type: string + location_domain: + type: string + key_filename: + type: string + codesource_url: + type: string + codesource_version: + type: string + cname: + type: string + default: dcae-orcl + datacenter: + type: string + vm_init_clmg_00: + type: string + default: |- + #!/bin/sh + set -x + DATACENTER= + vm_init_clmg_01: + type: string + default: | + CONSULVER=0.8.3 + CONSULNAME=consul_${CONSULVER}_linux_amd64 + MYIP=`curl -Ss http://169.254.169.254/2009-04-04/meta-data/local-ipv4` + MYNAME=`hostname` + if [ ! -z "$(echo $MYNAME |grep '.')" ]; then MYNAME="$(echo $MYNAME | cut -f1 -d '.')"; fi + echo >>/etc/hosts + echo $MYIP $MYNAME >>/etc/hosts + mkdir -p /opt/consul/config /opt/consul/data /opt/consul/bin + yum install -y unzip + # Download Consul + curl -Ss https://releases.hashicorp.com/consul/${CONSULVER}/${CONSULNAME}.zip > ${CONSULNAME}.zip + unzip -d /opt/consul/bin ${CONSULNAME}.zip + rm ${CONSULNAME}.zip + chmod +x /opt/consul/bin/consul + cat < /opt/consul/config/consul.json + { + "bind_addr" : "0.0.0.0", + "client_addr" : "0.0.0.0", + "data_dir" : "/opt/consul/data", + "datacenter": "$DATACENTER", + "rejoin_after_leave": true, + "http_api_response_headers": { + "Access-Control-Allow-Origin" : "*" + }, + "server": false, + "ui": false, + "enable_syslog": true, + "log_level": "info" + } + EOF + cat < /lib/systemd/system/consul.service + [Unit] + Description=Consul + Requires=network-online.target + After=network.target + [Service] + Type=simple + ExecStart=/opt/consul/bin/consul agent -config-dir=/opt/consul/config + ExecReload=/bin/kill -HUP \$MAINPID + [Install] + WantedBy=multi-user.target + EOF + systemctl enable consul + systemctl start consul + yum install -y python-psycopg2 + +node_templates: + key_pair: + type: cloudify.openstack.nodes.KeyPair + properties: + private_key_path: { get_input: key_filename } + use_external_resource: True + resource_id: { get_input: keypair } + openstack_config: &open_conf + get_input: openstack + private_net: + type: cloudify.openstack.nodes.Network + properties: + use_external_resource: True + resource_id: { get_input: private_net } + openstack_config: *open_conf + security_group: + type: cloudify.openstack.nodes.SecurityGroup + properties: + use_external_resource: True + resource_id: { get_input: security_group } + openstack_config: *open_conf + fixedip_vm00: + type: cloudify.openstack.nodes.Port + properties: + port: + extra_dhcp_opts: + - opt_name: 'domain-name' + opt_value: { get_input: location_domain } + openstack_config: *open_conf + relationships: + - type: cloudify.relationships.contained_in + target: private_net + floatingip_vm00: + type: cloudify.openstack.nodes.FloatingIP + properties: + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + floating_network_name: { get_input: public_net } + dns_vm00: + type: ccsdk.nodes.dns.arecord + properties: + fqdn: { concat: [ { get_input: location_prefix }, 'orcl00.', { get_input: location_domain } ] } + openstack: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + ip_addresses: + - { get_attribute: [ floatingip_vm00, floating_ip_address ] } + relationships: + - type: cloudify.relationships.depends_on + target: floatingip_vm00 + dns_cm: + type: ccsdk.nodes.dns.arecord + properties: + fqdn: { concat: [ 'cloudify-manager-', { get_input: datacenter}, '.', { get_input: location_domain } ] } + openstack: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + ip_addresses: + - { get_attribute: [ floatingip_vm00, floating_ip_address ] } + relationships: + - type: cloudify.relationships.depends_on + target: floatingip_vm00 + dns_cname: + type: ccsdk.nodes.dns.cnamerecord + properties: + fqdn: { concat: [ { get_input: cname }, '.', { get_input: location_domain } ] } + openstack: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + cname: { get_property: [ dns_vm00, fqdn ] } + relationships: + - type: cloudify.relationships.depends_on + target: dns_vm00 + host_vm00: + type: cloudify.openstack.nodes.Server + properties: + install_agent: false + image: { get_input: centos7image_id } + flavor: { get_input: flavor_id } + management_network_name: { get_input: private_net } + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + name: { concat: [ { get_input: location_prefix }, 'orcl00' ] } + userdata: + concat: + - { get_input: vm_init_clmg_00 } + - { get_input: datacenter } + - |+ + + - { get_input: vm_init_clmg_01 } + relationships: + - type: cloudify.openstack.server_connected_to_port + target: fixedip_vm00 + - type: cloudify.openstack.server_connected_to_security_group + target: security_group + - type: cloudify.openstack.server_connected_to_floating_ip + target: floatingip_vm00 + - type: cloudify.openstack.server_connected_to_keypair + target: key_pair + - type: cloudify.relationships.depends_on + target: dns_vm00 + - type: cloudify.relationships.depends_on + target: dns_cm + +outputs: + public_ip: + value: { get_attribute: [floatingip_vm00, floating_ip_address] } diff --git a/blueprints/reference_templates/config_binding_service.yaml-template b/blueprints/reference_templates/config_binding_service.yaml-template new file mode 100644 index 0000000..28dfb43 --- /dev/null +++ b/blueprints/reference_templates/config_binding_service.yaml-template @@ -0,0 +1,62 @@ +# -*- indent-tabs-mode: nil -*- # vi: set expandtab: +# +# ============LICENSE_START==================================================== +# ============================================================================= +# Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved. +# ============================================================================= +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END====================================================== + +tosca_definitions_version: cloudify_dsl_1_3 + +description: > + This blueprint installs the config binding service + +imports: + - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml +inputs: + location_id: + type: string + default: "" + + docker_host_override: + description: Target docker host to deploy applications to + default: 'platform_dockerhost' + +node_templates: + # Config binding service + service-config-binding: + type: dcae.nodes.DockerContainerForPlatforms + properties: + name: 'config_binding_service' + host_port: 10000 + container_port: 10000 + image: "{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/org.onap.dcaegen2.platform.configbinding:2.1.5" + docker_config: + healthcheck: + type: "http" + endpoint: "/healthcheck" + + relationships: + - type: dcae.relationships.component_contained_in + target: docker_host + + docker_host: + type: dcae.nodes.SelectedDockerHost + properties: + location_id: + { get_input: location_id } + docker_host_override: + { get_input: docker_host_override } diff --git a/blueprints/reference_templates/consul_cluster.yaml-template b/blueprints/reference_templates/consul_cluster.yaml-template new file mode 100644 index 0000000..a4ae89e --- /dev/null +++ b/blueprints/reference_templates/consul_cluster.yaml-template @@ -0,0 +1,384 @@ +# -*- indent-tabs-mode: nil -*- # vi: set expandtab: +# +# ============LICENSE_START========================================== +# org.onap.dcae +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END============================================ +# +# ECOMP and OpenECOMP are trademarks +# and service marks of AT&T Intellectual Property. +# + +tosca_definitions_version: cloudify_dsl_1_3 + +imports: + - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml + - http://www.getcloudify.org/spec/openstack-plugin/1.4/plugin.yaml + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/dnsdesig/dns_types.yaml" + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/sshkeyshare/sshkey_types.yaml" + +inputs: + centos7image_id: + type: string + ubuntu1604image_id: + type: string + flavor_id: + type: string + security_group: + type: string + public_net: + type: string + private_net: + type: string + openstack: {} + keypair: + type: string + location_prefix: + type: string + location_domain: + type: string + key_filename: + type: string + codesource_url: + type: string + codesource_version: + type: string + datacenter: + type: string + vm_init_cnsl_00: + type: string + default: |- + #!/bin/sh + set -x + DATACENTER= + vm_init_cnsl_01: + type: string + default: | + CONSULVER=0.8.3 + CONSULNAME=consul_${CONSULVER}_linux_amd64 + MYIP=`wget -qO- http://169.254.169.254/2009-04-04/meta-data/local-ipv4` + MYNAME=`hostname` + echo >>/etc/hosts + echo $MYIP $MYNAME >>/etc/hosts + mkdir -p /opt/consul/config /opt/consul/data /opt/consul/bin + + # Download Consul + apt-get update + apt-get install unzip + wget https://releases.hashicorp.com/consul/${CONSULVER}/${CONSULNAME}.zip + unzip -d /opt/consul/bin ${CONSULNAME}.zip + rm ${CONSULNAME}.zip + chmod +x /opt/consul/bin/consul + + # NOTE: Not using port 80 for http to avoid port collision of user facing services + # particularly for more large scale deployments of Consul. + cat < /opt/consul/config/consul.json + { + "bind_addr" : "$MYIP", + "client_addr" : "0.0.0.0", + "bootstrap_expect" : 3, + "data_dir" : "/opt/consul/data", + "datacenter": "$DATACENTER", + "http_api_response_headers": { + "Access-Control-Allow-Origin" : "*" + }, + "server": true, + "ui": true, + "enable_syslog": true, + "log_level": "info", + "ports": { + "dns": 53 + } + } + EOF + cat < /lib/systemd/system/consul.service + [Unit] + Description=Consul + Requires=network-online.target + After=network.target + [Service] + Type=simple + ExecStart=/opt/consul/bin/consul agent -config-dir=/opt/consul/config + ExecReload=/bin/kill -HUP \$MAINPID + [Install] + WantedBy=multi-user.target + EOF + systemctl enable consul + systemctl start consul +node_templates: + key_pair: + type: cloudify.openstack.nodes.KeyPair + properties: + private_key_path: { get_input: key_filename } + use_external_resource: True + resource_id: { get_input: keypair } + openstack_config: &open_conf + get_input: openstack + private_net: + type: cloudify.openstack.nodes.Network + properties: + use_external_resource: True + resource_id: { get_input: private_net } + openstack_config: *open_conf + security_group: + type: cloudify.openstack.nodes.SecurityGroup + properties: + use_external_resource: True + resource_id: { get_input: security_group } + openstack_config: *open_conf + fixedip_cnsl00: + type: cloudify.openstack.nodes.Port + properties: + port: + extra_dhcp_opts: + - opt_name: 'domain-name' + opt_value: { get_input: location_domain } + openstack_config: *open_conf + relationships: + - type: cloudify.relationships.contained_in + target: private_net + floatingip_cnsl00: + type: cloudify.openstack.nodes.FloatingIP + properties: + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + floating_network_name: { get_input: public_net } + dns_cnsl00: + type: ccsdk.nodes.dns.arecord + properties: + fqdn: { concat: [ { get_input: location_prefix }, 'cnsl00.', { get_input: location_domain } ] } + openstack: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + ip_addresses: + - { get_attribute: [ floatingip_cnsl00, floating_ip_address ] } + relationships: + - type: cloudify.relationships.depends_on + target: floatingip_cnsl00 + host_cnsl00: + type: cloudify.openstack.nodes.Server + properties: + install_agent: false + image: { get_input: ubuntu1604image_id } + flavor: { get_input: flavor_id } + management_network_name: { get_input: private_net } + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + name: { concat: [ { get_input: location_prefix }, 'cnsl00' ] } + userdata: + concat: + - { get_input: vm_init_cnsl_00 } + - { get_input: datacenter } + - |+ + + - { get_input: vm_init_cnsl_01 } + - concat: + - 'until /opt/consul/bin/consul join ' + - { get_attribute: [host_cnsl01, ip] } + - '; do sleep 5; done; ' + - concat: + - 'until /opt/consul/bin/consul join ' + - { get_attribute: [host_cnsl02, ip]} + - '; do sleep 5; done' + + relationships: + - type: cloudify.openstack.server_connected_to_port + target: fixedip_cnsl00 + - type: cloudify.openstack.server_connected_to_security_group + target: security_group + - type: cloudify.openstack.server_connected_to_floating_ip + target: floatingip_cnsl00 + - type: cloudify.openstack.server_connected_to_keypair + target: key_pair + - type: cloudify.relationships.depends_on + target: dns_cnsl00 + - type: cloudify.relationships.depends_on + target: host_cnsl01 + - type: cloudify.relationships.depends_on + target: host_cnsl02 + fixedip_cnsl01: + type: cloudify.openstack.nodes.Port + properties: + port: + extra_dhcp_opts: + - opt_name: 'domain-name' + opt_value: { get_input: location_domain } + openstack_config: *open_conf + relationships: + - type: cloudify.relationships.contained_in + target: private_net + floatingip_cnsl01: + type: cloudify.openstack.nodes.FloatingIP + properties: + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + floating_network_name: { get_input: public_net } + dns_cnsl01: + type: ccsdk.nodes.dns.arecord + properties: + fqdn: { concat: [ { get_input: location_prefix }, 'cnsl01.', { get_input: location_domain } ] } + openstack: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + ip_addresses: + - { get_attribute: [ floatingip_cnsl01, floating_ip_address ] } + relationships: + - type: cloudify.relationships.depends_on + target: floatingip_cnsl01 + host_cnsl01: + type: cloudify.openstack.nodes.Server + properties: + install_agent: false + image: { get_input: ubuntu1604image_id } + flavor: { get_input: flavor_id } + management_network_name: { get_input: private_net } + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + name: { concat: [ { get_input: location_prefix }, 'cnsl01' ] } + userdata: + concat: + - { get_input: vm_init_cnsl_00 } + - { get_input: datacenter } + - |+ + + - { get_input: vm_init_cnsl_01 } + relationships: + - type: cloudify.openstack.server_connected_to_port + target: fixedip_cnsl01 + - type: cloudify.openstack.server_connected_to_security_group + target: security_group + - type: cloudify.openstack.server_connected_to_floating_ip + target: floatingip_cnsl01 + - type: cloudify.openstack.server_connected_to_keypair + target: key_pair + - type: cloudify.relationships.depends_on + target: dns_cnsl01 + fixedip_cnsl02: + type: cloudify.openstack.nodes.Port + properties: + port: + extra_dhcp_opts: + - opt_name: 'domain-name' + opt_value: { get_input: location_domain } + openstack_config: *open_conf + relationships: + - type: cloudify.relationships.contained_in + target: private_net + floatingip_cnsl02: + type: cloudify.openstack.nodes.FloatingIP + properties: + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + floating_network_name: { get_input: public_net } + dns_cnsl02: + type: ccsdk.nodes.dns.arecord + properties: + fqdn: { concat: [ { get_input: location_prefix }, 'cnsl02.', { get_input: location_domain } ] } + openstack: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + ip_addresses: + - { get_attribute: [ floatingip_cnsl02, floating_ip_address ] } + relationships: + - type: cloudify.relationships.depends_on + target: floatingip_cnsl02 + dns_cluster: + type: ccsdk.nodes.dns.arecord + properties: + fqdn: { concat: [ 'dcae-cnsl.', { get_input: location_domain } ] } + openstack: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + ip_addresses: + - { get_attribute: [ floatingip_cnsl00, floating_ip_address ] } + - { get_attribute: [ floatingip_cnsl01, floating_ip_address ] } + - { get_attribute: [ floatingip_cnsl02, floating_ip_address ] } + + relationships: + - type: cloudify.relationships.depends_on + target: floatingip_cnsl00 + - type: cloudify.relationships.depends_on + target: floatingip_cnsl01 + - type: cloudify.relationships.depends_on + target: floatingip_cnsl02 + host_cnsl02: + type: cloudify.openstack.nodes.Server + properties: + install_agent: false + image: { get_input: ubuntu1604image_id } + flavor: { get_input: flavor_id } + management_network_name: { get_input: private_net } + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + name: { concat: [ { get_input: location_prefix }, 'cnsl02' ] } + userdata: + concat: + - { get_input: vm_init_cnsl_00 } + - { get_input: datacenter } + - |+ + + - { get_input: vm_init_cnsl_01 } + relationships: + - type: cloudify.openstack.server_connected_to_port + target: fixedip_cnsl02 + - type: cloudify.openstack.server_connected_to_security_group + target: security_group + - type: cloudify.openstack.server_connected_to_floating_ip + target: floatingip_cnsl02 + - type: cloudify.openstack.server_connected_to_keypair + target: key_pair + - type: cloudify.relationships.depends_on + target: dns_cnsl02 + +outputs: + public_ip: + value: { get_attribute: [floatingip_cnsl00, floating_ip_address] } diff --git a/blueprints/reference_templates/heartbeat-service.yaml-template b/blueprints/reference_templates/heartbeat-service.yaml-template new file mode 100644 index 0000000..2654c71 --- /dev/null +++ b/blueprints/reference_templates/heartbeat-service.yaml-template @@ -0,0 +1,61 @@ +tosca_definitions_version: cloudify_dsl_1_3 +imports: +- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml" +- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml" +inputs: + dcae_CL_publish_url: + type: string + default: "http://10.0.11.1:3904/events/unauthenticated.DCAE_CL_OUTPUT" + ves_heartbeat_url: + type: string + default: "http://10.0.11.1:3904/events/unauthenticated.SEC_HEARTBEAT_OUTPUT" + docker_host_override: + type: string + default: "component_dockerhost" + dh_location_id: + type: string + default: "zone1" + tag_version: + type: string + default: "nexus3.onap.org:10001/onap/org.onap.dcaegen2.platform.heartbeat:2.0" + +node_templates: + docker_service_host: + type: dcae.nodes.SelectedDockerHost + properties: + docker_host_override: + get_input: docker_host_override + location_id: + get_input: dh_location_id + heartbeatService: + type: dcae.nodes.DockerContainerForComponentsUsingDmaap + properties: + application_config: + heartbeat_config: '{"vnfs":[{"heartbeatcountmissed":3, "heartbeatinterval": 60, "closedLoopControlName":"ControlLoopEvent1"},{"heartbeatcountmissed":3, "heartbeatinterval": 60, "closedLoopControlName":"ControlLoopEvent1"},{"heartbeatcountmissed":3, "heartbeatinterval": 60, "closedLoopControlName":"ControlLoopEvent1"}]}' + streams_publishes: + dcae_cl_out: + dmaap_info: + topic_url: + get_input: dcae_CL_publish_url + type: message_router + streams_subscribes: + heartbeat_input: + dmaap_info: + topic_url: + get_input: ves_heartbeat_url + type: message_router + docker_config: + healthcheck: + script: /app/bin/check_health.py + interval: 18s + timeout: 30s + type: docker + image: + get_input: tag_version + location_id: + get_input: dh_location_id + service_component_type: dcaegen2-services-heartbeat + relationships: + - target: docker_service_host + type: dcae.relationships.component_contained_in + diff --git a/blueprints/reference_templates/holmes-engine.yaml-template b/blueprints/reference_templates/holmes-engine.yaml-template new file mode 100644 index 0000000..4661299 --- /dev/null +++ b/blueprints/reference_templates/holmes-engine.yaml-template @@ -0,0 +1,98 @@ +tosca_definitions_version: cloudify_dsl_1_3 +imports: +- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml" +- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dcaepolicyplugin/1/dcaepolicyplugin_types.yaml" +- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml" +- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/1.1.0/pgaas_types.yaml" +inputs: + dcae_CL_publish_url: + type: string + default: "http://10.0.11.1:3904/events/unauthenticated.DCAE_CL_OUTPUT" + ves_fault_publish_url: + type: string + default: "http://10.0.11.1:3904/events/unauthenticated.SEC_FAULT_OUTPUT" + docker_host_override: + type: string + default: "component_dockerhost" + dh_location_id: + type: string + default: "zone1" + msb_hostname: + type: string + default: "" + location_domain: + type: string + location_prefix: + type: string + pgaas_cluster_name: + type: string + # use the single-VM PG instance + default: pgvm + database_name: + type: string + default: holmes +node_templates: + pgaasvm: + type: dcae.nodes.pgaas.database + properties: + writerfqdn: { concat: [ { get_input: location_prefix }, '-', { get_input: pgaas_cluster_name }, '-write.', { get_input: location_domain } ] } + name: { get_input: database_name } + use_existing: true + docker_holmes_host: + type: dcae.nodes.SelectedDockerHost + properties: + docker_host_override: + get_input: docker_host_override + location_id: + get_input: dh_location_id + holmesengine: + type: dcae.nodes.DockerContainerForComponentsUsingDmaap + interfaces: + cloudify.interfaces.lifecycle: + start: + inputs: + envs: + URL_JDBC: + { get_attribute: [ pgaasvm, admin, host ] } + JDBC_PASSWORD: + { get_attribute: [ pgaasvm, admin, password ] } + JDBC_USERNAME: + { get_attribute: [ pgaasvm, admin, user ] } + MSB_ADDR: + get_input: msb_hostname + properties: + application_config: + msb.hostname: + get_input: msb_hostname + msb.uri: /api/microservices/v1/services + services_calls: {} + streams_publishes: + dcae_cl_out: + dmaap_info: + topic_url: + get_input: dcae_CL_publish_url + type: message_router + streams_subscribes: + ves_fault: + dmaap_info: + topic_url: + get_input: ves_fault_publish_url + type: message_router + docker_config: + healthcheck: + endpoint: /api/holmes-engine-mgmt/v1/healthcheck + interval: 15s + timeout: 1s + type: http + ports: + - 9102:9102 + image: "{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/holmes/engine-management:v1.0.0" + location_id: + get_input: dh_location_id + service_component_type: dcae-analytics-holmes-engine-management + relationships: + - type: cloudify.relationships.depends_on + target: pgaasvm + - target: docker_holmes_host + type: dcae.relationships.component_contained_in + diff --git a/blueprints/reference_templates/holmes-rules.yaml-template b/blueprints/reference_templates/holmes-rules.yaml-template new file mode 100644 index 0000000..dc0ab7d --- /dev/null +++ b/blueprints/reference_templates/holmes-rules.yaml-template @@ -0,0 +1,81 @@ +tosca_definitions_version: cloudify_dsl_1_3 +imports: +- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml" +- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dcaepolicyplugin/1/dcaepolicyplugin_types.yaml" +- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml" +- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/1.1.0/pgaas_types.yaml" +inputs: + docker_host_override: + type: string + default: "component_dockerhost" + dh_location_id: + type: string + default: "zone1" + msb_hostname: + type: string + default: "" + location_domain: + type: string + location_prefix: + type: string + pgaas_cluster_name: + type: string + # use the single-VM PG instance + default: pgvm + database_name: + type: string + default: holmes +node_templates: + pgaasvm: + type: dcae.nodes.pgaas.database + properties: + writerfqdn: { concat: [ { get_input: location_prefix }, '-', { get_input: pgaas_cluster_name }, '-write.', { get_input: location_domain } ] } + name: { get_input: database_name } + docker_holmes_host: + type: dcae.nodes.SelectedDockerHost + properties: + docker_host_override: + get_input: docker_host_override + location_id: + get_input: dh_location_id + holmesrules: + type: dcae.nodes.DockerContainerForComponentsUsingDmaap + interfaces: + cloudify.interfaces.lifecycle: + start: + inputs: + envs: + URL_JDBC: + { get_attribute: [ pgaasvm, admin, host ] } + JDBC_PASSWORD: + { get_attribute: [ pgaasvm, admin, password ] } + JDBC_USERNAME: + { get_attribute: [ pgaasvm, admin, user ] } + MSB_ADDR: + get_input: msb_hostname + properties: + application_config: + holmes.default.rule.volte.scenario1: "ControlLoop-VOLTE-2179b738-fd36-4843-a71a-a8c24c70c55b$$$package org.onap.holmes.droolsRule;\n\nimport org.onap.holmes.common.dmaap.DmaapService;\nimport org.onap.holmes.common.api.stat.VesAlarm;\nimport org.onap.holmes.common.aai.CorrelationUtil;\nimport org.onap.holmes.common.dmaap.entity.PolicyMsg;\nimport org.onap.holmes.common.dropwizard.ioc.utils.ServiceLocatorHolder;\nimport org.onap.holmes.common.utils.DroolsLog;\n \n\nrule \"Relation_analysis_Rule\"\nsalience 200\nno-loop true\n when\n $root : VesAlarm(alarmIsCleared == 0,\n $sourceId: sourceId, sourceId != null && !sourceId.equals(\"\"),\n\t\t\t$sourceName: sourceName, sourceName != null && !sourceName.equals(\"\"),\n\t\t\t$startEpochMicrosec: startEpochMicrosec,\n eventName in (\"Fault_MultiCloud_VMFailure\"),\n $eventId: eventId)\n $child : VesAlarm( eventId != $eventId, parentId == null,\n CorrelationUtil.getInstance().isTopologicallyRelated(sourceId, $sourceId, $sourceName),\n eventName in (\"Fault_MME_eNodeB out of service alarm\"),\n startEpochMicrosec < $startEpochMicrosec + 60000 && startEpochMicrosec > $startEpochMicrosec - 60000 )\n then\n\t\tDroolsLog.printInfo(\"===========================================================\");\n\t\tDroolsLog.printInfo(\"Relation_analysis_Rule: rootId=\" + $root.getEventId() + \", childId=\" + $child.getEventId());\n\t\t$child.setParentId($root.getEventId());\n\t\tupdate($child);\n\t\t\nend\n\nrule \"root_has_child_handle_Rule\"\nsalience 150\nno-loop true\n\twhen\n\t\t$root : VesAlarm(alarmIsCleared == 0, rootFlag == 0, $eventId: eventId)\n\t\t$child : VesAlarm(eventId != $eventId, parentId == $eventId)\n\tthen\n\t\tDroolsLog.printInfo(\"===========================================================\");\n\t\tDroolsLog.printInfo(\"root_has_child_handle_Rule: rootId=\" + $root.getEventId() + \", childId=\" + $child.getEventId());\n\t\tDmaapService dmaapService = ServiceLocatorHolder.getLocator().getService(DmaapService.class);\n\t\tPolicyMsg policyMsg = dmaapService.getPolicyMsg($root, $child, \"org.onap.holmes.droolsRule\");\n dmaapService.publishPolicyMsg(policyMsg, \"unauthenticated.DCAE_CL_OUTPUT\");\n\t\t$root.setRootFlag(1);\n\t\tupdate($root);\nend\n\nrule \"root_no_child_handle_Rule\"\nsalience 100\nno-loop true\n when\n $root : VesAlarm(alarmIsCleared == 0, rootFlag == 0,\n sourceId != null && !sourceId.equals(\"\"),\n\t\t\tsourceName != null && !sourceName.equals(\"\"),\n eventName in (\"Fault_MultiCloud_VMFailure\"))\n then\n\t\tDroolsLog.printInfo(\"===========================================================\");\n\t\tDroolsLog.printInfo(\"root_no_child_handle_Rule: rootId=\" + $root.getEventId());\n\t\tDmaapService dmaapService = ServiceLocatorHolder.getLocator().getService(DmaapService.class);\n\t\tPolicyMsg policyMsg = dmaapService.getPolicyMsg($root, null, \"org.onap.holmes.droolsRule\");\n dmaapService.publishPolicyMsg(policyMsg, \"unauthenticated.DCAE_CL_OUTPUT\");\n\t\t$root.setRootFlag(1);\n\t\tupdate($root);\nend\n\nrule \"root_cleared_handle_Rule\"\nsalience 100\nno-loop true\n when\n $root : VesAlarm(alarmIsCleared == 1, rootFlag == 1)\n then\n\t\tDroolsLog.printInfo(\"===========================================================\");\n\t\tDroolsLog.printInfo(\"root_cleared_handle_Rule: rootId=\" + $root.getEventId());\n\t\tDmaapService dmaapService = ServiceLocatorHolder.getLocator().getService(DmaapService.class);\n\t\tPolicyMsg policyMsg = dmaapService.getPolicyMsg($root, null, \"org.onap.holmes.droolsRule\");\n dmaapService.publishPolicyMsg(policyMsg, \"unauthenticated.DCAE_CL_OUTPUT\");\n\t\tretract($root);\nend\n\nrule \"child_handle_Rule\"\nsalience 100\nno-loop true\n when\n $child : VesAlarm(alarmIsCleared == 1, rootFlag == 0)\n then\n\t\tDroolsLog.printInfo(\"===========================================================\");\n\t\tDroolsLog.printInfo(\"child_handle_Rule: childId=\" + $child.getEventId());\n\t\tretract($child);\nend" + msb.hostname: + get_input: msb_hostname + msb.uri: /api/microservices/v1/services + services_calls: {} + streams_publishes: {} + streams_subscribes: {} + docker_config: + healthcheck: + endpoint: /api/holmes-rule-mgmt/v1/healthcheck + interval: 15s + timeout: 1s + type: http + ports: + - 9101:9101 + image: "{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/holmes/rule-management:v1.0.0" + location_id: + get_input: dh_location_id + service_component_type: dcae-analytics-holmes-rule-management + relationships: + - type: cloudify.relationships.depends_on + target: pgaasvm + - target: docker_holmes_host + type: dcae.relationships.component_contained_in diff --git a/blueprints/reference_templates/inventory.yaml-template b/blueprints/reference_templates/inventory.yaml-template new file mode 100644 index 0000000..c427f8c --- /dev/null +++ b/blueprints/reference_templates/inventory.yaml-template @@ -0,0 +1,196 @@ +# -*- indent-tabs-mode: nil -*- # vi: set expandtab: +# +# ============LICENSE_START==================================================== +# org.onap.dcae +# ============================================================================= +# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. +# ============================================================================= +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END====================================================== + +tosca_definitions_version: cloudify_dsl_1_3 + +description: > + This blueprint is used to install and to uninstall DCAE inventory and DCAE service change + handler which are platform services. These applications are Docker containers. This blueprint + depends upon the deployment of a Docker host and the deployment of a central postgres that is + registered with Consul. + +imports: + - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml + +inputs: + + location_id: + description: Location of where to deploy to + + docker_host_override: + description: Target docker host to deploy applications to + sdc_address: + description: SDC host + sdc_uri: + description: SDC url + sdc_msg_bus_address: + description: Message router hostname that SDC will send distribution events through + sdc_user: + description: SDC username + sdc_password: + description: SDC password + sdc_environment_name: + description: SDC environment name + sdc_use_secure_https: + description: Boolean to toggle whether to do certificate validation for https calls to SDC API + type: boolean + default: false + sdc_use_https_dmaap: + description: Boolean to toggle whether to use https for calls to message router API + type: boolean + default: false + + postgres_user_inventory: + description: Postgres user for inventory + postgres_password_inventory: + description: Postgres password for inventory + + service_change_handler_image: + description: Full uri to service change handler Docker image + inventory_image: + description: Full uri to inventory Docker image + +node_templates: + + service-change-handler: + type: dcae.nodes.DockerContainerForPlatforms + properties: + name: + "service-change-handler" + application_config: + asdcDistributionClient: + asdcAddress: { get_input: sdc_address } + asdcUri: { get_input: sdc_uri } + msgBusAddress: { get_input: sdc_msg_bus_address } + user: { get_input: sdc_user } + password: { get_input: sdc_password } + pollingInterval: 20 + pollingTimeout: 20 + consumerGroup: dcae + consumerId: dcae-sch + environmentName: { get_input: sdc_environment_name } + keyStorePath: + keyStorePassword: + activateServerTLSAuth: { get_input: sdc_use_secure_https } + useHttpsWithDmaap: { get_input: sdc_use_https_dmaap } + isFilterInEmptyResources: false + dcaeInventoryClient: + uri: http://inventory:8080 + docker_config: + healthcheck: + type: "docker" + interval: "30s" + timeout: "3s" + script: "/opt/health.sh" + image: + { get_input: service_change_handler_image } + relationships: + - type: cloudify.relationships.depends_on + target: inventory + - type: dcae.relationships.component_contained_in + target: docker_host + + inventory: + type: dcae.nodes.DockerContainerForPlatforms + properties: + name: + "inventory" + application_config: + database: + driverClass: org.postgresql.Driver + user: { get_input: postgres_user_inventory } + password: { get_input: postgres_password_inventory } + # NOTE: The database name here has been changed to the default "postgres" database + # to use the private postgres instance and not the central postgres database. + url: jdbc:postgresql://pstg-write:5432/postgres + properties: + charSet: UTF-8 + maxWaitForConnection: 1s + validationQuery: "/* MyService Health Check */ SELECT 1" + minSize: 2 + maxSize: 8 + initialSize: 2 + checkConnectionWhileIdle: false + evictionInterval: 10s + minIdleTime: 1 minute + databusControllerConnection: + host: databus-controller-hostname + port: 8443 + mechId: + password: + required: false + httpClient: + minThreads: 1 + maxThreads: 128 + gzipEnabled: false + gzipEnabledForRequests: false + timeout: 5000milliseconds + connectionTimeout: 5000milliseconds + docker_config: + healthcheck: + type: "http" + interval: "30s" + timeout: "3s" + endpoint: "/dcae-service-types" + image: + { get_input: inventory_image } + host_port: + 8080 + container_port: + 8080 + relationships: + - type: dcae.relationships.component_contained_in + target: docker_host + - type: cloudify.relationships.depends_on + target: postgres + + postgres: + type: dcae.nodes.DockerContainer + properties: + name: + "pstg-write" + image: + "postgres:9.5.2" + relationships: + - type: dcae.relationships.component_contained_in + target: docker_host + interfaces: + cloudify.interfaces.lifecycle: + start: + inputs: + envs: + PGDATA: + "/var/lib/postgresql/data/pgdata" + POSTGRES_PASSWORD: + { get_input: postgres_password_inventory } + SERVICE_NAME: + "pstg-write" + ports: + - "5432:5432" + + docker_host: + type: dcae.nodes.SelectedDockerHost + properties: + location_id: + { get_input: location_id } + docker_host_override: + { get_input: docker_host_override } diff --git a/blueprints/reference_templates/pgaas-cluster.yaml-template b/blueprints/reference_templates/pgaas-cluster.yaml-template new file mode 100644 index 0000000..d7b0cd0 --- /dev/null +++ b/blueprints/reference_templates/pgaas-cluster.yaml-template @@ -0,0 +1,435 @@ +# -*- indent-tabs-mode: nil -*- # vi: set expandtab: +# +# ============LICENSE_START==================================================== +# org.onap.dcae +# ============================================================================= +# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. +# ============================================================================= +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END====================================================== + +tosca_definitions_version: cloudify_dsl_1_3 + +description: |- + This blueprint is used to install and to uninstall a central postgres as a platform service. + This blueprint depends upon the deployment of the pgaas_plugin, the PGaaS Cinder volume, and Consul. + This blueprint is part of a suite of three blueprints that allow a PGaaS + cluster to be created that has persistent databases stored in Cinder. + pgaas-disk allocates the cinder volumes. It must be run first. + pgaas-cluster creates the PG service and attaches the cinder volumes. It must be run second. + pgaas-database creates a database. It must be run third, for each persistent database. + If the cluster is uninstalled, the persistent databases are unaffected. + If a database blueprint is uninstalled, the persistent database goes away. + If the disk blueprint is uninstalled, all persistent databases go away, along with the server instance. + +imports: + - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml + - http://www.getcloudify.org/spec/openstack-plugin/1.4/plugin.yaml + - http://www.getcloudify.org/spec/fabric-plugin/1.4.1/plugin.yaml + + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/dnsdesig/dns_types.yaml" + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml" + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/1.1.0/pgaas_types.yaml" + +inputs: + blueprint_version: + type: string + default: '2018-04-27T00:31:38+0000' + + # pgaas-specific info + pgaas_cluster_name: + type: string + default: pgcl + +{{ ONAPTEMPLATE_STANDARD_INPUTS_TYPES }} + + vm_init_pgrs: + type: string + default: | + #!/bin/sh + echo All output will be found in /tmp/ins.out and /tmp/ins.err + exec > /tmp/ins.out 2> /tmp/ins.err + set -x + if [ "$(dnsdomainname 2>/dev/null)" = "" ] + then + echo WARNING WARNING WARNING + echo The DNS DHCP settings did not work properly. + for i in $(seq 20) + do + echo Sleeping... + sleep 10 + if [ "$(dnsdomainname 2>/dev/null)" != "" ] + then break + fi + echo The DNS DHCP settings still did not work properly. + done + if [ "$(dnsdomainname 2>/dev/null)" = "" ] + then + echo Exiting + exit 1 + fi + fi + + CONFDIR=/var/config/DCAE/chef/ + mkdir -p $CONFDIR + + CONF=$CONFDIR/pgaas-postgres.conf + cat < $CONF + master: ${MASTER%%.*} + secondmaster: notused + DRTR_NODE_KSTOREFILE: /opt/app/dcae-certificate/keystore.jks + DRTR_NODE_KSTOREPASS: "No Certificate" + DRTR_NODE_PVTKEYPASS: "No Certificate" + PG_NODES: $PG_NODES + PG_JAVA_HOME : /opt/app/java/jdk/jdk170 + PG_CLUSTER: central + EOF + + apt-get update + + # invoking apt-get separately allows a failure to be ignored + for i in openjdk-7-jdk openjdk-8-jdk python-pip python3-pip curl gawk; do apt-get install -y $i;done + pip install pyyaml + + # prevent servers from starting + echo "exit 101" > /usr/sbin/policy-rc.d; chmod a+x /usr/sbin/policy-rc.d + + # invoking apt-get separately allows a failure to be ignored + for i in postgresql libpq5 repmgr python-psycopg2 python3-psycopg2 libgetopt-java; do apt-get install -y $i; done + + # allow servers to autostart again + rm -f /usr/sbin/policy-rc.d + + ( umask 077; sed 's/^/*:*:*:postgres:/' < /root/.pgrspw > ~postgres/.pgpass; chown postgres:postgres ~postgres/.pgpass ) + + if [ ! -f $CONF ] + then echo "$CONF does not exist" 1>&2; exit 1 + fi + + echo Look in /tmp/pgaas.out for output from installing PGaaS + NEXUS={{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_storage_pgaas_debs_releases }}/debs + for pkg in cdf.deb-1.0.0 pgaas.deb-1.0.0 + do + OUT=/tmp/$pkg + curl -s -k -f -o $OUT $NEXUS/$pkg + dpkg --install $OUT + done + + case $(hostname) in + *00 ) WRITE=-write ;; + *01 ) WRITE= ;; + esac + curl -v -X PUT -H "Content-Type: application/json" "http://${LOCATION_PREFIX}cnsl00.${LOCATION_DOMAIN}:8500/v1/agent/service/register" -d "{\"name\" : \"${CLUSTER_NAME}${WRITE}\", \"Address\" : \"${LOCAL_IP}\", \"Port\" : 5432}" + + echo ALL DONE + +node_templates: + key_pair: + type: cloudify.openstack.nodes.KeyPair + properties: + private_key_path: { get_input: key_filename } + use_external_resource: True + resource_id: { get_input: keypair } + openstack_config: &open_conf + get_input: openstack + private_net: + type: cloudify.openstack.nodes.Network + properties: + use_external_resource: True + resource_id: { get_input: private_net } + openstack_config: *open_conf + security_group: + type: cloudify.openstack.nodes.SecurityGroup + properties: + use_external_resource: True + resource_id: { get_input: security_group } + openstack_config: *open_conf + + fixedip_pgrs00: + type: cloudify.openstack.nodes.Port + properties: + port: + extra_dhcp_opts: + - opt_name: 'domain-name' + opt_value: { get_input: location_domain } + openstack_config: *open_conf + relationships: + - type: cloudify.relationships.contained_in + target: private_net + floatingip_pgrs00: + type: cloudify.openstack.nodes.FloatingIP + properties: + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + floating_network_name: { get_input: public_net } + dns_pgrs00: + type: ccsdk.nodes.dns.arecord + properties: + fqdn: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '00.', { get_input: location_domain } ] } + openstack: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + ip_addresses: + - { get_attribute: [ floatingip_pgrs00, floating_ip_address ] } + relationships: + - type: cloudify.relationships.depends_on + target: floatingip_pgrs00 + host_pgrs00: + type: cloudify.openstack.nodes.Server + properties: + install_agent: false + image: { get_input: ubuntu1604image_id } + flavor: { get_input: flavor_id } + management_network_name: { get_input: private_net } + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + name: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '00' ] } + userdata: + concat: + - |- + #!/bin/sh + mkdir /root/.sshkey + echo ' + - { get_attribute: [ pgaas_cluster, public ] } + - |- + ' >/root/.sshkey/id_rsa.pub + echo ' + - { get_attribute: [ pgaas_cluster, base64private ] } + - |- + ' | base64 -d >/root/.sshkey/id_rsa + chmod 700 /root/.sshkey + chmod 600 /root/.sshkey/* + ( umask 077; echo -n postgres | cat - /root/.sshkey/id_rsa | md5sum | awk '{ print $1 }' > /root/.pgrspw ) + set -x + - "\n" + - "CLUSTER_NAME='" + - { get_input: pgaas_cluster_name } + - "'\n" + - "LOCATION_PREFIX='" + - { get_input: location_prefix } + - "'\n" + - "LOCATION_DOMAIN='" + - { get_input: location_domain } + - "'\n" + - "MASTER='" + - { get_property: [ dns_pgrs00, fqdn ] } + - "'\n" + - "LOCAL_IP='" + - { get_attribute: [ floatingip_pgrs00, floating_ip_address ] } + - "'\n" + - "PG_NODES='" + - { get_property: [ dns_pgrs00, fqdn ] } + - '|' + - { get_property: [ dns_pgrs01, fqdn ] } + - "'\n" + - { get_input: vm_init_pgrs } + relationships: + - type: cloudify.openstack.server_connected_to_port + target: fixedip_pgrs00 + - type: cloudify.openstack.server_connected_to_security_group + target: security_group + - type: cloudify.openstack.server_connected_to_floating_ip + target: floatingip_pgrs00 + - type: cloudify.openstack.server_connected_to_keypair + target: key_pair + - type: cloudify.relationships.depends_on + target: dns_pgrs00 + - type: cloudify.relationships.depends_on + target: pgaas_cluster + fixedip_pgrs01: + type: cloudify.openstack.nodes.Port + properties: + port: + extra_dhcp_opts: + - opt_name: 'domain-name' + opt_value: { get_input: location_domain } + openstack_config: *open_conf + relationships: + - type: cloudify.relationships.contained_in + target: private_net + floatingip_pgrs01: + type: cloudify.openstack.nodes.FloatingIP + properties: + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + floating_network_name: { get_input: public_net } + dns_pgrs01: + type: ccsdk.nodes.dns.arecord + properties: + fqdn: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '01.', { get_input: location_domain } ] } + openstack: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + ip_addresses: + - { get_attribute: [ floatingip_pgrs01, floating_ip_address ] } + relationships: + - type: cloudify.relationships.depends_on + target: floatingip_pgrs01 + host_pgrs01: + type: cloudify.openstack.nodes.Server + properties: + install_agent: false + image: { get_input: ubuntu1604image_id } + flavor: { get_input: flavor_id } + management_network_name: { get_input: private_net } + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + name: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '01' ] } + userdata: + concat: + - |- + #!/bin/sh + mkdir /root/.sshkey + echo ' + - { get_attribute: [ pgaas_cluster, public ] } + - |- + ' >/root/.sshkey/id_rsa.pub + echo ' + - { get_attribute: [ pgaas_cluster, base64private ] } + - |- + ' | base64 -d >/root/.sshkey/id_rsa + chmod 700 /root/.sshkey + chmod 600 /root/.sshkey/* + ( umask 077; echo -n postgres | cat - /root/.sshkey/id_rsa | md5sum | awk '{ print $1 }' > /root/.pgrspw ) + set -x + - "\n" + - "CLUSTER_NAME='" + - { get_input: pgaas_cluster_name } + - "'\n" + - "LOCATION_PREFIX='" + - { get_input: location_prefix } + - "'\n" + - "LOCATION_DOMAIN='" + - { get_input: location_domain } + - "'\n" + - "MASTER='" + - { get_property: [ dns_pgrs00, fqdn ] } + - "'\n" + - "LOCAL_IP='" + - { get_attribute: [ floatingip_pgrs01, floating_ip_address ] } + - "'\n" + - "PG_NODES='" + - { get_property: [ dns_pgrs00, fqdn ] } + - '|' + - { get_property: [ dns_pgrs01, fqdn ] } + - "'\n" + - { get_input: vm_init_pgrs } + relationships: + - type: cloudify.openstack.server_connected_to_port + target: fixedip_pgrs01 + - type: cloudify.openstack.server_connected_to_security_group + target: security_group + - type: cloudify.openstack.server_connected_to_floating_ip + target: floatingip_pgrs01 + - type: cloudify.openstack.server_connected_to_keypair + target: key_pair + - type: cloudify.relationships.depends_on + target: dns_pgrs01 + - type: cloudify.relationships.depends_on + target: pgaas_cluster + + # cinder connections + volume_pgrs00: + type: cloudify.openstack.nodes.Volume + properties: + resource_id: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '00' ] } + openstack_config: *open_conf + use_external_resource: True + relationships: + - type: cloudify.openstack.volume_attached_to_server + target: host_pgrs00 + + volume_pgrs01: + type: cloudify.openstack.nodes.Volume + properties: + resource_id: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '01' ] } + openstack_config: *open_conf + use_external_resource: True + relationships: + - type: cloudify.openstack.volume_attached_to_server + target: host_pgrs01 + + # CNAME records + dns_pgrs_rw: + type: ccsdk.nodes.dns.cnamerecord + properties: + fqdn: { concat: [ { get_input: location_prefix }, '-', { get_input: pgaas_cluster_name }, '-write.', { get_input: location_domain } ] } + openstack: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + cname: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '00.', { get_input: location_domain } ] } + + dns_pgrs_ro: + type: ccsdk.nodes.dns.cnamerecord + properties: + fqdn: { concat: [ { get_input: location_prefix }, '-', { get_input: pgaas_cluster_name }, '.', { get_input: location_domain } ] } + openstack: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + cname: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '00.', { get_input: location_domain } ] } + + # tie to pgaas_plugin database + pgaas_cluster: + type: dcae.nodes.pgaas.cluster + properties: + writerfqdn: { get_property: [ dns_pgrs_rw, fqdn ] } + use_existing: true + relationships: + - type: cloudify.relationships.depends_on + target: dns_pgrs_rw + - type: cloudify.relationships.depends_on + target: dns_pgrs_ro + +outputs: + public_ip00: + value: { get_attribute: [host_pgrs00, ip] } + public_ip01: + value: { get_attribute: [host_pgrs01, ip] } + writerfqdn: + value: { get_property: [ dns_pgrs_rw, fqdn ] } + readerfqdn: + value: { get_property: [ dns_pgrs_ro, fqdn ] } + dns_pgrs00: + value: { get_property: [ dns_pgrs00, fqdn ] } + dns_pgrs01: + value: { get_property: [ dns_pgrs01, fqdn ] } + blueprint_version: + value: { get_input: blueprint_version } diff --git a/blueprints/reference_templates/pgaas-database.yaml-template b/blueprints/reference_templates/pgaas-database.yaml-template new file mode 100644 index 0000000..a89d638 --- /dev/null +++ b/blueprints/reference_templates/pgaas-database.yaml-template @@ -0,0 +1,63 @@ +# -*- indent-tabs-mode: nil -*- # vi: set expandtab: +# +# ============LICENSE_START==================================================== +# org.onap.dcae +# ============================================================================= +# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. +# ============================================================================= +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END====================================================== + +tosca_definitions_version: cloudify_dsl_1_3 + +description: |- + This blueprint is used to install and to uninstall a persistent database into the central postgres as a platform service. + This blueprint depends upon the deployment of the pgaas_plugin, the PGaaS Cinder volume, the PGaaS service, and Consul. + This blueprint is part of a suite of three blueprints that allow a PGaaS + cluster to be created that has persistent databases stored in Cinder. + pgaas-disk allocates the cinder volumes. It must be run first. + pgaas-cluster creates the PG service and attaches the cinder volumes. It must be run second. + pgaas-database creates a database. It must be run third, for each persistent database. + If the cluster is uninstalled, the persistent databases are unaffected. + If a database blueprint is uninstalled, the persistent database goes away. + If the disk blueprint is uninstalled, all persistent databases go away, along with the server instance. + +imports: + - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml + + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/1.1.0/pgaas_types.yaml" + +inputs: + blueprint_version: + type: string + default: '2018-03-29T14:28:59+0000' + + # pgaas-specific info + pgaas_cluster_name: + type: string + default: pgcl + database_description: + type: string + default: 'This is a sample database' + database_name: + type: string + default: sample + +{{ ONAPTEMPLATE_STANDARD_INPUTS_TYPES }} + +node_templates: + pgaasdbtest: + type: dcae.nodes.pgaas.database + properties: + writerfqdn: { concat: [ { get_input: location_prefix }, '-', { get_input: pgaas_cluster_name }, '-write.', { get_input: location_domain } ] } + name: { get_input: database_name } diff --git a/blueprints/reference_templates/pgaas-disk.yaml-template b/blueprints/reference_templates/pgaas-disk.yaml-template new file mode 100644 index 0000000..3f96bae --- /dev/null +++ b/blueprints/reference_templates/pgaas-disk.yaml-template @@ -0,0 +1,123 @@ +# -*- indent-tabs-mode: nil -*- # vi: set expandtab: +# +# ============LICENSE_START==================================================== +# org.onap.dcae +# ============================================================================= +# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. +# ============================================================================= +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END====================================================== + +tosca_definitions_version: cloudify_dsl_1_3 + +description: |- + This blueprint is used to install and to uninstall the cinder volumes for + a central postgres as a platform service. + This blueprint depends upon the deployment of Consul and the pgaas_plugin. + This blueprint is part of a suite of three blueprints that allow a PGaaS + cluster to be created that has persistent databases stored in Cinder. + pgaas-disk allocates the cinder volumes. It must be run first. + pgaas-cluster creates the PG service and attaches the cinder volumes. It must be run second. + pgaas-database creates a database. It must be run third, for each persistent database. + If the cluster is uninstalled, the persistent databases are unaffected. + If a database blueprint is uninstalled, the persistent database goes away. + If the disk blueprint is uninstalled, all persistent databases go away, along with the server instance. + +imports: + - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml + - http://www.getcloudify.org/spec/openstack-plugin/1.4/plugin.yaml + - http://www.getcloudify.org/spec/fabric-plugin/1.4.1/plugin.yaml + + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/dnsdesig/dns_types.yaml" + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/sshkeyshare/sshkey_types.yaml" + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml" + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/1.1.0/pgaas_types.yaml" + +inputs: + blueprint_version: + type: string + default: '2018-04-27T00:31:38+0000' + + # pgaas-specific info + pgaas_cluster_name: + type: string + default: pgcl + cinder_volume_size: + type: string + default: 300 + +{{ ONAPTEMPLATE_STANDARD_INPUTS_TYPES }} + +node_templates: + key_pair: + type: cloudify.openstack.nodes.KeyPair + properties: + private_key_path: { get_input: key_filename } + use_external_resource: True + resource_id: { get_input: keypair } + openstack_config: &open_conf + get_input: openstack + + sharedsshkey_pgrs: + type: ccsdk.nodes.ssh.keypair + + private_net: + type: cloudify.openstack.nodes.Network + properties: + use_external_resource: True + resource_id: { get_input: private_net } + openstack_config: *open_conf + + security_group: + type: cloudify.openstack.nodes.SecurityGroup + properties: + use_external_resource: True + resource_id: { get_input: security_group } + openstack_config: *open_conf + + volume_pgrs00: + type: cloudify.openstack.nodes.Volume + properties: + resource_id: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '00' ] } + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + size: { get_input: cinder_volume_size } + + volume_pgrs01: + type: cloudify.openstack.nodes.Volume + properties: + resource_id: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '01' ] } + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + size: { get_input: cinder_volume_size } + + pgaas_cluster: + type: dcae.nodes.pgaas.cluster + properties: + writerfqdn: { concat: [ { get_input: location_prefix }, '-', { get_input: pgaas_cluster_name }, '-write.', { get_input: location_domain } ] } + readerfqdn: { concat: [ { get_input: location_prefix }, '-', { get_input: pgaas_cluster_name }, '.', { get_input: location_domain } ] } + relationships: + - type: dcae.relationships.pgaas_cluster_uses_sshkeypair + target: sharedsshkey_pgrs + +outputs: + blueprint_version: + value: { get_input: blueprint_version } diff --git a/blueprints/reference_templates/pgaas-getdbinfo.yaml-template b/blueprints/reference_templates/pgaas-getdbinfo.yaml-template new file mode 100644 index 0000000..8672f04 --- /dev/null +++ b/blueprints/reference_templates/pgaas-getdbinfo.yaml-template @@ -0,0 +1,92 @@ +# -*- indent-tabs-mode: nil -*- # vi: set expandtab: +# +# ============LICENSE_START==================================================== +# org.onap.dcae +# ============================================================================= +# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. +# ============================================================================= +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END====================================================== + +tosca_definitions_version: cloudify_dsl_1_3 + +description: |- + This blueprint is an example of how an application can access the needed information about + a persistent database created as part of a PGaaS cluster. + + For a given database "dbname" on a given PGaaS cluster "PGCLUSTERNAME", + there are three roles created: + admin role: has complete administrative control over that database + user role: has complete read and write access on that database + viewer role: only has read access on that database + The various attributes will return the appropriate information + that can be used with that role: host fqdn, role name and password. + +imports: + - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml + + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/1.1.0/pgaas_types.yaml" + +inputs: + location_domain: + type: string + location_prefix: + type: string + pgaas_cluster_name: + type: string + default: pgcl + database_name: + type: string + default: sample + +node_templates: + pgclustername_dbname: + type: dcae.nodes.pgaas.database + properties: + writerfqdn: { concat: [ { get_input: location_prefix }, '-', { get_input: pgaas_cluster_name }, '-write.', { get_input: location_domain } ] } + name: { get_input: database_name } + use_existing: true + +outputs: + # admin role has control over table/index/view creation/dropping + pgclustername_dbname_admin_host: + description: Hostname for PGCLUSTERNAME dbname database + value: { get_attribute: [ pgclustername_dbname, admin, host ] } + pgclustername_dbname_admin_user: + description: Admin Username for PGCLUSTERNAME dbname database + value: { get_attribute: [ pgclustername_dbname, admin, user ] } + pgclustername_dbname_admin_password: + description: Admin Password for PGCLUSTERNAME dbname database + value: { get_attribute: [ pgclustername_dbname, admin, password ] } + + # user role can read and write the tables + pgclustername_dbname_user_host: + description: Hostname for PGCLUSTERNAME dbname database + value: { get_attribute: [ pgclustername_dbname, user, host ] } + pgclustername_dbname_user_user: + description: User Username for PGCLUSTERNAME dbname database + value: { get_attribute: [ pgclustername_dbname, user, user ] } + pgclustername_dbname_user_password: + description: User Password for PGCLUSTERNAME dbname database + value: { get_attribute: [ pgclustername_dbname, user, password ] } + + # viewer role can only read from the tables + pgclustername_dbname_viewer_host: + description: Hostname for PGCLUSTERNAME dbname database + value: { get_attribute: [ pgclustername_dbname, viewer, host ] } + pgclustername_dbname_viewer_user: + description: Viewer Username for PGCLUSTERNAME dbname database + value: { get_attribute: [ pgclustername_dbname, viewer, user ] } + pgclustername_dbname_viewer_password: + description: Viewer Password for PGCLUSTERNAME dbname database + value: { get_attribute: [ pgclustername_dbname, viewer, password ] } diff --git a/blueprints/reference_templates/pgaas-onevm.yaml-template b/blueprints/reference_templates/pgaas-onevm.yaml-template new file mode 100644 index 0000000..be2d044 --- /dev/null +++ b/blueprints/reference_templates/pgaas-onevm.yaml-template @@ -0,0 +1,300 @@ +# -*- indent-tabs-mode: nil -*- # vi: set expandtab: +# +# ============LICENSE_START==================================================== +# org.onap.dcae +# ============================================================================= +# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. +# ============================================================================= +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END====================================================== + +tosca_definitions_version: cloudify_dsl_1_3 + +description: |- + This blueprint is used to install and to uninstall a single-VM central postgres as a platform service. + This blueprint depends upon the deployment of the pgaas_plugin and Consul. + +imports: + - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml + - http://www.getcloudify.org/spec/openstack-plugin/1.4/plugin.yaml + - http://www.getcloudify.org/spec/fabric-plugin/1.4.1/plugin.yaml + + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/dnsdesig/dns_types.yaml" + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/sshkeyshare/sshkey_types.yaml" + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml" + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/1.1.0/pgaas_types.yaml" + +inputs: + blueprint_version: + type: string + default: '2018-04-27T00:31:38+0000' + + # pgaas-specific info + pgaas_cluster_name: + type: string + default: pgvm + +{{ ONAPTEMPLATE_STANDARD_INPUTS_TYPES }} + + vm_init_pgrs: + type: string + default: | + #!/bin/sh + echo All output will be found in /tmp/ins.out and /tmp/ins.err + exec > /tmp/ins.out 2> /tmp/ins.err + set -x + if [ "$(dnsdomainname 2>/dev/null)" = "" ] + then + echo WARNING WARNING WARNING + echo The DNS DHCP settings did not work properly. + for i in $(seq 20) + do + echo Sleeping... + sleep 10 + if [ "$(dnsdomainname 2>/dev/null)" != "" ] + then break + fi + echo The DNS DHCP settings still did not work properly. + done + if [ "$(dnsdomainname 2>/dev/null)" = "" ] + then + echo Exiting + exit 1 + fi + fi + + CONFDIR=/var/config/DCAE/chef/ + mkdir -p $CONFDIR + + CONF=$CONFDIR/pgaas-postgres.conf + cat < $CONF + master: ${MASTER%%.*} + secondmaster: notused + DRTR_NODE_KSTOREFILE: /opt/app/dcae-certificate/keystore.jks + DRTR_NODE_KSTOREPASS: "No Certificate" + DRTR_NODE_PVTKEYPASS: "No Certificate" + PG_NODES: $PG_NODES + PG_JAVA_HOME : /opt/app/java/jdk/jdk170 + PG_CLUSTER: central + EOF + + apt-get update + + # invoking apt-get separately allows a failure to be ignored + for i in openjdk-7-jdk openjdk-8-jdk python-pip python3-pip curl gawk; do apt-get install -y $i;done + pip install pyyaml + + # prevent servers from starting + echo "exit 101" > /usr/sbin/policy-rc.d; chmod a+x /usr/sbin/policy-rc.d + + # invoking apt-get separately allows a failure to be ignored + for i in postgresql libpq5 repmgr python-psycopg2 python3-psycopg2 libgetopt-java; do apt-get install -y $i; done + + # allow servers to autostart again + rm -f /usr/sbin/policy-rc.d + + ( umask 077; sed 's/^/*:*:*:postgres:/' < /root/.pgrspw > ~postgres/.pgpass; chown postgres:postgres ~postgres/.pgpass ) + + if [ ! -f $CONF ] + then echo "$CONF does not exist" 1>&2; exit 1 + fi + + echo Look in /tmp/pgaas.out for output from installing PGaaS + NEXUS={{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_storage_pgaas_debs_releases }}/debs + for pkg in cdf.deb-1.0.0 pgaas.deb-1.0.0 + do + OUT=/tmp/$pkg + curl -s -k -f -o $OUT $NEXUS/$pkg + dpkg --install $OUT + done + + curl -v -X PUT -H "Content-Type: application/json" "http://${LOCATION_PREFIX}cnsl00.${LOCATION_DOMAIN}:8500/v1/agent/service/register" -d "{\"name\" : \"${CLUSTER_NAME}-write\", \"Address\" : \"${LOCAL_IP}\", \"Port\" : 5432}\"" + curl -v -X PUT -H "Content-Type: application/json" "http://${LOCATION_PREFIX}cnsl00.${LOCATION_DOMAIN}:8500/v1/agent/service/register" -d "{\"name\" : \"${CLUSTER_NAME}\", \"Address\" : \"${LOCAL_IP}\", \"Port\" : 5432}" + + echo ALL DONE + +node_templates: + key_pair: + type: cloudify.openstack.nodes.KeyPair + properties: + private_key_path: { get_input: key_filename } + use_external_resource: True + resource_id: { get_input: keypair } + openstack_config: &open_conf + get_input: openstack + private_net: + type: cloudify.openstack.nodes.Network + properties: + use_external_resource: True + resource_id: { get_input: private_net } + openstack_config: *open_conf + security_group: + type: cloudify.openstack.nodes.SecurityGroup + properties: + use_external_resource: True + resource_id: { get_input: security_group } + openstack_config: *open_conf + + sharedsshkey_pgrs: + type: ccsdk.nodes.ssh.keypair + + fixedip_pgrs00: + type: cloudify.openstack.nodes.Port + properties: + port: + extra_dhcp_opts: + - opt_name: 'domain-name' + opt_value: { get_input: location_domain } + openstack_config: *open_conf + relationships: + - type: cloudify.relationships.contained_in + target: private_net + floatingip_pgrs00: + type: cloudify.openstack.nodes.FloatingIP + properties: + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + floating_network_name: { get_input: public_net } + dns_pgrs00: + type: ccsdk.nodes.dns.arecord + properties: + fqdn: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '00.', { get_input: location_domain } ] } + openstack: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + ip_addresses: + - { get_attribute: [ floatingip_pgrs00, floating_ip_address ] } + relationships: + - type: cloudify.relationships.depends_on + target: floatingip_pgrs00 + host_pgrs00: + type: cloudify.openstack.nodes.Server + properties: + install_agent: false + image: { get_input: ubuntu1604image_id } + flavor: { get_input: flavor_id } + management_network_name: { get_input: private_net } + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + name: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '00' ] } + userdata: + concat: + - |- + #!/bin/sh + mkdir /root/.sshkey + echo ' + - { get_attribute: [ sharedsshkey_pgrs, public ] } + - |- + ' >/root/.sshkey/id_rsa.pub + echo ' + - { get_attribute: [ sharedsshkey_pgrs, base64private ] } + - |- + ' | base64 -d >/root/.sshkey/id_rsa + chmod 700 /root/.sshkey + chmod 600 /root/.sshkey/* + ( umask 077; echo -n postgres | cat - /root/.sshkey/id_rsa | md5sum | awk '{ print $1 }' > /root/.pgrspw ) + set -x + - "\n" + - "CLUSTER_NAME='" + - { get_input: pgaas_cluster_name } + - "'\n" + - "LOCATION_PREFIX='" + - { get_input: location_prefix } + - "'\n" + - "LOCATION_DOMAIN='" + - { get_input: location_domain } + - "'\n" + - "MASTER='" + - { get_property: [ dns_pgrs00, fqdn ] } + - "'\n" + - "LOCAL_IP='" + - { get_attribute: [ floatingip_pgrs00, floating_ip_address ] } + - "'\n" + - "PG_NODES='" + - { get_property: [ dns_pgrs00, fqdn ] } + - "'\n" + - { get_input: vm_init_pgrs } + relationships: + - type: cloudify.openstack.server_connected_to_port + target: fixedip_pgrs00 + - type: cloudify.openstack.server_connected_to_security_group + target: security_group + - type: cloudify.openstack.server_connected_to_floating_ip + target: floatingip_pgrs00 + - type: cloudify.openstack.server_connected_to_keypair + target: key_pair + - type: cloudify.relationships.depends_on + target: dns_pgrs00 + - type: cloudify.relationships.depends_on + target: sharedsshkey_pgrs + # CNAME records + dns_pgrs_rw: + type: ccsdk.nodes.dns.cnamerecord + properties: + fqdn: { concat: [ { get_input: location_prefix }, '-', { get_input: pgaas_cluster_name }, '-write.', { get_input: location_domain } ] } + openstack: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + cname: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '00.', { get_input: location_domain } ] } + + dns_pgrs_ro: + type: ccsdk.nodes.dns.cnamerecord + properties: + fqdn: { concat: [ { get_input: location_prefix }, '-', { get_input: pgaas_cluster_name }, '.', { get_input: location_domain } ] } + openstack: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + cname: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '00.', { get_input: location_domain } ] } + + # tie to pgaas_plugin database + pgaas_cluster: + type: dcae.nodes.pgaas.cluster + properties: + writerfqdn: { get_property: [ dns_pgrs_rw, fqdn ] } + readerfqdn: { get_property: [ dns_pgrs_ro, fqdn ] } + relationships: + - type: dcae.relationships.pgaas_cluster_uses_sshkeypair + target: sharedsshkey_pgrs + - type: cloudify.relationships.depends_on + target: dns_pgrs_rw + - type: cloudify.relationships.depends_on + target: dns_pgrs_ro + +outputs: + public_ip00: + value: { get_attribute: [host_pgrs00, ip] } + writerfqdn: + value: { get_property: [ dns_pgrs_rw, fqdn ] } + readerfqdn: + value: { get_property: [ dns_pgrs_ro, fqdn ] } + dns_pgrs00: + value: { get_property: [ dns_pgrs00, fqdn ] } + blueprint_version: + value: { get_input: blueprint_version } diff --git a/blueprints/reference_templates/pgaas.yaml-template b/blueprints/reference_templates/pgaas.yaml-template new file mode 100644 index 0000000..4a7e16a --- /dev/null +++ b/blueprints/reference_templates/pgaas.yaml-template @@ -0,0 +1,412 @@ +# -*- indent-tabs-mode: nil -*- # vi: set expandtab: +# +# ============LICENSE_START==================================================== +# org.onap.dcae +# ============================================================================= +# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. +# ============================================================================= +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END====================================================== + +tosca_definitions_version: cloudify_dsl_1_3 + +description: |- + This blueprint is used to install and to uninstall a two-VM central postgres as a platform service. + This blueprint depends upon the deployment of the pgaas_plugin and Consul. + +imports: + - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml + - http://www.getcloudify.org/spec/openstack-plugin/1.4/plugin.yaml + - http://www.getcloudify.org/spec/fabric-plugin/1.4.1/plugin.yaml + + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/dnsdesig/dns_types.yaml" + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/sshkeyshare/sshkey_types.yaml" + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml" + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/1.1.0/pgaas_types.yaml" + +inputs: + blueprint_version: + type: string + default: '2018-04-27T00:31:38+0000' + + # pgaas-specific info + pgaas_cluster_name: + type: string + default: pstg + +{{ ONAPTEMPLATE_STANDARD_INPUTS_TYPES }} + + vm_init_pgrs: + type: string + default: | + #!/bin/sh + echo All output will be found in /tmp/ins.out and /tmp/ins.err + exec > /tmp/ins.out 2> /tmp/ins.err + set -x + if [ "$(dnsdomainname 2>/dev/null)" = "" ] + then + echo WARNING WARNING WARNING + echo The DNS DHCP settings did not work properly. + for i in $(seq 20) + do + echo Sleeping... + sleep 10 + if [ "$(dnsdomainname 2>/dev/null)" != "" ] + then break + fi + echo The DNS DHCP settings still did not work properly. + done + if [ "$(dnsdomainname 2>/dev/null)" = "" ] + then + echo Exiting + exit 1 + fi + fi + + CONFDIR=/var/config/DCAE/chef/ + mkdir -p $CONFDIR + + CONF=$CONFDIR/pgaas-postgres.conf + cat < $CONF + master: ${MASTER%%.*} + secondmaster: notused + DRTR_NODE_KSTOREFILE: /opt/app/dcae-certificate/keystore.jks + DRTR_NODE_KSTOREPASS: "No Certificate" + DRTR_NODE_PVTKEYPASS: "No Certificate" + PG_NODES: $PG_NODES + PG_JAVA_HOME : /opt/app/java/jdk/jdk170 + PG_CLUSTER: central + EOF + + apt-get update + + # invoking apt-get separately allows a failure to be ignored + for i in openjdk-7-jdk openjdk-8-jdk python-pip python3-pip curl gawk; do apt-get install -y $i;done + pip install pyyaml + + # prevent servers from starting + echo "exit 101" > /usr/sbin/policy-rc.d; chmod a+x /usr/sbin/policy-rc.d + + # invoking apt-get separately allows a failure to be ignored + for i in postgresql libpq5 repmgr python-psycopg2 python3-psycopg2 libgetopt-java; do apt-get install -y $i; done + + # allow servers to autostart again + rm -f /usr/sbin/policy-rc.d + + ( umask 077; sed 's/^/*:*:*:postgres:/' < /root/.pgrspw > ~postgres/.pgpass; chown postgres:postgres ~postgres/.pgpass ) + + if [ ! -f $CONF ] + then echo "$CONF does not exist" 1>&2; exit 1 + fi + + echo Look in /tmp/pgaas.out for output from installing PGaaS + NEXUS={{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_storage_pgaas_debs_releases }}/debs + for pkg in cdf.deb-1.0.0 pgaas.deb-1.0.0 + do + OUT=/tmp/$pkg + curl -s -k -f -o $OUT $NEXUS/$pkg + dpkg --install $OUT + done + + case $(hostname) in + *00 ) WRITE=-write ;; + *01 ) WRITE= ;; + esac + curl -v -X PUT -H "Content-Type: application/json" "http://${LOCATION_PREFIX}cnsl00.${LOCATION_DOMAIN}:8500/v1/agent/service/register" -d "{\"name\" : \"${CLUSTER_NAME}${WRITE}\", \"Address\" : \"${LOCAL_IP}\", \"Port\" : 5432}" + + echo ALL DONE + +node_templates: + key_pair: + type: cloudify.openstack.nodes.KeyPair + properties: + private_key_path: { get_input: key_filename } + use_external_resource: True + resource_id: { get_input: keypair } + openstack_config: &open_conf + get_input: openstack + private_net: + type: cloudify.openstack.nodes.Network + properties: + use_external_resource: True + resource_id: { get_input: private_net } + openstack_config: *open_conf + security_group: + type: cloudify.openstack.nodes.SecurityGroup + properties: + use_external_resource: True + resource_id: { get_input: security_group } + openstack_config: *open_conf + + sharedsshkey_pgrs: + type: ccsdk.nodes.ssh.keypair + + fixedip_pgrs00: + type: cloudify.openstack.nodes.Port + properties: + port: + extra_dhcp_opts: + - opt_name: 'domain-name' + opt_value: { get_input: location_domain } + openstack_config: *open_conf + relationships: + - type: cloudify.relationships.contained_in + target: private_net + floatingip_pgrs00: + type: cloudify.openstack.nodes.FloatingIP + properties: + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + floating_network_name: { get_input: public_net } + dns_pgrs00: + type: ccsdk.nodes.dns.arecord + properties: + fqdn: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '00.', { get_input: location_domain } ] } + openstack: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + ip_addresses: + - { get_attribute: [ floatingip_pgrs00, floating_ip_address ] } + relationships: + - type: cloudify.relationships.depends_on + target: floatingip_pgrs00 + host_pgrs00: + type: cloudify.openstack.nodes.Server + properties: + install_agent: false + image: { get_input: ubuntu1604image_id } + flavor: { get_input: flavor_id } + management_network_name: { get_input: private_net } + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + name: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '00' ] } + userdata: + concat: + - |- + #!/bin/sh + mkdir /root/.sshkey + echo ' + - { get_attribute: [ sharedsshkey_pgrs, public ] } + - |- + ' >/root/.sshkey/id_rsa.pub + echo ' + - { get_attribute: [ sharedsshkey_pgrs, base64private ] } + - |- + ' | base64 -d >/root/.sshkey/id_rsa + chmod 700 /root/.sshkey + chmod 600 /root/.sshkey/* + ( umask 077; echo -n postgres | cat - /root/.sshkey/id_rsa | md5sum | awk '{ print $1 }' > /root/.pgrspw ) + set -x + - "\n" + - "CLUSTER_NAME='" + - { get_input: pgaas_cluster_name } + - "'\n" + - "LOCATION_PREFIX='" + - { get_input: location_prefix } + - "'\n" + - "LOCATION_DOMAIN='" + - { get_input: location_domain } + - "'\n" + - "MASTER='" + - { get_property: [ dns_pgrs00, fqdn ] } + - "'\n" + - "LOCAL_IP='" + - { get_attribute: [ floatingip_pgrs00, floating_ip_address ] } + - "'\n" + - "PG_NODES='" + - { get_property: [ dns_pgrs00, fqdn ] } + - '|' + - { get_property: [ dns_pgrs01, fqdn ] } + - "'\n" + - { get_input: vm_init_pgrs } + relationships: + - type: cloudify.openstack.server_connected_to_port + target: fixedip_pgrs00 + - type: cloudify.openstack.server_connected_to_security_group + target: security_group + - type: cloudify.openstack.server_connected_to_floating_ip + target: floatingip_pgrs00 + - type: cloudify.openstack.server_connected_to_keypair + target: key_pair + - type: cloudify.relationships.depends_on + target: dns_pgrs00 + - type: cloudify.relationships.depends_on + target: sharedsshkey_pgrs + fixedip_pgrs01: + type: cloudify.openstack.nodes.Port + properties: + port: + extra_dhcp_opts: + - opt_name: 'domain-name' + opt_value: { get_input: location_domain } + openstack_config: *open_conf + relationships: + - type: cloudify.relationships.contained_in + target: private_net + floatingip_pgrs01: + type: cloudify.openstack.nodes.FloatingIP + properties: + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + floating_network_name: { get_input: public_net } + dns_pgrs01: + type: ccsdk.nodes.dns.arecord + properties: + fqdn: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '01.', { get_input: location_domain } ] } + openstack: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + ip_addresses: + - { get_attribute: [ floatingip_pgrs01, floating_ip_address ] } + relationships: + - type: cloudify.relationships.depends_on + target: floatingip_pgrs01 + host_pgrs01: + type: cloudify.openstack.nodes.Server + properties: + install_agent: false + image: { get_input: ubuntu1604image_id } + flavor: { get_input: flavor_id } + management_network_name: { get_input: private_net } + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + name: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '01' ] } + userdata: + concat: + - |- + #!/bin/sh + mkdir /root/.sshkey + echo ' + - { get_attribute: [ sharedsshkey_pgrs, public ] } + - |- + ' >/root/.sshkey/id_rsa.pub + echo ' + - { get_attribute: [ sharedsshkey_pgrs, base64private ] } + - |- + ' | base64 -d >/root/.sshkey/id_rsa + chmod 700 /root/.sshkey + chmod 600 /root/.sshkey/* + ( umask 077; echo -n postgres | cat - /root/.sshkey/id_rsa | md5sum | awk '{ print $1 }' > /root/.pgrspw ) + set -x + - "\n" + - "CLUSTER_NAME='" + - { get_input: pgaas_cluster_name } + - "'\n" + - "LOCATION_PREFIX='" + - { get_input: location_prefix } + - "'\n" + - "LOCATION_DOMAIN='" + - { get_input: location_domain } + - "'\n" + - "MASTER='" + - { get_property: [ dns_pgrs00, fqdn ] } + - "'\n" + - "LOCAL_IP='" + - { get_attribute: [ floatingip_pgrs01, floating_ip_address ] } + - "'\n" + - "PG_NODES='" + - { get_property: [ dns_pgrs00, fqdn ] } + - '|' + - { get_property: [ dns_pgrs01, fqdn ] } + - "'\n" + - { get_input: vm_init_pgrs } + relationships: + - type: cloudify.openstack.server_connected_to_port + target: fixedip_pgrs01 + - type: cloudify.openstack.server_connected_to_security_group + target: security_group + - type: cloudify.openstack.server_connected_to_floating_ip + target: floatingip_pgrs01 + - type: cloudify.openstack.server_connected_to_keypair + target: key_pair + - type: cloudify.relationships.depends_on + target: dns_pgrs01 + - type: cloudify.relationships.depends_on + target: sharedsshkey_pgrs + + # CNAME records + dns_pgrs_rw: + type: ccsdk.nodes.dns.cnamerecord + properties: + fqdn: { concat: [ { get_input: location_prefix }, '-', { get_input: pgaas_cluster_name }, '-write.', { get_input: location_domain } ] } + openstack: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + cname: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '00.', { get_input: location_domain } ] } + + dns_pgrs_ro: + type: ccsdk.nodes.dns.cnamerecord + properties: + fqdn: { concat: [ { get_input: location_prefix }, '-', { get_input: pgaas_cluster_name }, '.', { get_input: location_domain } ] } + openstack: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + cname: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '00.', { get_input: location_domain } ] } + + # tie to pgaas_plugin database + pgaas_cluster: + type: dcae.nodes.pgaas.cluster + properties: + writerfqdn: { get_property: [ dns_pgrs_rw, fqdn ] } + readerfqdn: { get_property: [ dns_pgrs_ro, fqdn ] } + relationships: + - type: dcae.relationships.pgaas_cluster_uses_sshkeypair + target: sharedsshkey_pgrs + - type: cloudify.relationships.depends_on + target: dns_pgrs_rw + - type: cloudify.relationships.depends_on + target: dns_pgrs_ro + +outputs: + public_ip00: + value: { get_attribute: [host_pgrs00, ip] } + public_ip01: + value: { get_attribute: [host_pgrs01, ip] } + writerfqdn: + value: { get_property: [ dns_pgrs_rw, fqdn ] } + readerfqdn: + value: { get_property: [ dns_pgrs_ro, fqdn ] } + dns_pgrs00: + value: { get_property: [ dns_pgrs00, fqdn ] } + dns_pgrs01: + value: { get_property: [ dns_pgrs01, fqdn ] } + blueprint_version: + value: { get_input: blueprint_version } diff --git a/blueprints/reference_templates/policy_handler.yaml-template b/blueprints/reference_templates/policy_handler.yaml-template new file mode 100644 index 0000000..29e66e6 --- /dev/null +++ b/blueprints/reference_templates/policy_handler.yaml-template @@ -0,0 +1,70 @@ +# -*- indent-tabs-mode: nil -*- # vi: set expandtab: +# +# ============LICENSE_START======================================================= +# Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END========================================================= +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. + +tosca_definitions_version: cloudify_dsl_1_3 + +description: > + This blueprint deploys/manages the DCAE policy-handler as a Docker container + +imports: + - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/3/dockerplugin_types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml + +inputs: + + location_id: + description: Deployment location + + docker_host_override: + description: Target docker host + default: 'platform_dockerhost' + + policy_handler_image: + description: Docker image for policy_handler + default: '{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/org.onap.dcaegen2.platform.policy-handler:5.0.0' + + application_config: + description: policy handler application configuration - requires info on policy-engine + default: {} + +node_templates: + policy_handler: + type: dcae.nodes.DockerContainerForPlatforms + properties: + name: 'policy_handler' + image: { get_input: policy_handler_image } + application_config: { get_input: application_config } + docker_config: + healthcheck: + type: 'http' + interval: '300s' + timeout: '25s' + endpoint: '/healthcheck' + relationships: + - type: dcae.relationships.component_contained_in + target: docker_host + + # Docker host + docker_host: + type: dcae.nodes.SelectedDockerHost + properties: + location_id: { get_input: location_id } + docker_host_override: { get_input: docker_host_override } diff --git a/blueprints/reference_templates/prh-service.yaml-template b/blueprints/reference_templates/prh-service.yaml-template new file mode 100644 index 0000000..797cac0 --- /dev/null +++ b/blueprints/reference_templates/prh-service.yaml-template @@ -0,0 +1,61 @@ +tosca_definitions_version: cloudify_dsl_1_3 +imports: +- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml" +- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml" +inputs: + prh_publish_url: + type: string + default: "http://10.0.11.1:3904/events/unauthenticated.SO_OUTPUT" + prh_subscribe_url: + type: string + default: "http://10.0.11.1:3904/events/unauthenticated.SEC_OTHER_OUTPUT" + docker_host_override: + type: string + default: "component_dockerhost" + dh_location_id: + type: string + default: "zone1" + tag_version: + type: string + default: "nexus3.onap.org:10001/onap/org.onap.dcaegen2.services.prh:1.0" + + +node_templates: + docker_service_host: + type: dcae.nodes.SelectedDockerHost + properties: + docker_host_override: + get_input: docker_host_override + location_id: + get_input: dh_location_id + heartbeatService: + type: dcae.nodes.DockerContainerForComponentsUsingDmaap + properties: + application_config: + streams_publishes: + dcae_cl_out: + dmaap_info: + topic_url: + get_input: prh_publish_url + type: message_router + streams_subscribes: + heartbeat_fault: + dmaap_info: + topic_url: + get_input: prh_subcribe_url + type: message_router + docker_config: + healthcheck: + script: /app/bin/check_health.py + interval: 18s + timeout: 30s + type: docker + image: + get_input: tag_version + location_id: + get_input: dh_location_id + service_component_type: dcaegen2-services-prh + relationships: + - target: docker_service_host + type: dcae.relationships.component_contained_in + diff --git a/blueprints/reference_templates/snmptrap-collector.yaml-template b/blueprints/reference_templates/snmptrap-collector.yaml-template new file mode 100644 index 0000000..694fde5 --- /dev/null +++ b/blueprints/reference_templates/snmptrap-collector.yaml-template @@ -0,0 +1,95 @@ +tosca_definitions_version: cloudify_dsl_1_3 +imports: +- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml" +- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml" +inputs: + snmp_publish_url: + type: string + default: "http://10.0.11.1:3904/events/unauthenticated.ONAP-COLLECTOR-SNMPTRAP" + docker_host_override: + type: string + default: "component_dockerhost" + dh_location_id: + type: string + default: "zone1" + tag_version: + type: string + default: "nexus3.onap.org:10001/onap/org.onap.dcaegen2.collectors.snmptrap:1.3" + +node_templates: + docker_service_host: + type: dcae.nodes.SelectedDockerHost + properties: + docker_host_override: + get_input: docker_host_override + location_id: + get_input: dh_location_id + heartbeatService: + type: dcae.nodes.DockerContainerForComponentsUsingDmaap + properties: + application_config: + streams_publishes: + dcae_cl_out: + dmaap_info: + topic_url: + get_input: snmp_publish_url + type: message_router + snmptrap.version: "1.3.0" + snmptrap.title: "ONAP SNMP Trap Receiver" + protocols.transport: "udp" + protocols.ipv4_interface: "0.0.0.0" + protocols.ipv4_port: 162 + protocols.ipv6_interface: "::1" + protocols.ipv6_port: 162 + cache.dns_cache_ttl_seconds: 60 + publisher.http_timeout_milliseconds: 1500 + publisher.http_retries: 3 + publisher.http_milliseconds_between_retries: 750 + publisher.http_primary_publisher: "true" + publisher.http_peer_publisher: "unavailable" + publisher.max_traps_between_publishes: 10 + publisher.max_milliseconds_between_publishes: 10000 + files.runtime_base_dir: "/opt/app/snmptrap" + files.log_dir: "logs" + files.data_dir: "data" + files.pid_dir: "tmp" + files.arriving_traps_log: "snmptrapd_arriving_traps.log" + files.snmptrapd_diag: "snmptrapd_prog_diag.log" + files.traps_stats_log: "snmptrapd_stats.csv" + files.perm_status_file: "snmptrapd_status.log" + files.eelf_base_dir: "/opt/app/snmptrap/logs" + files.eelf_error: "error.log" + files.eelf_debug: "debug.log" + files.eelf_audit: "audit.log" + files.eelf_metrics: "metrics.log" + files.roll_frequency: "hour" + files.minimum_severity_to_log: 2 + trap_def.1.trap_oid" : ".1.3.6.1.4.1.74.2.46.12.1.1" + trap_def.1.trap_category: "DCAE-SNMP-TRAPS" + trap_def.2.trap_oid" : "*" + trap_def.2.trap_category: "DCAE-SNMP-TRAPS" + stormwatch.1.stormwatch_oid" : ".1.3.6.1.4.1.74.2.46.12.1.1" + stormwatch.1.low_water_rearm_per_minute" : "5" + stormwatch.1.high_water_arm_per_minute" : "100" + stormwatch.2.stormwatch_oid" : ".1.3.6.1.4.1.74.2.46.12.1.2" + stormwatch.2.low_water_rearm_per_minute" : "2" + stormwatch.2.high_water_arm_per_minute" : "200" + stormwatch.3.stormwatch_oid" : ".1.3.6.1.4.1.74.2.46.12.1.2" + stormwatch.3.low_water_rearm_per_minute" : "2" + stormwatch.3.high_water_arm_per_minute" : "200" + docker_config: + healthcheck: + script: /app/bin/check_health.py + interval: 18s + timeout: 30s + type: docker + image: + get_input: tag_version + + location_id: + get_input: dh_location_id + service_component_type: dcaegen2-collectors-snmptrap + relationships: + - target: docker_service_host + type: dcae.relationships.component_contained_in + diff --git a/blueprints/reference_templates/tca.yaml-template b/blueprints/reference_templates/tca.yaml-template new file mode 100644 index 0000000..9699456 --- /dev/null +++ b/blueprints/reference_templates/tca.yaml-template @@ -0,0 +1,92 @@ +tosca_definitions_version: cloudify_dsl_1_3 +imports: + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/cdapcloudify/14/cdapcloudify_types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dcaepolicyplugin/1/dcaepolicyplugin_types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml + +inputs: + connected_broker_dns_name: + type: string + default: cdap_broker + aaiEnrichmentHost: + type: string + enableAAIEnrichment: + type: string + default: false + subscriberHostName: + type: string + publisherHostName: + type: string +node_templates: + tca_tca: + type: dcae.nodes.MicroService.cdap + properties: + app_config: + appDescription: DCAE Analytics Threshold Crossing Alert Application + appName: dcae-tca + tcaAlertsAbatementTableName: TCAAlertsAbatementTable + tcaAlertsAbatementTableTTLSeconds: '1728000' + tcaSubscriberOutputStreamName: TCASubscriberOutputStream + tcaVESAlertsTableName: TCAVESAlertsTable + tcaVESAlertsTableTTLSeconds: '1728000' + tcaVESMessageStatusTableName: TCAVESMessageStatusTable + tcaVESMessageStatusTableTTLSeconds: '86400' + thresholdCalculatorFlowletInstances: '2' + app_preferences: + aaiEnrichmentHost: + get_input: aaiEnrichmentHost + aaiEnrichmentIgnoreSSLCertificateErrors: 'true' + aaiEnrichmentPortNumber: '8443' + aaiEnrichmentProtocol: https + aaiEnrichmentUserName: DCAE + aaiEnrichmentUserPassword: DCAE + aaiVMEnrichmentAPIPath: /aai/v11/search/nodes-query + aaiVNFEnrichmentAPIPath: /aai/v11/network/generic-vnfs/generic-vnf + enableAAIEnrichment: + get_input: enableAAIEnrichment + enableAlertCEFFormat: 'false' + publisherContentType: application/json + publisherHostName: + get_input: publisherHostName + publisherHostPort: '3904' + publisherMaxBatchSize: '1' + publisherMaxRecoveryQueueSize: '100000' + publisherPollingInterval: '20000' + publisherProtocol: http + publisherTopicName: unauthenticated.DCAE_CL_OUTPUT + subscriberConsumerGroup: OpenDCAE-c12 + subscriberConsumerId: c12 + subscriberContentType: application/json + subscriberHostName: + get_input: subscriberHostName + subscriberHostPort: '3904' + subscriberMessageLimit: '-1' + subscriberPollingInterval: '30000' + subscriberProtocol: http + subscriberTimeoutMS: '-1' + subscriberTopicName: unauthenticated.VES_MEASUREMENT_OUTPUT + tca_policy: '{"domain":"measurementsForVfScaling","metricsPerEventName":[{"eventName":"vFirewallBroadcastPackets","controlLoopSchemaType":"VNF","policyScope":"DCAE","policyName":"DCAE.Config_tca-hi-lo","policyVersion":"v0.0.1","thresholds":[{"closedLoopControlName":"ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a","version":"1.0.2","fieldPath":"$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta","thresholdValue":300,"direction":"LESS_OR_EQUAL","severity":"MAJOR","closedLoopEventStatus":"ONSET"},{"closedLoopControlName":"ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a","version":"1.0.2","fieldPath":"$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta","thresholdValue":700,"direction":"GREATER_OR_EQUAL","severity":"CRITICAL","closedLoopEventStatus":"ONSET"}]},{"eventName":"vLoadBalancer","controlLoopSchemaType":"VM","policyScope":"DCAE","policyName":"DCAE.Config_tca-hi-lo","policyVersion":"v0.0.1","thresholds":[{"closedLoopControlName":"ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3","version":"1.0.2","fieldPath":"$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta","thresholdValue":300,"direction":"GREATER_OR_EQUAL","severity":"CRITICAL","closedLoopEventStatus":"ONSET"}]},{"eventName":"Measurement_vGMUX","controlLoopSchemaType":"VNF","policyScope":"DCAE","policyName":"DCAE.Config_tca-hi-lo","policyVersion":"v0.0.1","thresholds":[{"closedLoopControlName":"ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e","version":"1.0.2","fieldPath":"$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value","thresholdValue":0,"direction":"EQUAL","severity":"MAJOR","closedLoopEventStatus":"ABATED"},{"closedLoopControlName":"ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e","version":"1.0.2","fieldPath":"$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value","thresholdValue":0,"direction":"GREATER","severity":"CRITICAL","closedLoopEventStatus":"ONSET"}]}]}' + artifact_name: dcae-analytics-cdap-tca + artifact_version: 2.0.0 + connections: + streams_publishes: [] + streams_subscribes: [] + jar_url: https://nexus.onap.org/service/local/repositories/releases/content/org/onap/dcaegen2/analytics/tca/dcae-analytics-cdap-tca/2.0.0/dcae-analytics-cdap-tca-2.0.0.jar + namespace: cdap_tca_hi_lo + programs: + - program_id: TCAVESCollectorFlow + program_type: flows + - program_id: TCADMaaPMRSubscriberWorker + program_type: workers + - program_id: TCADMaaPMRPublisherWorker + program_type: workers + service_component_type: cdap_app_tca + streamname: TCASubscriberOutputStream + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + connected_broker_dns_name: + get_input: connected_broker_dns_name + diff --git a/blueprints/reference_templates/tcadocker-service.yaml-template b/blueprints/reference_templates/tcadocker-service.yaml-template new file mode 100644 index 0000000..92deaa4 --- /dev/null +++ b/blueprints/reference_templates/tcadocker-service.yaml-template @@ -0,0 +1,192 @@ +# +# ============LICENSE_START==================================================== +# org.onap.dcae +# ============================================================================= +# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. +# ============================================================================= +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END====================================================== + +tosca_definitions_version: cloudify_dsl_1_3 + + +imports: + - "http://www.getcloudify.org/spec/cloudify/3.4/types.yaml" + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/dockerplugin/3.2.1/dockerplugin_types.yaml" + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml" + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/dcaepolicyplugin/2.3.0/dcaepolicyplugin_types.yaml" +inputs: + aaiEnrichmentHost: + default: none + type: string + aaiEnrichmentPort: + default: 8443 + type: string + cbs_host: + default: config-binding-service.dcae + type: string + cbs_port: + default: "10000" + type: string + consul_host: + default: consul-server.onap-consul + type: string + consul_port: + default: "8500" + type: string + dh_location_id: + default: zone1 + type: string + dh_override: + default: component_dockerhost + type: string + dmaap_host: + default: dmaap.onap-message-router + type: string + dmaap_port: + default: 3904 + type: string + enableAAIEnrichment: + default: false + type: string + enableRedisCaching: + default: false + type: string + external_port: + default: "32016" + description: "Port for CDAPgui to be exposed" + type: string + policy_id: + default: none + type: string + redisHosts: + type: string + tag_version: + default: "{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/org.onap.dcaegen2.deployments.tca-cdap-container:1.0.0" + type: string +node_templates: + docker_service_host: + properties: + docker_host_override: + get_input: dh_override + location_id: + get_input: dh_location_id + type: dcae.nodes.SelectedDockerHost + tca_docker: + interfaces: + cloudify.interfaces.lifecycle: + start: + inputs: + envs: + AAIHOST: + get_input: aaiEnrichmentHost + AAIPORT: + get_input: aaiEnrichmentPort + CBS_HOST: + get_input: cbs_host + CBS_PORT: + get_input: cbs_port + CONFIG_BINDING_SERVICE: config_binding_service + CONSUL_HOST: + get_input: consul_host + CONSUL_PORT: + get_input: consul_port + DMAAPHOST: + get_input: dmaap_host + DMAAPPORT: + get_input: dmaap_port + DMAAPPUBTOPIC: unauthenticated.DCAE_CL_OUTPUT + DMAAPSUBTOPIC: unauthenticated.VES_MEASUREMENT_OUTPUT +# SERVICE_11011_IGNORE: "true" + SERVICE_11015_IGNORE: "true" + ports: + - concat: ["11011:", { get_input: external_port }] + stop: + inputs: + cleanup_image: true + properties: + application_config: + app_config: + appDescription: "DCAE Analytics Threshold Crossing Alert Application" + appName: dcae-tca + tcaAlertsAbatementTableName: TCAAlertsAbatementTable + tcaAlertsAbatementTableTTLSeconds: "1728000" + tcaSubscriberOutputStreamName: TCASubscriberOutputStream + tcaVESAlertsTableName: TCAVESAlertsTable + tcaVESAlertsTableTTLSeconds: "1728000" + tcaVESMessageStatusTableName: TCAVESMessageStatusTable + tcaVESMessageStatusTableTTLSeconds: "86400" + thresholdCalculatorFlowletInstances: "2" + app_preferences: + aaiEnrichmentHost: + get_input: aaiEnrichmentHost + aaiEnrichmentIgnoreSSLCertificateErrors: "true" + aaiEnrichmentPortNumber: "8443" + aaiEnrichmentProtocol: https + aaiEnrichmentUserName: DCAE + aaiEnrichmentUserPassword: DCAE + aaiVMEnrichmentAPIPath: /aai/v11/search/nodes-query + aaiVNFEnrichmentAPIPath: /aai/v11/network/generic-vnfs/generic-vnf + enableAAIEnrichment: + get_input: enableAAIEnrichment + enableAlertCEFFormat: "false" + enableRedisCaching: + get_input: enableRedisCaching + publisherContentType: application/json + publisherHostName: + get_input: dmaap_host + publisherHostPort: + get_input: dmaap_port + publisherMaxBatchSize: "1" + publisherMaxRecoveryQueueSize: "100000" + publisherPollingInterval: "20000" + publisherProtocol: http + publisherTopicName: unauthenticated.DCAE_CL_OUTPUT + redisHosts: + get_input: redisHosts + subscriberConsumerGroup: OpenDCAE-c12 + subscriberConsumerId: c12 + subscriberContentType: application/json + subscriberHostName: + get_input: dmaap_host + subscriberHostPort: + get_input: dmaap_port + subscriberMessageLimit: "-1" + subscriberPollingInterval: "30000" + subscriberProtocol: http + subscriberTimeoutMS: "-1" + subscriberTopicName: unauthenticated.VES_MEASUREMENT_OUTPUT + tca_policy: "{\"domain\":\"measurementsForVfScaling\",\"metricsPerEventName\":[{\"eventName\":\"vFirewallBroadcastPackets\",\"controlLoopSchemaType\":\"VNF\",\"policyScope\":\"DCAE\",\"policyName\":\"DCAE.Config_tca-hi-lo\",\"policyVersion\":\"v0.0.1\",\"thresholds\":[{\"closedLoopControlName\":\"ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a\",\"version\":\"1.0.2\",\"fieldPath\":\"$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta\",\"thresholdValue\":300,\"direction\":\"LESS_OR_EQUAL\",\"severity\":\"MAJOR\",\"closedLoopEventStatus\":\"ONSET\"},{\"closedLoopControlName\":\"ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a\",\"version\":\"1.0.2\",\"fieldPath\":\"$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta\",\"thresholdValue\":700,\"direction\":\"GREATER_OR_EQUAL\",\"severity\":\"CRITICAL\",\"closedLoopEventStatus\":\"ONSET\"}]},{\"eventName\":\"vLoadBalancer\",\"controlLoopSchemaType\":\"VM\",\"policyScope\":\"DCAE\",\"policyName\":\"DCAE.Config_tca-hi-lo\",\"policyVersion\":\"v0.0.1\",\"thresholds\":[{\"closedLoopControlName\":\"ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3\",\"version\":\"1.0.2\",\"fieldPath\":\"$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta\",\"thresholdValue\":300,\"direction\":\"GREATER_OR_EQUAL\",\"severity\":\"CRITICAL\",\"closedLoopEventStatus\":\"ONSET\"}]},{\"eventName\":\"Measurement_vGMUX\",\"controlLoopSchemaType\":\"VNF\",\"policyScope\":\"DCAE\",\"policyName\":\"DCAE.Config_tca-hi-lo\",\"policyVersion\":\"v0.0.1\",\"thresholds\":[{\"closedLoopControlName\":\"ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e\",\"version\":\"1.0.2\",\"fieldPath\":\"$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value\",\"thresholdValue\":0,\"direction\":\"EQUAL\",\"severity\":\"MAJOR\",\"closedLoopEventStatus\":\"ABATED\"},{\"closedLoopControlName\":\"ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e\",\"version\":\"1.0.2\",\"fieldPath\":\"$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value\",\"thresholdValue\":0,\"direction\":\"GREATER\",\"severity\":\"CRITICAL\",\"closedLoopEventStatus\":\"ONSET\"}]}]}" + docker_config: + healthcheck: + endpoint: / + interval: 15s + timeout: 1s + type: http + image: + get_input: tag_version + service_component_type: dcaegen2-analytics_tca + relationships: + - + target: docker_service_host + type: dcae.relationships.component_contained_in + - + target: tca_policy + type: cloudify.relationships.depends_on + type: dcae.nodes.DockerContainerForComponentsUsingDmaap + tca_policy: + properties: + policy_id: + get_input: policy_id + type: dcae.nodes.policy + diff --git a/blueprints/reference_templates/ves.yaml-template b/blueprints/reference_templates/ves.yaml-template new file mode 100644 index 0000000..0653e3d --- /dev/null +++ b/blueprints/reference_templates/ves.yaml-template @@ -0,0 +1,135 @@ +# -*- indent-tabs-mode: nil -*- # vi: set expandtab: +# +# ============LICENSE_START==================================================== +# org.onap.dcae +# ============================================================================= +# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. +# ============================================================================= +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END====================================================== + +tosca_definitions_version: cloudify_dsl_1_3 + + +imports: + - "http://www.getcloudify.org/spec/cloudify/3.4/types.yaml" + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml" + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml" + +inputs: + ves_other_publish_url: + type: string + default: "http://10.0.11.1:3904/events/unauthenticated.SEC_OTHER_OUTPUT" + ves_heartbeat_publish_url: + type: string + default: "http://10.0.11.1:3904/events/unauthenticated.SEC_HEARTBEAT_OUTPUT" + ves_fault_publish_url: + type: string + default: "http://10.0.11.1:3904/events/unauthenticated.SEC_FAULT_OUTPUT" + ves_measurement_publish_url: + type: string + default: "http://10.0.11.1:3904/events/unauthenticated.VES_MEASUREMENT_OUTPUT" + ves_notification_publish_url: + type: string + default: "http://10.0.11.1:3904/events/unauthenticated.VES_NOTIFICATION_OUTPUT" + ves_pnfRegistration_publish_url: + type: string + default: "http://10.0.11.1:3904/events/unauthenticated.VES_PNFREG_OUTPUT" + dh_override: + type: string + default: "component_dockerhost" + dh_location_id: + type: string + default: "zone1" + tag_version: + type: string + default: "nexus3.onap.org:10001/onap/org.onap.dcaegen2.collectors.ves.vescollector:1.3.1" + +node_templates: + docker_collector_host: + properties: + docker_host_override: + get_input: dh_override + location_id: + get_input: dh_location_id + type: dcae.nodes.SelectedDockerHost + ves: + interfaces: + cloudify.interfaces.lifecycle: + stop: + inputs: + cleanup_image: true + start: + inputs: + ports: + - '8080:8080' + properties: + application_config: + collector.dmaap.streamid: fault=ves-fault|syslog=ves-syslog|heartbeat=ves-heartbeat|measurementsForVfScaling=ves-measurement|mobileFlow=ves-mobileflow|other=ves-other|stateChange=ves-statechange|thresholdCrossingAlert=ves-thresholdCrossingAlert|voiceQuality=ves-voicequality|sipSignaling=ves-sipsignaling|notification=ves-notification|pnfRegistration=ves-pnfRegistration + collector.inputQueue.maxPending: "8096" + collector.keystore.alias: "dynamically generated" + collector.keystore.file.location: /opt/app/VESCollector/etc/keystore + collector.keystore.passwordfile: /opt/app/VESCollector/etc/passwordfile + collector.schema.checkflag: "1" + collector.schema.file: "{\"v1\":\"./etc/CommonEventFormat_27.2.json\",\"v2\":\"./etc/CommonEventFormat_27.2.json\",\"v3\":\"./etc/CommonEventFormat_27.2.json\",\"v4\":\"./etc/CommonEventFormat_27.2.json\",\"v5\":\"./etc/CommonEventFormat_28.4.json\",\"v7\":\"./etc/CommonEventFormat_30.0.1.json\"} + collector.service.port: "8080" + collector.service.secure.port: "8443" + event.transform.flag: "0" + header.authflag: "0" + header.authlist: "userid1,base64encodepwd1|userid2,base64encodepwd2" + services_calls: [] + streams_publishes: + ves-fault: + dmaap_info: + topic_url: + get_input: ves_fault_publish_url + type: message_router + ves-measurement: + dmaap_info: + topic_url: + get_input: ves_measurement_publish_url + type: message_router + ves-notification: + dmaap_info: + topic_url: + get_input: ves_notification_publish_url + type: message_router + ves-pnfRegistration: + dmaap_info: + topic_url: + get_input: ves_pnfRegistration_publish_url + type: message_router + ves-heartbeat: + dmaap_info: + topic_url: + get_input: ves_heartbeat_publish_url + type: message_router + ves-other: + dmaap_info: + topic_url: + get_input: ves_other_publish_url + type: message_router + collector.dynamic.config.update.frequency: "5" + docker_config: + healthcheck: + endpoint: /healthcheck + interval: 15s + timeout: 1s + type: http + image: + get_input: tag_version + service_component_type: dcaegen2-collectors-ves + relationships: + - type: dcae.relationships.component_contained_in + target: docker_collector_host + type: dcae.nodes.DockerContainerForComponentsUsingDmaap diff --git a/blueprints/snmptrap-collector.yaml-template b/blueprints/snmptrap-collector.yaml-template deleted file mode 100644 index 694fde5..0000000 --- a/blueprints/snmptrap-collector.yaml-template +++ /dev/null @@ -1,95 +0,0 @@ -tosca_definitions_version: cloudify_dsl_1_3 -imports: -- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml" -- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml" -inputs: - snmp_publish_url: - type: string - default: "http://10.0.11.1:3904/events/unauthenticated.ONAP-COLLECTOR-SNMPTRAP" - docker_host_override: - type: string - default: "component_dockerhost" - dh_location_id: - type: string - default: "zone1" - tag_version: - type: string - default: "nexus3.onap.org:10001/onap/org.onap.dcaegen2.collectors.snmptrap:1.3" - -node_templates: - docker_service_host: - type: dcae.nodes.SelectedDockerHost - properties: - docker_host_override: - get_input: docker_host_override - location_id: - get_input: dh_location_id - heartbeatService: - type: dcae.nodes.DockerContainerForComponentsUsingDmaap - properties: - application_config: - streams_publishes: - dcae_cl_out: - dmaap_info: - topic_url: - get_input: snmp_publish_url - type: message_router - snmptrap.version: "1.3.0" - snmptrap.title: "ONAP SNMP Trap Receiver" - protocols.transport: "udp" - protocols.ipv4_interface: "0.0.0.0" - protocols.ipv4_port: 162 - protocols.ipv6_interface: "::1" - protocols.ipv6_port: 162 - cache.dns_cache_ttl_seconds: 60 - publisher.http_timeout_milliseconds: 1500 - publisher.http_retries: 3 - publisher.http_milliseconds_between_retries: 750 - publisher.http_primary_publisher: "true" - publisher.http_peer_publisher: "unavailable" - publisher.max_traps_between_publishes: 10 - publisher.max_milliseconds_between_publishes: 10000 - files.runtime_base_dir: "/opt/app/snmptrap" - files.log_dir: "logs" - files.data_dir: "data" - files.pid_dir: "tmp" - files.arriving_traps_log: "snmptrapd_arriving_traps.log" - files.snmptrapd_diag: "snmptrapd_prog_diag.log" - files.traps_stats_log: "snmptrapd_stats.csv" - files.perm_status_file: "snmptrapd_status.log" - files.eelf_base_dir: "/opt/app/snmptrap/logs" - files.eelf_error: "error.log" - files.eelf_debug: "debug.log" - files.eelf_audit: "audit.log" - files.eelf_metrics: "metrics.log" - files.roll_frequency: "hour" - files.minimum_severity_to_log: 2 - trap_def.1.trap_oid" : ".1.3.6.1.4.1.74.2.46.12.1.1" - trap_def.1.trap_category: "DCAE-SNMP-TRAPS" - trap_def.2.trap_oid" : "*" - trap_def.2.trap_category: "DCAE-SNMP-TRAPS" - stormwatch.1.stormwatch_oid" : ".1.3.6.1.4.1.74.2.46.12.1.1" - stormwatch.1.low_water_rearm_per_minute" : "5" - stormwatch.1.high_water_arm_per_minute" : "100" - stormwatch.2.stormwatch_oid" : ".1.3.6.1.4.1.74.2.46.12.1.2" - stormwatch.2.low_water_rearm_per_minute" : "2" - stormwatch.2.high_water_arm_per_minute" : "200" - stormwatch.3.stormwatch_oid" : ".1.3.6.1.4.1.74.2.46.12.1.2" - stormwatch.3.low_water_rearm_per_minute" : "2" - stormwatch.3.high_water_arm_per_minute" : "200" - docker_config: - healthcheck: - script: /app/bin/check_health.py - interval: 18s - timeout: 30s - type: docker - image: - get_input: tag_version - - location_id: - get_input: dh_location_id - service_component_type: dcaegen2-collectors-snmptrap - relationships: - - target: docker_service_host - type: dcae.relationships.component_contained_in - diff --git a/blueprints/tca.yaml-template b/blueprints/tca.yaml-template deleted file mode 100644 index 9699456..0000000 --- a/blueprints/tca.yaml-template +++ /dev/null @@ -1,92 +0,0 @@ -tosca_definitions_version: cloudify_dsl_1_3 -imports: - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/cdapcloudify/14/cdapcloudify_types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dcaepolicyplugin/1/dcaepolicyplugin_types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml - -inputs: - connected_broker_dns_name: - type: string - default: cdap_broker - aaiEnrichmentHost: - type: string - enableAAIEnrichment: - type: string - default: false - subscriberHostName: - type: string - publisherHostName: - type: string -node_templates: - tca_tca: - type: dcae.nodes.MicroService.cdap - properties: - app_config: - appDescription: DCAE Analytics Threshold Crossing Alert Application - appName: dcae-tca - tcaAlertsAbatementTableName: TCAAlertsAbatementTable - tcaAlertsAbatementTableTTLSeconds: '1728000' - tcaSubscriberOutputStreamName: TCASubscriberOutputStream - tcaVESAlertsTableName: TCAVESAlertsTable - tcaVESAlertsTableTTLSeconds: '1728000' - tcaVESMessageStatusTableName: TCAVESMessageStatusTable - tcaVESMessageStatusTableTTLSeconds: '86400' - thresholdCalculatorFlowletInstances: '2' - app_preferences: - aaiEnrichmentHost: - get_input: aaiEnrichmentHost - aaiEnrichmentIgnoreSSLCertificateErrors: 'true' - aaiEnrichmentPortNumber: '8443' - aaiEnrichmentProtocol: https - aaiEnrichmentUserName: DCAE - aaiEnrichmentUserPassword: DCAE - aaiVMEnrichmentAPIPath: /aai/v11/search/nodes-query - aaiVNFEnrichmentAPIPath: /aai/v11/network/generic-vnfs/generic-vnf - enableAAIEnrichment: - get_input: enableAAIEnrichment - enableAlertCEFFormat: 'false' - publisherContentType: application/json - publisherHostName: - get_input: publisherHostName - publisherHostPort: '3904' - publisherMaxBatchSize: '1' - publisherMaxRecoveryQueueSize: '100000' - publisherPollingInterval: '20000' - publisherProtocol: http - publisherTopicName: unauthenticated.DCAE_CL_OUTPUT - subscriberConsumerGroup: OpenDCAE-c12 - subscriberConsumerId: c12 - subscriberContentType: application/json - subscriberHostName: - get_input: subscriberHostName - subscriberHostPort: '3904' - subscriberMessageLimit: '-1' - subscriberPollingInterval: '30000' - subscriberProtocol: http - subscriberTimeoutMS: '-1' - subscriberTopicName: unauthenticated.VES_MEASUREMENT_OUTPUT - tca_policy: '{"domain":"measurementsForVfScaling","metricsPerEventName":[{"eventName":"vFirewallBroadcastPackets","controlLoopSchemaType":"VNF","policyScope":"DCAE","policyName":"DCAE.Config_tca-hi-lo","policyVersion":"v0.0.1","thresholds":[{"closedLoopControlName":"ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a","version":"1.0.2","fieldPath":"$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta","thresholdValue":300,"direction":"LESS_OR_EQUAL","severity":"MAJOR","closedLoopEventStatus":"ONSET"},{"closedLoopControlName":"ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a","version":"1.0.2","fieldPath":"$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta","thresholdValue":700,"direction":"GREATER_OR_EQUAL","severity":"CRITICAL","closedLoopEventStatus":"ONSET"}]},{"eventName":"vLoadBalancer","controlLoopSchemaType":"VM","policyScope":"DCAE","policyName":"DCAE.Config_tca-hi-lo","policyVersion":"v0.0.1","thresholds":[{"closedLoopControlName":"ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3","version":"1.0.2","fieldPath":"$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta","thresholdValue":300,"direction":"GREATER_OR_EQUAL","severity":"CRITICAL","closedLoopEventStatus":"ONSET"}]},{"eventName":"Measurement_vGMUX","controlLoopSchemaType":"VNF","policyScope":"DCAE","policyName":"DCAE.Config_tca-hi-lo","policyVersion":"v0.0.1","thresholds":[{"closedLoopControlName":"ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e","version":"1.0.2","fieldPath":"$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value","thresholdValue":0,"direction":"EQUAL","severity":"MAJOR","closedLoopEventStatus":"ABATED"},{"closedLoopControlName":"ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e","version":"1.0.2","fieldPath":"$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value","thresholdValue":0,"direction":"GREATER","severity":"CRITICAL","closedLoopEventStatus":"ONSET"}]}]}' - artifact_name: dcae-analytics-cdap-tca - artifact_version: 2.0.0 - connections: - streams_publishes: [] - streams_subscribes: [] - jar_url: https://nexus.onap.org/service/local/repositories/releases/content/org/onap/dcaegen2/analytics/tca/dcae-analytics-cdap-tca/2.0.0/dcae-analytics-cdap-tca-2.0.0.jar - namespace: cdap_tca_hi_lo - programs: - - program_id: TCAVESCollectorFlow - program_type: flows - - program_id: TCADMaaPMRSubscriberWorker - program_type: workers - - program_id: TCADMaaPMRPublisherWorker - program_type: workers - service_component_type: cdap_app_tca - streamname: TCASubscriberOutputStream - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - connected_broker_dns_name: - get_input: connected_broker_dns_name - diff --git a/blueprints/tcadocker-service.yaml-template b/blueprints/tcadocker-service.yaml-template deleted file mode 100644 index 92deaa4..0000000 --- a/blueprints/tcadocker-service.yaml-template +++ /dev/null @@ -1,192 +0,0 @@ -# -# ============LICENSE_START==================================================== -# org.onap.dcae -# ============================================================================= -# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. -# ============================================================================= -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END====================================================== - -tosca_definitions_version: cloudify_dsl_1_3 - - -imports: - - "http://www.getcloudify.org/spec/cloudify/3.4/types.yaml" - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/dockerplugin/3.2.1/dockerplugin_types.yaml" - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml" - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/dcaepolicyplugin/2.3.0/dcaepolicyplugin_types.yaml" -inputs: - aaiEnrichmentHost: - default: none - type: string - aaiEnrichmentPort: - default: 8443 - type: string - cbs_host: - default: config-binding-service.dcae - type: string - cbs_port: - default: "10000" - type: string - consul_host: - default: consul-server.onap-consul - type: string - consul_port: - default: "8500" - type: string - dh_location_id: - default: zone1 - type: string - dh_override: - default: component_dockerhost - type: string - dmaap_host: - default: dmaap.onap-message-router - type: string - dmaap_port: - default: 3904 - type: string - enableAAIEnrichment: - default: false - type: string - enableRedisCaching: - default: false - type: string - external_port: - default: "32016" - description: "Port for CDAPgui to be exposed" - type: string - policy_id: - default: none - type: string - redisHosts: - type: string - tag_version: - default: "{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/org.onap.dcaegen2.deployments.tca-cdap-container:1.0.0" - type: string -node_templates: - docker_service_host: - properties: - docker_host_override: - get_input: dh_override - location_id: - get_input: dh_location_id - type: dcae.nodes.SelectedDockerHost - tca_docker: - interfaces: - cloudify.interfaces.lifecycle: - start: - inputs: - envs: - AAIHOST: - get_input: aaiEnrichmentHost - AAIPORT: - get_input: aaiEnrichmentPort - CBS_HOST: - get_input: cbs_host - CBS_PORT: - get_input: cbs_port - CONFIG_BINDING_SERVICE: config_binding_service - CONSUL_HOST: - get_input: consul_host - CONSUL_PORT: - get_input: consul_port - DMAAPHOST: - get_input: dmaap_host - DMAAPPORT: - get_input: dmaap_port - DMAAPPUBTOPIC: unauthenticated.DCAE_CL_OUTPUT - DMAAPSUBTOPIC: unauthenticated.VES_MEASUREMENT_OUTPUT -# SERVICE_11011_IGNORE: "true" - SERVICE_11015_IGNORE: "true" - ports: - - concat: ["11011:", { get_input: external_port }] - stop: - inputs: - cleanup_image: true - properties: - application_config: - app_config: - appDescription: "DCAE Analytics Threshold Crossing Alert Application" - appName: dcae-tca - tcaAlertsAbatementTableName: TCAAlertsAbatementTable - tcaAlertsAbatementTableTTLSeconds: "1728000" - tcaSubscriberOutputStreamName: TCASubscriberOutputStream - tcaVESAlertsTableName: TCAVESAlertsTable - tcaVESAlertsTableTTLSeconds: "1728000" - tcaVESMessageStatusTableName: TCAVESMessageStatusTable - tcaVESMessageStatusTableTTLSeconds: "86400" - thresholdCalculatorFlowletInstances: "2" - app_preferences: - aaiEnrichmentHost: - get_input: aaiEnrichmentHost - aaiEnrichmentIgnoreSSLCertificateErrors: "true" - aaiEnrichmentPortNumber: "8443" - aaiEnrichmentProtocol: https - aaiEnrichmentUserName: DCAE - aaiEnrichmentUserPassword: DCAE - aaiVMEnrichmentAPIPath: /aai/v11/search/nodes-query - aaiVNFEnrichmentAPIPath: /aai/v11/network/generic-vnfs/generic-vnf - enableAAIEnrichment: - get_input: enableAAIEnrichment - enableAlertCEFFormat: "false" - enableRedisCaching: - get_input: enableRedisCaching - publisherContentType: application/json - publisherHostName: - get_input: dmaap_host - publisherHostPort: - get_input: dmaap_port - publisherMaxBatchSize: "1" - publisherMaxRecoveryQueueSize: "100000" - publisherPollingInterval: "20000" - publisherProtocol: http - publisherTopicName: unauthenticated.DCAE_CL_OUTPUT - redisHosts: - get_input: redisHosts - subscriberConsumerGroup: OpenDCAE-c12 - subscriberConsumerId: c12 - subscriberContentType: application/json - subscriberHostName: - get_input: dmaap_host - subscriberHostPort: - get_input: dmaap_port - subscriberMessageLimit: "-1" - subscriberPollingInterval: "30000" - subscriberProtocol: http - subscriberTimeoutMS: "-1" - subscriberTopicName: unauthenticated.VES_MEASUREMENT_OUTPUT - tca_policy: "{\"domain\":\"measurementsForVfScaling\",\"metricsPerEventName\":[{\"eventName\":\"vFirewallBroadcastPackets\",\"controlLoopSchemaType\":\"VNF\",\"policyScope\":\"DCAE\",\"policyName\":\"DCAE.Config_tca-hi-lo\",\"policyVersion\":\"v0.0.1\",\"thresholds\":[{\"closedLoopControlName\":\"ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a\",\"version\":\"1.0.2\",\"fieldPath\":\"$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta\",\"thresholdValue\":300,\"direction\":\"LESS_OR_EQUAL\",\"severity\":\"MAJOR\",\"closedLoopEventStatus\":\"ONSET\"},{\"closedLoopControlName\":\"ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a\",\"version\":\"1.0.2\",\"fieldPath\":\"$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta\",\"thresholdValue\":700,\"direction\":\"GREATER_OR_EQUAL\",\"severity\":\"CRITICAL\",\"closedLoopEventStatus\":\"ONSET\"}]},{\"eventName\":\"vLoadBalancer\",\"controlLoopSchemaType\":\"VM\",\"policyScope\":\"DCAE\",\"policyName\":\"DCAE.Config_tca-hi-lo\",\"policyVersion\":\"v0.0.1\",\"thresholds\":[{\"closedLoopControlName\":\"ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3\",\"version\":\"1.0.2\",\"fieldPath\":\"$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta\",\"thresholdValue\":300,\"direction\":\"GREATER_OR_EQUAL\",\"severity\":\"CRITICAL\",\"closedLoopEventStatus\":\"ONSET\"}]},{\"eventName\":\"Measurement_vGMUX\",\"controlLoopSchemaType\":\"VNF\",\"policyScope\":\"DCAE\",\"policyName\":\"DCAE.Config_tca-hi-lo\",\"policyVersion\":\"v0.0.1\",\"thresholds\":[{\"closedLoopControlName\":\"ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e\",\"version\":\"1.0.2\",\"fieldPath\":\"$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value\",\"thresholdValue\":0,\"direction\":\"EQUAL\",\"severity\":\"MAJOR\",\"closedLoopEventStatus\":\"ABATED\"},{\"closedLoopControlName\":\"ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e\",\"version\":\"1.0.2\",\"fieldPath\":\"$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value\",\"thresholdValue\":0,\"direction\":\"GREATER\",\"severity\":\"CRITICAL\",\"closedLoopEventStatus\":\"ONSET\"}]}]}" - docker_config: - healthcheck: - endpoint: / - interval: 15s - timeout: 1s - type: http - image: - get_input: tag_version - service_component_type: dcaegen2-analytics_tca - relationships: - - - target: docker_service_host - type: dcae.relationships.component_contained_in - - - target: tca_policy - type: cloudify.relationships.depends_on - type: dcae.nodes.DockerContainerForComponentsUsingDmaap - tca_policy: - properties: - policy_id: - get_input: policy_id - type: dcae.nodes.policy - diff --git a/blueprints/ves.yaml-template b/blueprints/ves.yaml-template deleted file mode 100644 index 0653e3d..0000000 --- a/blueprints/ves.yaml-template +++ /dev/null @@ -1,135 +0,0 @@ -# -*- indent-tabs-mode: nil -*- # vi: set expandtab: -# -# ============LICENSE_START==================================================== -# org.onap.dcae -# ============================================================================= -# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. -# ============================================================================= -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END====================================================== - -tosca_definitions_version: cloudify_dsl_1_3 - - -imports: - - "http://www.getcloudify.org/spec/cloudify/3.4/types.yaml" - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml" - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml" - -inputs: - ves_other_publish_url: - type: string - default: "http://10.0.11.1:3904/events/unauthenticated.SEC_OTHER_OUTPUT" - ves_heartbeat_publish_url: - type: string - default: "http://10.0.11.1:3904/events/unauthenticated.SEC_HEARTBEAT_OUTPUT" - ves_fault_publish_url: - type: string - default: "http://10.0.11.1:3904/events/unauthenticated.SEC_FAULT_OUTPUT" - ves_measurement_publish_url: - type: string - default: "http://10.0.11.1:3904/events/unauthenticated.VES_MEASUREMENT_OUTPUT" - ves_notification_publish_url: - type: string - default: "http://10.0.11.1:3904/events/unauthenticated.VES_NOTIFICATION_OUTPUT" - ves_pnfRegistration_publish_url: - type: string - default: "http://10.0.11.1:3904/events/unauthenticated.VES_PNFREG_OUTPUT" - dh_override: - type: string - default: "component_dockerhost" - dh_location_id: - type: string - default: "zone1" - tag_version: - type: string - default: "nexus3.onap.org:10001/onap/org.onap.dcaegen2.collectors.ves.vescollector:1.3.1" - -node_templates: - docker_collector_host: - properties: - docker_host_override: - get_input: dh_override - location_id: - get_input: dh_location_id - type: dcae.nodes.SelectedDockerHost - ves: - interfaces: - cloudify.interfaces.lifecycle: - stop: - inputs: - cleanup_image: true - start: - inputs: - ports: - - '8080:8080' - properties: - application_config: - collector.dmaap.streamid: fault=ves-fault|syslog=ves-syslog|heartbeat=ves-heartbeat|measurementsForVfScaling=ves-measurement|mobileFlow=ves-mobileflow|other=ves-other|stateChange=ves-statechange|thresholdCrossingAlert=ves-thresholdCrossingAlert|voiceQuality=ves-voicequality|sipSignaling=ves-sipsignaling|notification=ves-notification|pnfRegistration=ves-pnfRegistration - collector.inputQueue.maxPending: "8096" - collector.keystore.alias: "dynamically generated" - collector.keystore.file.location: /opt/app/VESCollector/etc/keystore - collector.keystore.passwordfile: /opt/app/VESCollector/etc/passwordfile - collector.schema.checkflag: "1" - collector.schema.file: "{\"v1\":\"./etc/CommonEventFormat_27.2.json\",\"v2\":\"./etc/CommonEventFormat_27.2.json\",\"v3\":\"./etc/CommonEventFormat_27.2.json\",\"v4\":\"./etc/CommonEventFormat_27.2.json\",\"v5\":\"./etc/CommonEventFormat_28.4.json\",\"v7\":\"./etc/CommonEventFormat_30.0.1.json\"} - collector.service.port: "8080" - collector.service.secure.port: "8443" - event.transform.flag: "0" - header.authflag: "0" - header.authlist: "userid1,base64encodepwd1|userid2,base64encodepwd2" - services_calls: [] - streams_publishes: - ves-fault: - dmaap_info: - topic_url: - get_input: ves_fault_publish_url - type: message_router - ves-measurement: - dmaap_info: - topic_url: - get_input: ves_measurement_publish_url - type: message_router - ves-notification: - dmaap_info: - topic_url: - get_input: ves_notification_publish_url - type: message_router - ves-pnfRegistration: - dmaap_info: - topic_url: - get_input: ves_pnfRegistration_publish_url - type: message_router - ves-heartbeat: - dmaap_info: - topic_url: - get_input: ves_heartbeat_publish_url - type: message_router - ves-other: - dmaap_info: - topic_url: - get_input: ves_other_publish_url - type: message_router - collector.dynamic.config.update.frequency: "5" - docker_config: - healthcheck: - endpoint: /healthcheck - interval: 15s - timeout: 1s - type: http - image: - get_input: tag_version - service_component_type: dcaegen2-collectors-ves - relationships: - - type: dcae.relationships.component_contained_in - target: docker_collector_host - type: dcae.nodes.DockerContainerForComponentsUsingDmaap -- cgit 1.2.3-korg