1 heat_template_version: 2015-10-15
3 description: Heat template to install ONAP components
13 # Generic parameters used across all ONAP components
16 description: Public network for floating IP address allocation
20 description: Name of the Ubuntu 14.04 image
24 description: Name of the Ubuntu 16.04 image
28 description: Name of the Small Flavor supported by the cloud provider
32 description: Name of the Medium Flavor supported by the cloud provider
36 description: Name of the Large Flavor supported by the cloud provider
40 description: Name of the Extra Large Flavor supported by the cloud provider
44 description: Base name of ONAP VMs
48 description: Public/Private key pair name
52 description: Public key to be installed on the compute instance
56 description: Complete URL for the Nexus repository.
60 description: Complete URL for the Nexus repository for docker images.
64 description: Nexus Repository username
68 description: Nexus Repository Password
72 description: Gitlab Repository username
76 description: Gitlab Repository Password
80 description: Artifacts version of ONAP components
84 label: Version number of ONAP docker images
88 label: Gerrit code branch
89 description: Gerrit branch where to download the code from
93 description: DmaaP Topic name
97 description: Openstack tenant ID
101 description: Openstack username
105 description: Openstack API Key
109 description: URL of Openstack Horizon
113 description: URL of Openstack Keystone
117 type: comma_delimited_list
118 description: External DNS for OAM ONAP network
122 description: CIDR of the OAM ONAP network
126 description: A&AI IP Address
130 description: APP-C IP Address
134 description: DCAE IP Address
138 description: DNS IP Address
142 description: MSO IP Address
146 description: Message Router IP Address
150 description: Policy Engine IP Address
154 description: Portal IP Address
158 description: Robot Framework IP Address
162 description: SDC IP Address
166 description: SDN-C IP Address
170 description: VID IP Address
172 # Parameters for DCAE instantiation
175 description: DCAE Zone to use in VM names created by DCAE controller
179 description: DCAE State to use in VM names created by DCAE controller
183 description: Root URL of Nexus repository
187 description: Snapshot of Maven repository for DCAE deployment
191 description: Region where the DCAE controller will spin the VMs
195 description: Branch of the Gitlab repository
206 type: OS::Heat::RandomString
211 # Public key used to access ONAP components
213 type: OS::Nova::KeyPair
219 base: { get_param: key_name }
220 rand: { get_resource: random-str }
221 public_key: { get_param: pub_key }
222 save_private_key: false
225 # ONAP management private network
227 type: OS::Neutron::Net
231 template: oam_ecomp_rand
233 rand: { get_resource: random-str }
236 type: OS::Neutron::Subnet
240 template: oam_ecomp_rand
242 rand: { get_resource: random-str }
243 network_id: { get_resource: oam_ecomp }
244 cidr: { get_param: oam_network_cidr }
245 dns_nameservers: { get_param: external_dns }
248 type: OS::Neutron::Router
250 external_gateway_info:
251 network: { get_param: public_net_id }
254 type: OS::Neutron::RouterInterface
256 router_id: { get_resource: router }
257 subnet_id: { get_resource: oam_ecomp_subnet }
260 # DNS Server instantiation
262 type: OS::Neutron::Port
264 network: { get_resource: oam_ecomp }
265 fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: dns_ip_addr }}]
268 type: OS::Neutron::FloatingIP
270 floating_network_id: { get_param: public_net_id }
271 port_id: { get_resource: dns_private_port }
274 type: OS::Nova::Server
276 image: { get_param: ubuntu_1404_image }
277 flavor: { get_param: flavor_small }
280 template: base-dns-server
282 base: { get_param: vm_base_name }
283 key_name: { get_resource: vm_key }
285 - port: { get_resource: dns_private_port }
286 user_data_format: RAW
290 __nexus_repo__: { get_param: nexus_repo }
291 __artifacts_version__: { get_param: artifacts_version }
292 __oam_network_cidr__: { get_attr: [oam_ecomp_subnet, cidr] }
293 __dns_ip_addr__: { get_param: dns_ip_addr }
294 __aai_ip_addr__: { get_param: aai_ip_addr }
295 __appc_ip_addr__: { get_param: appc_ip_addr }
296 __dcae_ip_addr__: { get_param: dcae_ip_addr }
297 __mso_ip_addr__: { get_param: mso_ip_addr }
298 __mr_ip_addr__: { get_param: mr_ip_addr }
299 __policy_ip_addr__: { get_param: policy_ip_addr }
300 __portal_ip_addr__: { get_param: policy_ip_addr }
301 __robot_ip_addr__: { get_param: robot_ip_addr }
302 __sdc_ip_addr__: { get_param: sdc_ip_addr }
303 __sdnc_ip_addr__: { get_param: sdnc_ip_addr }
304 __vid_ip_addr__: { get_param: vid_ip_addr }
310 echo 127.0.0.1 $hn >> /etc/hosts
312 # Download dependencies
313 add-apt-repository -y ppa:openjdk-r/ppa
315 apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk bind9 bind9utils bind9-doc ntp ntpdate
318 mkdir /etc/bind/zones
319 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/bind_zones -o /etc/bind/zones/db.simpledemo.openecomp.org
320 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/bind_options -o /etc/bind/named.conf.options
321 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/named.conf.local -o /etc/bind/named.conf.local
324 #NETMASK=$(echo "__oam_network_cidr__" | cut -d"/" -f2)
325 #if [[ $NETMASK == "8" ]]
327 # ADDR=$(echo "__dns_ip_addr__" | cut -d"." -f1)
328 #elif [[ $NETMASK == "16" ]]
330 # ADDR=$(echo "__dns_ip_addr__" | cut -d"." -f1).$(echo "__dns_ip_addr__" | cut -d"." -f2)
331 #elif [[ $NETMASK == "24" ]]
333 # ADDR=$(echo "__dns_ip_addr__" | cut -d"." -f1).$(echo "__dns_ip_addr__" | cut -d"." -f2).$(echo "__dns_ip_addr__" | cut -d"." -f3)
336 #sed -i "s/netmask/$ADDR\/$NETMASK/g" /etc/bind/named.conf.options
337 sed -i "s/dns_ip_addr/"__dns_ip_addr__"/g" /etc/bind/named.conf.options
339 A=$(echo "__dcae_ip_addr__" | cut -d"." -f1)
340 B=$(echo "__dcae_ip_addr__" | cut -d"." -f2)
341 C=$(echo "__dcae_ip_addr__" | cut -d"." -f3)
342 sed -i "s/aai_ip_addr/"__aai_ip_addr__"/g" /etc/bind/zones/db.simpledemo.openecomp.org
343 sed -i "s/appc_ip_addr/"__appc_ip_addr__"/g" /etc/bind/zones/db.simpledemo.openecomp.org
344 sed -i "s/dcae_ip_addr/"__dcae_ip_addr__"/g" /etc/bind/zones/db.simpledemo.openecomp.org
345 sed -i "s/dns_ip_addr/"__dns_ip_addr__"/g" /etc/bind/zones/db.simpledemo.openecomp.org
346 sed -i "s/mso_ip_addr/"__mso_ip_addr__"/g" /etc/bind/zones/db.simpledemo.openecomp.org
347 sed -i "s/mr_ip_addr/"__mr_ip_addr__"/g" /etc/bind/zones/db.simpledemo.openecomp.org
348 sed -i "s/policy_ip_addr/"__policy_ip_addr__"/g" /etc/bind/zones/db.simpledemo.openecomp.org
349 sed -i "s/portal_ip_addr/"__portal_ip_addr__"/g" /etc/bind/zones/db.simpledemo.openecomp.org
350 sed -i "s/robot_ip_addr/"__robot_ip_addr__"/g" /etc/bind/zones/db.simpledemo.openecomp.org
351 sed -i "s/sdc_ip_addr/"__sdc_ip_addr__"/g" /etc/bind/zones/db.simpledemo.openecomp.org
352 sed -i "s/sdnc_ip_addr/"__sdnc_ip_addr__"/g" /etc/bind/zones/db.simpledemo.openecomp.org
353 sed -i "s/vid_ip_addr/"__vid_ip_addr__"/g" /etc/bind/zones/db.simpledemo.openecomp.org
354 sed -i "s/dcae_coll_ip_addr/"$A.$B.$C"/g" /etc/bind/zones/db.simpledemo.openecomp.org
357 sed -i "s/OPTIONS=.*/OPTIONS=\"-4 -u bind\"/g" /etc/default/bind9
359 # Restart bind to pick up configuration changes
360 service bind9 restart
365 type: OS::Neutron::Port
367 network: { get_resource: oam_ecomp }
368 fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: aai_ip_addr }}]
371 type: OS::Neutron::FloatingIP
373 floating_network_id: { get_param: public_net_id }
374 port_id: { get_resource: aai_private_port }
377 type: OS::Nova::Server
380 image: { get_param: ubuntu_1404_image }
381 flavor: { get_param: flavor_xlarge }
386 base: { get_param: vm_base_name }
387 key_name: { get_resource: vm_key }
389 - port: { get_resource: aai_private_port }
390 user_data_format: RAW
394 __nexus_repo__: { get_param: nexus_repo }
395 __nexus_docker_repo__: { get_param: nexus_docker_repo }
396 __nexus_username__: { get_param: nexus_username }
397 __nexus_password__: { get_param: nexus_password }
398 __gitlab_username__: { get_param: gitlab_username }
399 __gitlab_password__: { get_param: gitlab_password }
400 __dmaap_topic__: { get_param: dmaap_topic }
401 __artifacts_version__: { get_param: artifacts_version }
402 __dns_ip_addr__: { get_param: dns_ip_addr }
403 __docker_version__: { get_param: docker_version }
408 echo 127.0.0.1 $hn >> /etc/hosts
410 # Download dependencies
411 add-apt-repository -y ppa:openjdk-r/ppa
413 apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk ntp ntpdate
415 # Download scripts from Nexus
416 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/aai_vm_init.sh -o /opt/aai_vm_init.sh
417 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/aai_serv.sh -o /opt/aai_serv.sh
418 chmod +x /opt/aai_vm_init.sh
419 chmod +x /opt/aai_serv.sh
420 mv /opt/aai_serv.sh /etc/init.d
421 update-rc.d aai_serv.sh defaults
423 # Download and install docker-engine and docker-compose
424 apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
425 echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list
427 apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual
428 apt-get install -y docker-engine
432 mkdir /opt/openecomp/aai
433 mkdir /opt/openecomp/aai/logs
434 mkdir /opt/openecomp/aai/data
436 curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /opt/docker/docker-compose
437 chmod +x /opt/docker/docker-compose
439 # Store credentials in files
441 echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
442 echo "__nexus_username__" > /opt/config/nexus_username.txt
443 echo "__nexus_password__" > /opt/config/nexus_password.txt
444 echo "__dmaap_topic__" > /opt/config/dmaap_topic.txt
445 echo "__gitlab_username__" > /opt/config/gitlab_username.txt
446 echo "__gitlab_password__" > /opt/config/gitlab_password.txt
447 echo "gerrit.onap.org" > /opt/config/gitlab_certname.txt
448 echo "__docker_version__" > /opt/config/docker_version.txt
450 # DNS/GW IP address configuration
451 echo "nameserver __dns_ip_addr__" >> /etc/resolvconf/resolv.conf.d/head
454 # Reboot the VM to pick up configuration changes
460 type: OS::Neutron::Port
462 network: { get_resource: oam_ecomp }
463 fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: mso_ip_addr }}]
466 type: OS::Neutron::FloatingIP
468 floating_network_id: { get_param: public_net_id }
469 port_id: { get_resource: mso_private_port }
472 type: OS::Nova::Server
474 image: { get_param: ubuntu_1604_image }
475 flavor: { get_param: flavor_large }
480 base: { get_param: vm_base_name }
481 key_name: { get_resource: vm_key }
483 - port: { get_resource: mso_private_port }
484 user_data_format: RAW
488 __nexus_repo__: { get_param: nexus_repo }
489 __nexus_docker_repo__: { get_param: nexus_docker_repo }
490 __nexus_username__: { get_param: nexus_username }
491 __nexus_password__: { get_param: nexus_password }
492 __gitlab_username__: { get_param: gitlab_username }
493 __gitlab_password__: { get_param: gitlab_password }
494 __openstack_username__: { get_param: openstack_username }
495 __openstack_tenant_id__: { get_param: openstack_tenant_id }
496 __openstack_api_key__: { get_param: openstack_api_key }
497 __keystone_url__: { get_param: keystone_url }
498 __dmaap_topic__: { get_param: dmaap_topic }
499 __artifacts_version__: { get_param: artifacts_version }
500 __dns_ip_addr__: { get_param: dns_ip_addr }
501 __docker_version__: { get_param: docker_version }
502 __gerrit_branch__: { get_param: gerrit_branch }
507 echo 127.0.0.1 $hn >> /etc/hosts
509 # Download dependencies
510 add-apt-repository -y ppa:openjdk-r/ppa
512 apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk git ntp ntpdate
514 # Download scripts from Nexus
515 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/mso_vm_init.sh -o /opt/mso_vm_init.sh
516 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/mso_serv.sh -o /opt/mso_serv.sh
517 chmod +x /opt/mso_vm_init.sh
518 chmod +x /opt/mso_serv.sh
519 mv /opt/mso_serv.sh /etc/init.d
520 update-rc.d mso_serv.sh defaults
522 # Download and install docker-engine and docker-compose
523 apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
524 echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" | sudo tee /etc/apt/sources.list.d/docker.list
526 apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual
527 apt-get install -y docker-engine
531 curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /opt/docker/docker-compose
532 chmod +x /opt/docker/docker-compose
534 # Store credentials in files
536 echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
537 echo "__nexus_username__" > /opt/config/nexus_username.txt
538 echo "__nexus_password__" > /opt/config/nexus_password.txt
539 echo "__gitlab_username__" > /opt/config/gitlab_username.txt
540 echo "__gitlab_password__" > /opt/config/gitlab_password.txt
541 echo "__openstack_username__" > /opt/config/openstack_username.txt
542 echo "__openstack_tenant_id__" > /opt/config/tenant_id.txt
543 echo "__keystone_url__" > /opt/config/keystone.txt
544 echo "__dmaap_topic__" > /opt/config/dmaap_topic.txt
545 echo "__docker_version__" > /opt/config/docker_version.txt
547 # Clone Gerrit repository
549 git clone -b __gerrit_branch__ --single-branch https://__gitlab_username__:__gitlab_password__@gerrit.onap.org/r/a/mso/docker-config.git test_lab
550 MSO_ENCRYPTION_KEY=$(cat /opt/test_lab/encryption.key)
551 echo -n "__openstack_api_key__" | openssl aes-128-ecb -e -K $MSO_ENCRYPTION_KEY -nosalt | xxd -c 256 -p > /opt/config/api_key.txt
553 # Rename network interface
554 sed -i "s/GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX=\"net.ifnames=0 biosdevname=0\"/g" /etc/default/grub
555 grub-mkconfig -o /boot/grub/grub.cfg
556 sed -i "s/ens3/eth0/g" /etc/network/interfaces.d/*.cfg
558 # DNS/GW IP address configuration
559 echo "nameserver __dns_ip_addr__" >> /etc/resolvconf/resolv.conf.d/head
562 # Reboot the VM to pick up configuration changes
566 # Message Router instantiation
567 mrouter_private_port:
568 type: OS::Neutron::Port
570 network: { get_resource: oam_ecomp }
571 fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: mr_ip_addr }}]
574 type: OS::Neutron::FloatingIP
576 floating_network_id: { get_param: public_net_id }
577 port_id: { get_resource: mrouter_private_port }
580 type: OS::Nova::Server
582 image: { get_param: ubuntu_1404_image }
583 flavor: { get_param: flavor_large }
586 template: base-message-router
588 base: { get_param: vm_base_name }
589 key_name: { get_resource: vm_key }
591 - port: { get_resource: mrouter_private_port }
592 user_data_format: RAW
596 __nexus_repo__: { get_param: nexus_repo }
597 __nexus_docker_repo__: { get_param: nexus_docker_repo }
598 __nexus_username__: { get_param: nexus_username }
599 __nexus_password__: { get_param: nexus_password }
600 __gitlab_username__: { get_param: gitlab_username }
601 __gitlab_password__: { get_param: gitlab_password }
602 __artifacts_version__: { get_param: artifacts_version }
603 __dns_ip_addr__: { get_param: dns_ip_addr }
604 __gerrit_branch__: { get_param: gerrit_branch }
609 echo 127.0.0.1 $hn >> /etc/hosts
611 # Download dependencies
612 add-apt-repository -y ppa:openjdk-r/ppa
614 apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk ntp ntpdate
616 # Download scripts from Nexus
617 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/mr_vm_init.sh -o /opt/mr_vm_init.sh
618 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/mr_serv.sh -o /opt/mr_serv.sh
619 chmod +x /opt/mr_vm_init.sh
620 chmod +x /opt/mr_serv.sh
621 mv /opt/mr_serv.sh /etc/init.d
622 update-rc.d mr_serv.sh defaults
624 # Download and install docker-engine and docker-compose
625 apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
626 echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list
628 apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual
629 apt-get install -y docker-engine
633 curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /opt/docker/docker-compose
634 chmod +x /opt/docker/docker-compose
636 # Store credentials in files
638 echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
639 echo "__nexus_username__" > /opt/config/nexus_username.txt
640 echo "__nexus_password__" > /opt/config/nexus_password.txt
641 echo "__gitlab_username__" > /opt/config/gitlab_username.txt
642 echo "__gitlab_password__" > /opt/config/gitlab_password.txt
644 # Clone Gerrit repository
646 git clone -b __gerrit_branch__ --single-branch https://__gitlab_username__:__gitlab_password__@gerrit.onap.org/r/a/dcae/demo/startup/message-router.git dcae-startup-vm-message-router
648 # DNS/GW IP address configuration
649 echo "nameserver __dns_ip_addr__" >> /etc/resolvconf/resolv.conf.d/head
652 # Reboot the VM to pick up configuration changes
656 # Robot Framework instantiation
658 type: OS::Neutron::Port
660 network: { get_resource: oam_ecomp }
661 fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: robot_ip_addr }}]
664 type: OS::Neutron::FloatingIP
666 floating_network_id: { get_param: public_net_id }
667 port_id: { get_resource: robot_private_port }
670 type: OS::Nova::Server
672 image: { get_param: ubuntu_1604_image }
673 flavor: { get_param: flavor_small }
678 base: { get_param: vm_base_name }
679 key_name: { get_resource: vm_key }
681 - port: { get_resource: robot_private_port }
682 user_data_format: RAW
686 __nexus_repo__: { get_param: nexus_repo }
687 __nexus_docker_repo__: { get_param: nexus_docker_repo }
688 __nexus_username__: { get_param: nexus_username }
689 __nexus_password__: { get_param: nexus_password }
690 __gitlab_username__: { get_param: gitlab_username }
691 __gitlab_password__: { get_param: gitlab_password }
692 __network_name__: { get_attr: [oam_ecomp, name] }
693 __openstack_username__: { get_param: openstack_username }
694 __openstack_api_key__: { get_param : openstack_api_key }
695 __artifacts_version__: { get_param: artifacts_version }
696 __openstack_region__: { get_param: openstack_region }
697 __dns_ip_addr__: { get_param: dns_ip_addr }
698 __docker_version__: { get_param: docker_version }
699 __gerrit_branch__: { get_param: gerrit_branch }
704 echo 127.0.0.1 $hn >> /etc/hosts
706 # Download dependencies
707 add-apt-repository -y ppa:openjdk-r/ppa
709 apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk ntp ntpdate
710 echo "APT::Periodic::Unattended-Upgrade \"0\";" >> /etc/apt/apt.conf.d/10periodic
712 # Download scripts from Nexus
713 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/robot_vm_init.sh -o /opt/robot_vm_init.sh
714 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/robot_serv.sh -o /opt/robot_serv.sh
715 chmod +x /opt/robot_vm_init.sh
716 chmod +x /opt/robot_serv.sh
717 mv /opt/robot_serv.sh /etc/init.d
718 update-rc.d robot_serv.sh defaults
720 # Download and install docker-engine and docker-compose
721 apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
722 echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" | sudo tee /etc/apt/sources.list.d/docker.list
724 apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual
725 apt-get install -y docker-engine
729 curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /opt/docker/docker-compose
730 chmod +x /opt/docker/docker-compose
732 # Store credentials in files
734 echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
735 echo "__nexus_repo__" > /opt/config/nexus_repo.txt
736 echo "__nexus_username__" > /opt/config/nexus_username.txt
737 echo "__nexus_password__" > /opt/config/nexus_password.txt
738 echo "__gitlab_username__" > /opt/config/gitlab_username.txt
739 echo "__gitlab_password__" > /opt/config/gitlab_password.txt
740 echo "__network_name__" > /opt/config/network.txt
741 echo "__openstack_username__" > /opt/config/openstack_username.txt
742 echo "__openstack_api_key__" > /opt/config/openstack_password.txt
743 echo "__openstack_region__" > /opt/config/region.txt
744 echo "__artifacts_version__" > /opt/config/artifacts_version.txt
745 echo "__docker_version__" > /opt/config/docker_version.txt
747 # Execute RobotETE-specific instructions: create share folder to run as a docker volume
748 mkdir -p /opt/eteshare/logs
749 mkdir -p /opt/eteshare/config
751 # Clone Gerrit repository
753 git clone -b __gerrit_branch__ --single-branch https://__gitlab_username__:__gitlab_password__@gerrit.onap.org/r/a/testsuite/properties.git testsuite/properties
755 # Rename network interface
756 sed -i "s/GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX=\"net.ifnames=0 biosdevname=0\"/g" /etc/default/grub
757 grub-mkconfig -o /boot/grub/grub.cfg
758 sed -i "s/ens3/eth0/g" /etc/network/interfaces.d/*.cfg
760 # DNS/GW IP address configuration
761 echo "nameserver __dns_ip_addr__" >> /etc/resolvconf/resolv.conf.d/head
764 # Reboot the VM to pick up configuration changes
770 type: OS::Neutron::Port
772 network: { get_resource: oam_ecomp }
773 fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: vid_ip_addr }}]
776 type: OS::Neutron::FloatingIP
778 floating_network_id: { get_param: public_net_id }
779 port_id: { get_resource: vid_private_port }
782 type: OS::Nova::Server
784 image: { get_param: ubuntu_1404_image }
785 flavor: { get_param: flavor_medium }
790 base: { get_param: vm_base_name }
791 key_name: { get_resource: vm_key }
793 - port: { get_resource: vid_private_port }
794 user_data_format: RAW
798 __nexus_repo__: { get_param: nexus_repo }
799 __nexus_docker_repo__: { get_param: nexus_docker_repo }
800 __nexus_username__: { get_param: nexus_username }
801 __nexus_password__: { get_param: nexus_password }
802 __gitlab_username__: { get_param: gitlab_username }
803 __gitlab_password__: { get_param: gitlab_password }
804 __artifacts_version__: { get_param: artifacts_version }
805 __dns_ip_addr__: { get_param: dns_ip_addr }
806 __docker_version__: { get_param: docker_version }
807 __gerrit_branch__: { get_param: gerrit_branch }
812 echo 127.0.0.1 $hn >> /etc/hosts
814 # Download dependencies
815 add-apt-repository -y ppa:openjdk-r/ppa
817 apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk make git ntp ntpdate
819 # Download scripts from Nexus
820 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/vid_vm_init.sh -o /opt/vid_vm_init.sh
821 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/vid_serv.sh -o /opt/vid_serv.sh
822 chmod +x /opt/vid_vm_init.sh
823 chmod +x /opt/vid_serv.sh
824 mv /opt/vid_serv.sh /etc/init.d
825 update-rc.d vid_serv.sh defaults
827 # Download and install docker-engine and docker-compose
828 apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
829 echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list
831 apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual
832 apt-get install -y docker-engine
836 curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /opt/docker/docker-compose
837 chmod +x /opt/docker/docker-compose
839 # Store credentials in files
841 echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
842 echo "__nexus_username__" > /opt/config/nexus_username.txt
843 echo "__nexus_password__" > /opt/config/nexus_password.txt
844 echo "__gitlab_username__" > /opt/config/gitlab_username.txt
845 echo "__gitlab_password__" > /opt/config/gitlab_password.txt
846 echo "__docker_version__" > /opt/config/docker_version.txt
848 # Clone Gerrit repository
850 git clone -b __gerrit_branch__ --single-branch https://__gitlab_username__:__gitlab_password__@gerrit.onap.org/r/a/vid.git
852 # DNS/GW IP address configuration
853 echo "nameserver __dns_ip_addr__" >> /etc/resolvconf/resolv.conf.d/head
856 # Reboot the VM to pick up configuration changes
860 # SDN-C instantiation
862 type: OS::Neutron::Port
864 network: { get_resource: oam_ecomp }
865 fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: sdnc_ip_addr }}]
868 type: OS::Neutron::FloatingIP
870 floating_network_id: { get_param: public_net_id }
871 port_id: { get_resource: sdnc_private_port }
874 type: OS::Nova::Server
876 image: { get_param: ubuntu_1404_image }
877 flavor: { get_param: flavor_large }
882 base: { get_param: vm_base_name }
883 key_name: { get_resource: vm_key }
885 - port: { get_resource: sdnc_private_port }
886 user_data_format: RAW
890 __nexus_repo__: { get_param: nexus_repo }
891 __nexus_docker_repo__: { get_param: nexus_docker_repo }
892 __nexus_username__: { get_param: nexus_username }
893 __nexus_password__: { get_param: nexus_password }
894 __gitlab_username__: { get_param: gitlab_username }
895 __gitlab_password__: { get_param: gitlab_password }
896 __artifacts_version__: { get_param: artifacts_version }
897 __dns_ip_addr__: { get_param: dns_ip_addr }
898 __docker_version__: { get_param: docker_version }
899 __gerrit_branch__: { get_param: gerrit_branch }
904 echo 127.0.0.1 $hn >> /etc/hosts
906 # Download dependencies
907 add-apt-repository -y ppa:openjdk-r/ppa
909 apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk ntp ntpdate
911 # Download scripts from Nexus
912 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/sdnc_vm_init.sh -o /opt/sdnc_vm_init.sh
913 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/sdnc_serv.sh -o /opt/sdnc_serv.sh
914 chmod +x /opt/sdnc_vm_init.sh
915 chmod +x /opt/sdnc_serv.sh
916 mv /opt/sdnc_serv.sh /etc/init.d
917 update-rc.d sdnc_serv.sh defaults
919 # Download and install docker-engine and docker-compose
920 apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
921 echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list
923 apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual
924 apt-get install -y docker-engine
928 curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /opt/docker/docker-compose
929 chmod +x /opt/docker/docker-compose
931 # Store credentials in files
933 echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
934 echo "__nexus_username__" > /opt/config/nexus_username.txt
935 echo "__nexus_password__" > /opt/config/nexus_password.txt
936 echo "__gitlab_username__" > /opt/config/gitlab_username.txt
937 echo "__gitlab_password__" > /opt/config/gitlab_password.txt
938 echo "__docker_version__" > /opt/config/docker_version.txt
940 # Clone Gerrit repository
942 git clone -b __gerrit_branch__ --single-branch https://__gitlab_username__:__gitlab_password__@gerrit.onap.org/r/a/sdnc/oam.git sdnc
944 # DNS/GW IP address configuration
945 echo "nameserver __dns_ip_addr__" >> /etc/resolvconf/resolv.conf.d/head
948 # Reboot the VM to pick up configuration changes
954 type: OS::Neutron::Port
956 network: { get_resource: oam_ecomp }
957 fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: sdc_ip_addr }}]
960 type: OS::Neutron::FloatingIP
962 floating_network_id: { get_param: public_net_id }
963 port_id: { get_resource: sdc_private_port }
966 type: OS::Cinder::Volume
971 sdc_volume_attachment:
972 type: OS::Cinder::VolumeAttachment
974 volume_id: { get_resource: sdc_volume_data }
975 instance_uuid: { get_resource: sdc_vm }
979 type: OS::Nova::Server
981 image: { get_param: ubuntu_1604_image }
982 flavor: { get_param: flavor_xlarge }
987 base: { get_param: vm_base_name }
988 key_name: { get_resource: vm_key }
990 - port: { get_resource: sdc_private_port }
991 user_data_format: RAW
995 __nexus_repo__: { get_param: nexus_repo }
996 __nexus_docker_repo__: { get_param: nexus_docker_repo }
997 __nexus_username__: { get_param: nexus_username }
998 __nexus_password__: { get_param: nexus_password }
999 __gitlab_username__: { get_param: gitlab_username }
1000 __gitlab_password__: { get_param: gitlab_password }
1001 __env_name__: { get_param: dmaap_topic }
1002 __artifacts_version__: { get_param: artifacts_version }
1003 __dns_ip_addr__: { get_param: dns_ip_addr }
1004 __mr_ip_addr__: { get_param: mr_ip_addr }
1005 __public_ip__: { get_attr: [sdc_floating_ip, floating_ip_address] }
1006 __docker_version__: { get_param: docker_version }
1007 __gerrit_branch__: { get_param: gerrit_branch }
1012 echo 127.0.0.1 $hn >> /etc/hosts
1014 # Download dependencies
1015 add-apt-repository -y ppa:openjdk-r/ppa
1017 apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk ntp ntpdate
1019 # Download scripts from Nexus
1020 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/asdc_vm_init.sh -o /opt/asdc_vm_init.sh
1021 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/asdc_serv.sh -o /opt/asdc_serv.sh
1022 chmod +x /opt/asdc_vm_init.sh
1023 chmod +x /opt/asdc_serv.sh
1024 mv /opt/asdc_serv.sh /etc/init.d
1025 update-rc.d asdc_serv.sh defaults
1027 # Download and install docker-engine and docker-compose
1028 apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
1029 echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" | sudo tee /etc/apt/sources.list.d/docker.list
1031 apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual
1032 apt-get install -y docker-engine
1033 service docker start
1035 curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /opt/docker/docker-compose
1036 chmod +x /opt/docker/docker-compose
1038 # Create partition and mount the external volume
1039 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/asdc_ext_volume_partitions.txt -o /opt/asdc_ext_volume_partitions.txt
1040 sfdisk /dev/vdb < /opt/asdc_ext_volume_partitions.txt
1041 mkfs -t ext4 /dev/vdb1
1043 mount /dev/vdb1 /data
1044 echo "/dev/vdb1 /data ext4 errors=remount-ro,noatime,barrier=0 0 1" >> /etc/fstab
1046 # Store credentials in files
1047 mkdir -p /opt/config
1048 echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
1049 echo "__nexus_username__" > /opt/config/nexus_username.txt
1050 echo "__nexus_password__" > /opt/config/nexus_password.txt
1051 echo "__gitlab_username__" > /opt/config/gitlab_username.txt
1052 echo "__gitlab_password__" > /opt/config/gitlab_password.txt
1053 echo "__env_name__" > /opt/config/env_name.txt
1054 echo "__mr_ip_addr__" > /opt/config/mr_ip_addr.txt
1055 echo "__public_ip__" > /opt/config/public_ip.txt
1056 echo "__docker_version__" > /opt/config/docker_version.txt
1058 # Run SDC-specific instructions
1060 mkdir -p /data/environments
1061 mkdir -p /data/scripts
1062 mkdir -p /data/logs/BE
1063 mkdir -p /data/logs/FE
1065 chmod 777 /data/logs/BE
1066 chmod 777 /data/logs/FE
1068 # Clone Gerrit repository
1069 git clone -b __gerrit_branch__ --single-branch https://__gitlab_username__:__gitlab_password__@gerrit.onap.org/r/a/sdc.git
1071 cat > /root/.bash_aliases << EOF
1072 alias dcls='/data/scripts/docker_clean.sh \$1'
1073 alias dlog='/data/scripts/docker_login.sh \$1'
1074 alias rund='/data/scripts/docker_run.sh'
1075 alias health='/data/scripts/docker_health.sh'
1078 # Rename network interface
1079 sed -i "s/GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX=\"net.ifnames=0 biosdevname=0\"/g" /etc/default/grub
1080 grub-mkconfig -o /boot/grub/grub.cfg
1081 sed -i "s/ens3/eth0/g" /etc/network/interfaces.d/*.cfg
1083 # DNS/GW IP address configuration
1084 echo "nameserver __dns_ip_addr__" >> /etc/resolvconf/resolv.conf.d/head
1087 # Reboot the VM to pick up configuration changes
1091 # PORTAL instantiation
1092 portal_private_port:
1093 type: OS::Neutron::Port
1095 network: { get_resource: oam_ecomp }
1096 fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: portal_ip_addr }}]
1099 type: OS::Neutron::FloatingIP
1101 floating_network_id: { get_param: public_net_id }
1102 port_id: { get_resource: portal_private_port }
1105 type: OS::Nova::Server
1107 image: { get_param: ubuntu_1404_image }
1108 flavor: { get_param: flavor_large }
1111 template: base-portal
1113 base: { get_param: vm_base_name }
1114 key_name: { get_resource: vm_key }
1116 - port: { get_resource: portal_private_port }
1117 user_data_format: RAW
1121 __nexus_repo__: { get_param: nexus_repo }
1122 __nexus_docker_repo__: { get_param: nexus_docker_repo }
1123 __nexus_username__: { get_param: nexus_username }
1124 __nexus_password__: { get_param: nexus_password }
1125 __gitlab_username__: { get_param: gitlab_username }
1126 __gitlab_password__: { get_param: gitlab_password }
1127 __artifacts_version__: { get_param: artifacts_version }
1128 __dns_ip_addr__: { get_param: dns_ip_addr }
1129 __public_ip__: { get_attr: [portal_floating_ip, floating_ip_address] }
1130 __docker_version__: { get_param: docker_version }
1131 __gerrit_branch__: { get_param: gerrit_branch }
1136 echo 127.0.0.1 $hn >> /etc/hosts
1138 # Download dependencies
1139 add-apt-repository -y ppa:openjdk-r/ppa
1141 apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk unzip mysql-client-core-5.6 ntp ntpdate
1143 # Download scripts from Nexus
1144 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/portal_vm_init.sh -o /opt/portal_vm_init.sh
1145 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/portal_serv.sh -o /opt/portal_serv.sh
1146 chmod +x /opt/portal_vm_init.sh
1147 chmod +x /opt/portal_serv.sh
1148 mv /opt/portal_serv.sh /etc/init.d
1149 update-rc.d portal_serv.sh defaults
1151 # Download and install docker-engine and docker-compose
1152 apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
1153 echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list
1155 apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual
1156 apt-get install -y docker-engine
1157 service docker start
1159 curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /opt/docker/docker-compose
1160 chmod +x /opt/docker/docker-compose
1162 # Store credentials in files
1163 mkdir -p /opt/config
1164 echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
1165 echo "__nexus_username__" > /opt/config/nexus_username.txt
1166 echo "__nexus_password__" > /opt/config/nexus_password.txt
1167 echo "__gitlab_username__" > /opt/config/gitlab_username.txt
1168 echo "__gitlab_password__" > /opt/config/gitlab_password.txt
1169 echo "__public_ip__" > /opt/config/public_ip.txt
1170 echo "__docker_version__" > /opt/config/docker_version.txt
1172 # Clone Gerrit repository
1173 mkdir -p /PROJECT/OpenSource/UbuntuEP/logs
1175 git clone -b __gerrit_branch__ --single-branch https://__gitlab_username__:__gitlab_password__@gerrit.onap.org/r/a/portal.git
1177 # DNS/GW IP address configuration
1178 echo "nameserver __dns_ip_addr__" >> /etc/resolvconf/resolv.conf.d/head
1181 # Reboot the VM to pick up configuration changes
1185 # DCAE Controller instantiation
1186 dcae_c_private_port:
1187 type: OS::Neutron::Port
1189 network: { get_resource: oam_ecomp }
1190 fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: dcae_ip_addr }}]
1193 type: OS::Neutron::FloatingIP
1195 floating_network_id: { get_param: public_net_id }
1196 port_id: { get_resource: dcae_c_private_port }
1199 type: OS::Nova::Server
1201 image: { get_param: ubuntu_1404_image }
1202 flavor: { get_param: flavor_medium }
1205 template: base-dcae-controller
1207 base: { get_param: vm_base_name }
1208 key_name: { get_resource: vm_key }
1210 - port: { get_resource: dcae_c_private_port }
1211 user_data_format: RAW
1215 __nexus_repo__: { get_param: nexus_repo }
1216 __nexus_docker_repo__: { get_param: nexus_docker_repo }
1217 __nexus_username__: { get_param: nexus_username }
1218 __nexus_password__: { get_param: nexus_password }
1219 __nexus_url_snapshots__: { get_param: nexus_url_snapshot }
1220 __gitlab_username__: { get_param: gitlab_username }
1221 __gitlab_password__: { get_param: gitlab_password }
1222 __gitlab_branch__: { get_param: gitlab_branch }
1223 __dns_ip_addr__: { get_param: dns_ip_addr }
1224 __dcae_zone__: { get_param: dcae_zone }
1225 __dcae_state__: { get_param: dcae_state }
1226 __artifacts_version__: { get_param: artifacts_version }
1227 __tenant_id__: { get_param: openstack_tenant_id }
1228 __openstack_private_network_name__: { get_attr: [oam_ecomp, name] }
1229 __openstack_user__: { get_param: openstack_username }
1230 __openstack_password__: { get_param: openstack_api_key }
1231 __key_name__: { get_param: key_name }
1232 __rand_str__: { get_resource: random-str }
1233 __pub_key__: { get_param: pub_key }
1234 __nexus_repo_root__: { get_param: nexus_repo_root }
1235 __openstack_region__: { get_param: openstack_region }
1236 __horizon_url__ : { get_param: horizon_url }
1237 __keystone_url__ : { get_param: keystone_url }
1238 __docker_version__: { get_param: docker_version }
1239 __gerrit_branch__: { get_param: gerrit_branch }
1244 echo 127.0.0.1 $hn >> /etc/hosts
1246 # Download dependencies
1247 add-apt-repository -y ppa:openjdk-r/ppa
1249 apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk make git ntp ntpdate
1251 # Download scripts from Nexus
1252 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/dcae_vm_init.sh -o /opt/dcae_vm_init.sh
1253 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/dcae_serv.sh -o /opt/dcae_serv.sh
1254 chmod +x /opt/dcae_vm_init.sh
1255 chmod +x /opt/dcae_serv.sh
1256 mv /opt/dcae_serv.sh /etc/init.d
1257 update-rc.d dcae_serv.sh defaults
1259 # Download and install docker-engine and docker-compose
1260 apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
1261 echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list
1263 apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual
1264 apt-get install -y docker-engine
1265 service docker start
1267 curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /opt/docker/docker-compose
1268 chmod +x /opt/docker/docker-compose
1270 # Clone Gerrit repository
1272 git clone -b __gerrit_branch__ --single-branch https://__gitlab_username__:__gitlab_password__@gerrit.onap.org/r/a/dcae/demo/startup/controller.git dcae-startup-vm-controller
1274 # DCAE Controller specific deployment
1275 cd /opt/dcae-startup-vm-controller
1276 mkdir -p /opt/app/dcae-controller
1277 cat > /opt/app/dcae-controller/config.yaml << EOF_CONFIG
1279 STATE: __dcae_state__
1280 DCAE-VERSION: __artifacts_version__
1281 HORIZON-URL: __horizon_url__/__openstack_user__
1282 KEYSTONE-URL: __keystone_url__
1283 OPENSTACK-TENANT-ID: __tenant_id__
1284 OPENSTACK-TENANT-NAME: OPEN-ECOMP
1285 OPENSTACK-REGION: __openstack_region__
1286 OPENSTACK-PRIVATE-NETWORK: __openstack_private_network_name__
1287 OPENSTACK-USER: __openstack_user__
1288 OPENSTACK-PASSWORD: __openstack_password__
1289 OPENSTACK-KEYNAME: __key_name_____rand_str___dcae
1290 OPENSTACK-PUBKEY: __pub_key__
1292 NEXUS-URL-ROOT: __nexus_repo_root__
1293 NEXUS-USER: __nexus_username__
1294 NEXUS-PASSWORD: __nexus_password__
1295 NEXUS-URL-SNAPSHOTS: __nexus_url_snapshots__
1296 NEXUS-RAWURL: __nexus_repo__
1298 DOCKER-REGISTRY: __nexus_docker_repo__
1300 GIT-MR-REPO: https://__gitlab_username__:__gitlab_password__@gerrit.onap.org/r/a/dcae/demo/startup/message-router.git
1303 # Store credentials in files
1304 mkdir -p /opt/config
1305 echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
1306 echo "__nexus_username__" > /opt/config/nexus_username.txt
1307 echo "__nexus_password__" > /opt/config/nexus_password.txt
1308 echo "__gitlab_username__" > /opt/config/gitlab_username.txt
1309 echo "__gitlab_password__" > /opt/config/gitlab_password.txt
1310 echo "__gitlab_branch__" > /opt/config/gitlab_branch.txt
1311 echo "__docker_version__" > /opt/config/docker_version.txt
1313 # DNS/GW IP address configuration
1314 echo "nameserver __dns_ip_addr__" >> /etc/resolvconf/resolv.conf.d/head
1317 # Reboot the VM to pick up configuration changes
1321 # Policy Engine instantiation
1322 policy_private_port:
1323 type: OS::Neutron::Port
1325 network: { get_resource: oam_ecomp }
1326 fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: policy_ip_addr }}]
1329 type: OS::Neutron::FloatingIP
1331 floating_network_id: { get_param: public_net_id }
1332 port_id: { get_resource: policy_private_port }
1335 type: OS::Nova::Server
1337 image: { get_param: ubuntu_1404_image }
1338 flavor: { get_param: flavor_xlarge }
1341 template: base-policy
1343 base: { get_param: vm_base_name }
1344 key_name: { get_resource: vm_key }
1346 - port: { get_resource: policy_private_port }
1347 user_data_format: RAW
1351 __nexus_repo__: { get_param: nexus_repo }
1352 __nexus_docker_repo__: { get_param: nexus_docker_repo }
1353 __nexus_username__: { get_param: nexus_username }
1354 __nexus_password__: { get_param: nexus_password }
1355 __gitlab_username__: { get_param: gitlab_username }
1356 __gitlab_password__: { get_param: gitlab_password }
1357 __artifacts_version__: { get_param: artifacts_version }
1358 __dns_ip_addr__: { get_param: dns_ip_addr }
1359 __public_ip__: { get_attr: [policy_floating_ip, floating_ip_address] }
1360 __docker_version__: { get_param: docker_version }
1361 __gerrit_branch__: { get_param: gerrit_branch }
1366 echo 127.0.0.1 $hn >> /etc/hosts
1368 # Download dependencies
1369 add-apt-repository -y ppa:openjdk-r/ppa
1371 apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk ntp ntpdate
1373 # Download scripts from Nexus
1374 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/policy_vm_init.sh -o /opt/policy_vm_init.sh
1375 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/policy_serv.sh -o /opt/policy_serv.sh
1376 chmod +x /opt/policy_vm_init.sh
1377 chmod +x /opt/policy_serv.sh
1378 mv /opt/policy_serv.sh /etc/init.d
1379 update-rc.d policy_serv.sh defaults
1381 # Download and install docker-engine and docker-compose
1382 apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
1383 echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list
1385 apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual
1386 apt-get install -y docker-engine
1387 service docker start
1389 curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /opt/docker/docker-compose
1390 chmod +x /opt/docker/docker-compose
1392 # Store credentials in files
1393 mkdir -p /opt/config
1394 echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
1395 echo "__nexus_username__" > /opt/config/nexus_username.txt
1396 echo "__nexus_password__" > /opt/config/nexus_password.txt
1397 echo "__gitlab_username__" > /opt/config/gitlab_username.txt
1398 echo "__gitlab_password__" > /opt/config/gitlab_password.txt
1399 echo "__public_ip__" > /opt/config/public_ip.txt
1400 echo "__docker_version__" > /opt/config/docker_version.txt
1402 # Clone Gerrit repository
1404 git clone -b __gerrit_branch__ --single-branch https://__gitlab_username__:__gitlab_password__@gerrit.onap.org/r/a/policy/docker.git policy
1406 # DNS/GW IP address configuration
1407 echo "nameserver __dns_ip_addr__" >> /etc/resolvconf/resolv.conf.d/head
1410 # Reboot the VM to pick up configuration changes
1414 # APP-C instantiation
1416 type: OS::Neutron::Port
1418 network: { get_resource: oam_ecomp }
1419 fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: appc_ip_addr }}]
1422 type: OS::Neutron::FloatingIP
1424 floating_network_id: { get_param: public_net_id }
1425 port_id: { get_resource: appc_private_port }
1428 type: OS::Nova::Server
1430 image: { get_param: ubuntu_1404_image }
1431 flavor: { get_param: flavor_large }
1436 base: { get_param: vm_base_name }
1437 key_name: { get_resource: vm_key }
1439 - port: { get_resource: appc_private_port }
1440 user_data_format: RAW
1444 __nexus_repo__: { get_param: nexus_repo }
1445 __nexus_docker_repo__: { get_param: nexus_docker_repo }
1446 __nexus_username__: { get_param: nexus_username }
1447 __nexus_password__: { get_param: nexus_password }
1448 __gitlab_username__: { get_param: gitlab_username }
1449 __gitlab_password__: { get_param: gitlab_password }
1450 __dmaap_topic__: { get_param: dmaap_topic }
1451 __artifacts_version__: { get_param: artifacts_version }
1452 __dns_ip_addr__: { get_param: dns_ip_addr }
1453 __docker_version__: { get_param: docker_version }
1454 __gerrit_branch__: { get_param: gerrit_branch }
1459 echo 127.0.0.1 $hn >> /etc/hosts
1461 # Download dependencies
1462 add-apt-repository -y ppa:openjdk-r/ppa
1464 apt-get install -y apt-transport-https ca-certificates wget openjdk-7-jdk ntp ntpdate
1466 # Download scripts from Nexus
1467 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/appc_vm_init.sh -o /opt/appc_vm_init.sh
1468 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/appc_serv.sh -o /opt/appc_serv.sh
1469 chmod +x /opt/appc_vm_init.sh
1470 chmod +x /opt/appc_serv.sh
1471 mv /opt/appc_serv.sh /etc/init.d
1472 update-rc.d appc_serv.sh defaults
1474 # Download and install docker-engine and docker-compose
1475 apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
1476 echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list
1478 apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual
1479 apt-get install -y docker-engine
1480 service docker start
1483 curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /opt/docker/docker-compose
1484 chmod +x /opt/docker/docker-compose
1486 # Store credentials in files
1487 mkdir -p /opt/config
1488 echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
1489 echo "__nexus_username__" > /opt/config/nexus_username.txt
1490 echo "__nexus_password__" > /opt/config/nexus_password.txt
1491 echo "__gitlab_username__" > /opt/config/gitlab_username.txt
1492 echo "__gitlab_password__" > /opt/config/gitlab_password.txt
1493 echo "__dmaap_topic__" > /opt/config/dmaap_topic.txt
1494 echo "__docker_version__" > /opt/config/docker_version.txt
1496 # Clone Gerrit repository
1498 git clone -b __gerrit_branch__ --single-branch https://__gitlab_username__:__gitlab_password__@gerrit.onap.org/r/a/appc/deployment.git appc
1500 # DNS/GW IP address configuration
1501 echo "nameserver __dns_ip_addr__" >> /etc/resolvconf/resolv.conf.d/head
1504 # Reboot the VM to pick up configuration changes