Added webserver and update ONAP OAM CIDR
[demo.git] / heat / vCPE / infra / base_vcpe_infra_rackspace.yaml
index 14e8250..8e93bdc 100644 (file)
@@ -24,7 +24,7 @@
 
 heat_template_version: 2013-05-23
 
-description: Heat template to deploy vCPE Infrastructue emlements (vAAA, vDHCP, vDNS_DHCP) for ONAP
+description: Heat template to deploy vCPE Infrastructue emlements (vAAA, vDHCP, vDNS_DHCP, webServer_sink) for ONAP
 
 ##############
 #            #
@@ -97,6 +97,14 @@ parameters:
     type: string
     label: vDNS private IP address towards the ONAP management network
     description: Private IP address that is assigned to the vDHCP to communicate with ONAP components
+  vweb_private_ip_0:
+    type: string
+    label: vWEB private IP address towards the vGW 
+    description: Private IP address that is assigned to the vWEB to communicate with the vGWs 
+  vweb_private_ip_1:
+    type: string
+    label: vWEB private IP address towards the ONAP management network
+    description: Private IP address that is assigned to the vWEB to communicate with ONAP components
   vaaa_name_0:
     type: string
     label: vAAA name
@@ -109,6 +117,10 @@ parameters:
     type: string
     label: vDHCP name
     description: Name of the vDHCP
+  vweb_name_0:
+    type: string
+    label: vWEB name
+    description: Name of the vWEB 
   vnf_id:
     type: string
     label: VNF ID
@@ -202,7 +214,7 @@ resources:
       cidr: { get_param: cpe_public_net_cidr }
 
 
-  # Virtual Load Balancer Instantiation
+  # Virtual AAA server Instantiation
   vaaa_private_0_port:
     type: OS::Neutron::Port
     properties:
@@ -374,3 +386,60 @@ resources:
             cd /opt
             chmod +x v_dhcp_install.sh
             ./v_dhcp_install.sh
+
+  # vWEB instantiaion
+  vweb_private_0_port:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_resource: cpe_public_network }
+      fixed_ips: [{"subnet": { get_resource: cpe_public_subnet }, "ip_address": { get_param: vweb_private_ip_0 }}]
+
+  vdhcp_private_1_port:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: onap_private_net_id }
+      fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vweb_private_ip_1 }}]
+
+
+  vweb_0:
+    type: OS::Nova::Server
+    properties:
+      image: { get_param: vcpe_image_name }
+      flavor: { get_param: vcpe_flavor_name }
+      name: { get_param: vweb_name_0 }
+      key_name: { get_resource: my_keypair }
+      networks:
+        - network: { get_param: public_net_id }
+        - port: { get_resource: vweb_private_0_port }
+        - port: { get_resource: vweb_private_1_port }
+      metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }}
+      user_data_format: RAW
+      user_data:
+        str_replace:
+          params:
+            __web_oam_int__ : { get_param: vweb_private_ip_1 }
+            __web_private_ipaddr__: { get_param: vweb_private_ip_0 }
+            __local_private_ipaddr__: { get_param: vweb_private_ip_0 }
+            __repo_url_blob__ : { get_param: repo_url_blob }
+            __repo_url_artifacts__ : { get_param: repo_url_artifacts }
+            __demo_artifacts_version__ : { get_param: demo_artifacts_version }
+            __install_script_version__ : { get_param: install_script_version }
+            __cloud_env__ : { get_param: cloud_env }
+          template: |
+            #!/bin/bash
+
+            # Create configuration files
+            mkdir /opt/config
+            echo "__web_oam_int__" > /opt/config/lb_oam_int.txt
+            echo "__lb_private_ipaddr__" > /opt/config/lb_private_ipaddr.txt
+            echo "__local_private_ipaddr__" > /opt/config/local_private_ipaddr.txt
+            echo "__repo_url_blob__" > /opt/config/repo_url_blob.txt
+            echo "__repo_url_artifacts__" > /opt/config/repo_url_artifacts.txt
+            echo "__demo_artifacts_version__" > /opt/config/demo_artifacts_version.txt
+            echo "__install_script_version__" > /opt/config/install_script_version.txt
+            echo "__cloud_env__" > /opt/config/cloud_env.txt
+
+            # Download and run install script
+            curl -k __repo_url_blob__/org.onap.demo/vnfs/vdhcp/__install_script_version__/v_dhcp_install.sh -o /opt/v_dhcp_install.sh
+            cd /opt
+            chmod +x v_dhcp_install.sh