1 heat_template_version: 2015-10-15
3 description: Heat template to install ONAP components on Mitaka OpenStack
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: Artifacts version of ONAP components
76 label: Version number of ONAP docker images
80 label: Gerrit code branch
81 description: Gerrit branch where to download the code from
85 description: DmaaP Topic name
89 description: Openstack tenant ID
93 description: Openstack username
97 description: Openstack API Key
101 description: URL of Openstack Horizon
105 description: URL of Openstack Keystone
109 type: comma_delimited_list
110 description: External DNS for OAM ONAP network
114 description: CIDR of the OAM ONAP network
118 description: A&AI IP Address
122 description: APP-C IP Address
126 description: DCAE IP Address
130 description: DNS IP Address
134 description: MSO IP Address
138 description: Message Router IP Address
142 description: Policy Engine IP Address
146 description: Portal IP Address
150 description: Robot Framework IP Address
154 description: SDC IP Address
158 description: SDN-C IP Address
162 description: VID IP Address
164 # Parameters for DCAE instantiation
167 description: DCAE Zone to use in VM names created by DCAE controller
171 description: DCAE State to use in VM names created by DCAE controller
175 description: Root URL of Nexus repository
179 description: Snapshot of Maven repository for DCAE deployment
183 description: Region where the DCAE controller will spin the VMs
187 description: Branch of the Gitlab repository
198 type: OS::Heat::RandomString
203 # Public key used to access ONAP components
205 type: OS::Nova::KeyPair
211 base: { get_param: key_name }
212 rand: { get_resource: random-str }
213 public_key: { get_param: pub_key }
214 save_private_key: false
217 # ONAP management private network
219 type: OS::Neutron::Net
223 template: oam_ecomp_rand
225 rand: { get_resource: random-str }
228 type: OS::Neutron::Subnet
232 template: oam_ecomp_rand
234 rand: { get_resource: random-str }
235 network_id: { get_resource: oam_ecomp }
236 cidr: { get_param: oam_network_cidr }
237 dns_nameservers: { get_param: external_dns }
240 type: OS::Neutron::Router
242 external_gateway_info:
243 network: { get_param: public_net_id }
246 type: OS::Neutron::RouterInterface
248 router_id: { get_resource: router }
249 subnet_id: { get_resource: oam_ecomp_subnet }
252 # DNS Server instantiation
254 type: OS::Neutron::Port
256 network: { get_resource: oam_ecomp }
257 fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: dns_ip_addr }}]
260 type: OS::Neutron::FloatingIP
262 floating_network_id: { get_param: public_net_id }
263 port_id: { get_resource: dns_private_port }
266 type: OS::Nova::Server
268 image: { get_param: ubuntu_1404_image }
269 flavor: { get_param: flavor_small }
272 template: base-dns-server
274 base: { get_param: vm_base_name }
275 key_name: { get_resource: vm_key }
277 - port: { get_resource: dns_private_port }
278 user_data_format: RAW
282 __nexus_repo__: { get_param: nexus_repo }
283 __artifacts_version__: { get_param: artifacts_version }
284 __oam_network_cidr__: { get_attr: [oam_ecomp_subnet, cidr] }
285 __dns_ip_addr__: { get_param: dns_ip_addr }
286 __aai_ip_addr__: { get_param: aai_ip_addr }
287 __appc_ip_addr__: { get_param: appc_ip_addr }
288 __dcae_ip_addr__: { get_param: dcae_ip_addr }
289 __mso_ip_addr__: { get_param: mso_ip_addr }
290 __mr_ip_addr__: { get_param: mr_ip_addr }
291 __policy_ip_addr__: { get_param: policy_ip_addr }
292 __portal_ip_addr__: { get_param: portal_ip_addr }
293 __robot_ip_addr__: { get_param: robot_ip_addr }
294 __sdc_ip_addr__: { get_param: sdc_ip_addr }
295 __sdnc_ip_addr__: { get_param: sdnc_ip_addr }
296 __vid_ip_addr__: { get_param: vid_ip_addr }
302 echo 127.0.0.1 $hn >> /etc/hosts
304 # Download dependencies
305 add-apt-repository -y ppa:openjdk-r/ppa
307 apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk bind9 bind9utils bind9-doc ntp ntpdate
310 mkdir /etc/bind/zones
311 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/bind_zones -o /etc/bind/zones/db.simpledemo.openecomp.org
312 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/bind_options -o /etc/bind/named.conf.options
313 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/named.conf.local -o /etc/bind/named.conf.local
316 #NETMASK=$(echo "__oam_network_cidr__" | cut -d"/" -f2)
317 #if [[ $NETMASK == "8" ]]
319 # ADDR=$(echo "__dns_ip_addr__" | cut -d"." -f1)
320 #elif [[ $NETMASK == "16" ]]
322 # ADDR=$(echo "__dns_ip_addr__" | cut -d"." -f1).$(echo "__dns_ip_addr__" | cut -d"." -f2)
323 #elif [[ $NETMASK == "24" ]]
325 # ADDR=$(echo "__dns_ip_addr__" | cut -d"." -f1).$(echo "__dns_ip_addr__" | cut -d"." -f2).$(echo "__dns_ip_addr__" | cut -d"." -f3)
328 #sed -i "s/netmask/$ADDR\/$NETMASK/g" /etc/bind/named.conf.options
329 sed -i "s/dns_ip_addr/"__dns_ip_addr__"/g" /etc/bind/named.conf.options
331 A=$(echo "__dcae_ip_addr__" | cut -d"." -f1)
332 B=$(echo "__dcae_ip_addr__" | cut -d"." -f2)
333 C=$(echo "__dcae_ip_addr__" | cut -d"." -f3)
334 sed -i "s/aai_ip_addr/"__aai_ip_addr__"/g" /etc/bind/zones/db.simpledemo.openecomp.org
335 sed -i "s/appc_ip_addr/"__appc_ip_addr__"/g" /etc/bind/zones/db.simpledemo.openecomp.org
336 sed -i "s/dcae_ip_addr/"__dcae_ip_addr__"/g" /etc/bind/zones/db.simpledemo.openecomp.org
337 sed -i "s/dns_ip_addr/"__dns_ip_addr__"/g" /etc/bind/zones/db.simpledemo.openecomp.org
338 sed -i "s/mso_ip_addr/"__mso_ip_addr__"/g" /etc/bind/zones/db.simpledemo.openecomp.org
339 sed -i "s/mr_ip_addr/"__mr_ip_addr__"/g" /etc/bind/zones/db.simpledemo.openecomp.org
340 sed -i "s/policy_ip_addr/"__policy_ip_addr__"/g" /etc/bind/zones/db.simpledemo.openecomp.org
341 sed -i "s/portal_ip_addr/"__portal_ip_addr__"/g" /etc/bind/zones/db.simpledemo.openecomp.org
342 sed -i "s/robot_ip_addr/"__robot_ip_addr__"/g" /etc/bind/zones/db.simpledemo.openecomp.org
343 sed -i "s/sdc_ip_addr/"__sdc_ip_addr__"/g" /etc/bind/zones/db.simpledemo.openecomp.org
344 sed -i "s/sdnc_ip_addr/"__sdnc_ip_addr__"/g" /etc/bind/zones/db.simpledemo.openecomp.org
345 sed -i "s/vid_ip_addr/"__vid_ip_addr__"/g" /etc/bind/zones/db.simpledemo.openecomp.org
346 sed -i "s/dcae_coll_ip_addr/"$A.$B.$C"/g" /etc/bind/zones/db.simpledemo.openecomp.org
349 sed -i "s/OPTIONS=.*/OPTIONS=\"-4 -u bind\"/g" /etc/default/bind9
351 # Restart bind to pick up configuration changes
352 service bind9 restart
357 type: OS::Neutron::Port
359 network: { get_resource: oam_ecomp }
360 fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: aai_ip_addr }}]
363 type: OS::Neutron::FloatingIP
365 floating_network_id: { get_param: public_net_id }
366 port_id: { get_resource: aai_private_port }
369 type: OS::Nova::Server
372 image: { get_param: ubuntu_1404_image }
373 flavor: { get_param: flavor_xlarge }
378 base: { get_param: vm_base_name }
379 key_name: { get_resource: vm_key }
381 - port: { get_resource: aai_private_port }
382 user_data_format: RAW
386 __nexus_repo__: { get_param: nexus_repo }
387 __nexus_docker_repo__: { get_param: nexus_docker_repo }
388 __nexus_username__: { get_param: nexus_username }
389 __nexus_password__: { get_param: nexus_password }
390 __dmaap_topic__: { get_param: dmaap_topic }
391 __artifacts_version__: { get_param: artifacts_version }
392 __dns_ip_addr__: { get_param: dns_ip_addr }
393 __docker_version__: { get_param: docker_version }
398 echo 127.0.0.1 $hn >> /etc/hosts
400 # Create configuration files
402 echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
403 echo "__nexus_username__" > /opt/config/nexus_username.txt
404 echo "__nexus_password__" > /opt/config/nexus_password.txt
405 echo "__dmaap_topic__" > /opt/config/dmaap_topic.txt
406 echo "__docker_version__" > /opt/config/docker_version.txt
408 # Download dependencies
409 add-apt-repository -y ppa:openjdk-r/ppa
411 apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk git ntp ntpdate
413 # Download scripts from Nexus
414 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/docker_key.txt -o /opt/config/docker_key.txt
415 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/aai_vm_init.sh -o /opt/aai_vm_init.sh
416 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/aai_serv.sh -o /opt/aai_serv.sh
417 chmod +x /opt/aai_vm_init.sh
418 chmod +x /opt/aai_serv.sh
419 mv /opt/aai_serv.sh /etc/init.d
420 update-rc.d aai_serv.sh defaults
422 # Download and install docker-engine and docker-compose
423 DOCKER_KEY=$(cat /opt/config/docker_key.txt)
424 apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys $DOCKER_KEY
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 --allow-unauthenticated 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 # DNS/GW IP address configuration
440 echo "nameserver __dns_ip_addr__" >> /etc/resolvconf/resolv.conf.d/head
443 # Reboot the VM to pick up configuration changes
449 type: OS::Neutron::Port
451 network: { get_resource: oam_ecomp }
452 fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: mso_ip_addr }}]
455 type: OS::Neutron::FloatingIP
457 floating_network_id: { get_param: public_net_id }
458 port_id: { get_resource: mso_private_port }
461 type: OS::Nova::Server
463 image: { get_param: ubuntu_1604_image }
464 flavor: { get_param: flavor_large }
469 base: { get_param: vm_base_name }
470 key_name: { get_resource: vm_key }
472 - port: { get_resource: mso_private_port }
473 user_data_format: RAW
477 __nexus_repo__: { get_param: nexus_repo }
478 __nexus_docker_repo__: { get_param: nexus_docker_repo }
479 __nexus_username__: { get_param: nexus_username }
480 __nexus_password__: { get_param: nexus_password }
481 __openstack_username__: { get_param: openstack_username }
482 __openstack_tenant_id__: { get_param: openstack_tenant_id }
483 __openstack_api_key__: { get_param: openstack_api_key }
484 __keystone_url__: { get_param: keystone_url }
485 __dmaap_topic__: { get_param: dmaap_topic }
486 __artifacts_version__: { get_param: artifacts_version }
487 __dns_ip_addr__: { get_param: dns_ip_addr }
488 __docker_version__: { get_param: docker_version }
489 __gerrit_branch__: { get_param: gerrit_branch }
494 echo 127.0.0.1 $hn >> /etc/hosts
496 # Create configuration files
498 echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
499 echo "__nexus_username__" > /opt/config/nexus_username.txt
500 echo "__nexus_password__" > /opt/config/nexus_password.txt
501 echo "__openstack_username__" > /opt/config/openstack_username.txt
502 echo "__openstack_tenant_id__" > /opt/config/tenant_id.txt
503 echo "__keystone_url__" > /opt/config/keystone.txt
504 echo "__dmaap_topic__" > /opt/config/dmaap_topic.txt
505 echo "__docker_version__" > /opt/config/docker_version.txt
507 # Download dependencies
508 add-apt-repository -y ppa:openjdk-r/ppa
510 apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk git ntp ntpdate
512 # Download scripts from Nexus
513 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/docker_key.txt -o /opt/config/docker_key.txt
514 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/mso_vm_init.sh -o /opt/mso_vm_init.sh
515 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/mso_serv.sh -o /opt/mso_serv.sh
516 chmod +x /opt/mso_vm_init.sh
517 chmod +x /opt/mso_serv.sh
518 mv /opt/mso_serv.sh /etc/init.d
519 update-rc.d mso_serv.sh defaults
521 # Download and install docker-engine and docker-compose
522 DOCKER_KEY=$(cat /opt/config/docker_key.txt)
523 apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys $DOCKER_KEY
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 --allow-unauthenticated 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 # Clone Gerrit repository
536 git clone -b __gerrit_branch__ --single-branch http://gerrit.onap.org/r/mso/docker-config.git test_lab
537 MSO_ENCRYPTION_KEY=$(cat /opt/test_lab/encryption.key)
538 echo -n "__openstack_api_key__" | openssl aes-128-ecb -e -K $MSO_ENCRYPTION_KEY -nosalt | xxd -c 256 -p > /opt/config/api_key.txt
540 # Rename network interface
541 sed -i 's/GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX=\"net.ifnames=0 biosdevname=0\"/g' /etc/default/grub
542 grub-mkconfig -o /boot/grub/grub.cfg
543 sed -i 's/ens3/eth0/g' /etc/network/interfaces.d/*.cfg
545 # DNS/GW IP address configuration
546 echo "nameserver __dns_ip_addr__" >> /etc/resolvconf/resolv.conf.d/head
549 # Disable cloud-init for networking on reboot
550 echo 'network: {config: disabled}' >> /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
552 # Reboot the VM to pick up configuration changes
556 # Message Router instantiation
557 mrouter_private_port:
558 type: OS::Neutron::Port
560 network: { get_resource: oam_ecomp }
561 fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: mr_ip_addr }}]
564 type: OS::Neutron::FloatingIP
566 floating_network_id: { get_param: public_net_id }
567 port_id: { get_resource: mrouter_private_port }
570 type: OS::Nova::Server
572 image: { get_param: ubuntu_1404_image }
573 flavor: { get_param: flavor_large }
576 template: base-message-router
578 base: { get_param: vm_base_name }
579 key_name: { get_resource: vm_key }
581 - port: { get_resource: mrouter_private_port }
582 user_data_format: RAW
586 __nexus_repo__: { get_param: nexus_repo }
587 __nexus_docker_repo__: { get_param: nexus_docker_repo }
588 __nexus_username__: { get_param: nexus_username }
589 __nexus_password__: { get_param: nexus_password }
590 __artifacts_version__: { get_param: artifacts_version }
591 __dns_ip_addr__: { get_param: dns_ip_addr }
592 __gerrit_branch__: { get_param: gerrit_branch }
597 echo 127.0.0.1 $hn >> /etc/hosts
599 # Create configuration files
601 echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
602 echo "__nexus_username__" > /opt/config/nexus_username.txt
603 echo "__nexus_password__" > /opt/config/nexus_password.txt
605 # Download dependencies
606 add-apt-repository -y ppa:openjdk-r/ppa
608 apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk git ntp ntpdate
610 # Download scripts from Nexus
611 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/docker_key.txt -o /opt/config/docker_key.txt
612 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/mr_vm_init.sh -o /opt/mr_vm_init.sh
613 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/mr_serv.sh -o /opt/mr_serv.sh
614 chmod +x /opt/mr_vm_init.sh
615 chmod +x /opt/mr_serv.sh
616 mv /opt/mr_serv.sh /etc/init.d
617 update-rc.d mr_serv.sh defaults
619 # Download and install docker-engine and docker-compose
620 DOCKER_KEY=$(cat /opt/config/docker_key.txt)
621 apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys $DOCKER_KEY
622 echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list
624 apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual
625 apt-get install -y --allow-unauthenticated docker-engine
629 curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /opt/docker/docker-compose
630 chmod +x /opt/docker/docker-compose
632 # Clone Gerrit repository
634 git clone -b __gerrit_branch__ --single-branch http://gerrit.onap.org/r/dcae/demo/startup/message-router.git dcae-startup-vm-message-router
636 # DNS/GW IP address configuration
637 echo "nameserver __dns_ip_addr__" >> /etc/resolvconf/resolv.conf.d/head
640 # Reboot the VM to pick up configuration changes
644 # Robot Framework instantiation
646 type: OS::Neutron::Port
648 network: { get_resource: oam_ecomp }
649 fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: robot_ip_addr }}]
652 type: OS::Neutron::FloatingIP
654 floating_network_id: { get_param: public_net_id }
655 port_id: { get_resource: robot_private_port }
658 type: OS::Nova::Server
660 image: { get_param: ubuntu_1604_image }
661 flavor: { get_param: flavor_small }
666 base: { get_param: vm_base_name }
667 key_name: { get_resource: vm_key }
669 - port: { get_resource: robot_private_port }
670 user_data_format: RAW
674 __nexus_repo__: { get_param: nexus_repo }
675 __nexus_docker_repo__: { get_param: nexus_docker_repo }
676 __nexus_username__: { get_param: nexus_username }
677 __nexus_password__: { get_param: nexus_password }
678 __network_name__: { get_attr: [oam_ecomp, name] }
679 __openstack_username__: { get_param: openstack_username }
680 __openstack_api_key__: { get_param : openstack_api_key }
681 __artifacts_version__: { get_param: artifacts_version }
682 __openstack_region__: { get_param: openstack_region }
683 __dns_ip_addr__: { get_param: dns_ip_addr }
684 __docker_version__: { get_param: docker_version }
685 __gerrit_branch__: { get_param: gerrit_branch }
690 echo 127.0.0.1 $hn >> /etc/hosts
692 # Create configuration files
694 echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
695 echo "__nexus_repo__" > /opt/config/nexus_repo.txt
696 echo "__nexus_username__" > /opt/config/nexus_username.txt
697 echo "__nexus_password__" > /opt/config/nexus_password.txt
698 echo "__network_name__" > /opt/config/network.txt
699 echo "__openstack_username__" > /opt/config/openstack_username.txt
700 echo "__openstack_api_key__" > /opt/config/openstack_password.txt
701 echo "__openstack_region__" > /opt/config/region.txt
702 echo "__artifacts_version__" > /opt/config/artifacts_version.txt
703 echo "__docker_version__" > /opt/config/docker_version.txt
705 # Download dependencies
706 add-apt-repository -y ppa:openjdk-r/ppa
708 apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk git ntp ntpdate
709 echo "APT::Periodic::Unattended-Upgrade \"0\";" >> /etc/apt/apt.conf.d/10periodic
711 # Download scripts from Nexus
712 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/docker_key.txt -o /opt/config/docker_key.txt
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 DOCKER_KEY=$(cat /opt/config/docker_key.txt)
722 apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys $DOCKER_KEY
723 echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" | sudo tee /etc/apt/sources.list.d/docker.list
725 apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual
726 apt-get install -y --allow-unauthenticated docker-engine
730 curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /opt/docker/docker-compose
731 chmod +x /opt/docker/docker-compose
733 # Execute RobotETE-specific instructions: create share folder to run as a docker volume
734 mkdir -p /opt/eteshare/logs
735 mkdir -p /opt/eteshare/config
737 # Clone Gerrit repository
739 git clone -b __gerrit_branch__ --single-branch http://gerrit.onap.org/r/testsuite/properties.git testsuite/properties
741 # Rename network interface
742 sed -i 's/GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX=\"net.ifnames=0 biosdevname=0\"/g' /etc/default/grub
743 grub-mkconfig -o /boot/grub/grub.cfg
744 sed -i 's/ens3/eth0/g' /etc/network/interfaces.d/*.cfg
746 # DNS/GW IP address configuration
747 echo "nameserver __dns_ip_addr__" >> /etc/resolvconf/resolv.conf.d/head
750 # Disable cloud-init for networking on reboot
751 echo 'network: {config: disabled}' >> /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
753 # Reboot the VM to pick up configuration changes
759 type: OS::Neutron::Port
761 network: { get_resource: oam_ecomp }
762 fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: vid_ip_addr }}]
765 type: OS::Neutron::FloatingIP
767 floating_network_id: { get_param: public_net_id }
768 port_id: { get_resource: vid_private_port }
771 type: OS::Nova::Server
773 image: { get_param: ubuntu_1404_image }
774 flavor: { get_param: flavor_medium }
779 base: { get_param: vm_base_name }
780 key_name: { get_resource: vm_key }
782 - port: { get_resource: vid_private_port }
783 user_data_format: RAW
787 __nexus_repo__: { get_param: nexus_repo }
788 __nexus_docker_repo__: { get_param: nexus_docker_repo }
789 __nexus_username__: { get_param: nexus_username }
790 __nexus_password__: { get_param: nexus_password }
791 __artifacts_version__: { get_param: artifacts_version }
792 __dns_ip_addr__: { get_param: dns_ip_addr }
793 __docker_version__: { get_param: docker_version }
794 __gerrit_branch__: { get_param: gerrit_branch }
799 echo 127.0.0.1 $hn >> /etc/hosts
801 # Create configuration files
803 echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
804 echo "__nexus_username__" > /opt/config/nexus_username.txt
805 echo "__nexus_password__" > /opt/config/nexus_password.txt
806 echo "__docker_version__" > /opt/config/docker_version.txt
808 # Download dependencies
809 add-apt-repository -y ppa:openjdk-r/ppa
811 apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk make git ntp ntpdate
813 # Download scripts from Nexus
814 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/docker_key.txt -o /opt/config/docker_key.txt
815 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/vid_vm_init.sh -o /opt/vid_vm_init.sh
816 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/vid_serv.sh -o /opt/vid_serv.sh
817 chmod +x /opt/vid_vm_init.sh
818 chmod +x /opt/vid_serv.sh
819 mv /opt/vid_serv.sh /etc/init.d
820 update-rc.d vid_serv.sh defaults
822 # Download and install docker-engine and docker-compose
823 DOCKER_KEY=$(cat /opt/config/docker_key.txt)
824 apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys $DOCKER_KEY
825 echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list
827 apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual
828 apt-get install -y --allow-unauthenticated docker-engine
832 curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /opt/docker/docker-compose
833 chmod +x /opt/docker/docker-compose
835 # Clone Gerrit repository
837 git clone -b __gerrit_branch__ --single-branch http://gerrit.onap.org/r/vid.git
839 # DNS/GW IP address configuration
840 echo "nameserver __dns_ip_addr__" >> /etc/resolvconf/resolv.conf.d/head
843 # Reboot the VM to pick up configuration changes
847 # SDN-C instantiation
849 type: OS::Neutron::Port
851 network: { get_resource: oam_ecomp }
852 fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: sdnc_ip_addr }}]
855 type: OS::Neutron::FloatingIP
857 floating_network_id: { get_param: public_net_id }
858 port_id: { get_resource: sdnc_private_port }
861 type: OS::Nova::Server
863 image: { get_param: ubuntu_1404_image }
864 flavor: { get_param: flavor_large }
869 base: { get_param: vm_base_name }
870 key_name: { get_resource: vm_key }
872 - port: { get_resource: sdnc_private_port }
873 user_data_format: RAW
877 __nexus_repo__: { get_param: nexus_repo }
878 __nexus_docker_repo__: { get_param: nexus_docker_repo }
879 __nexus_username__: { get_param: nexus_username }
880 __nexus_password__: { get_param: nexus_password }
881 __artifacts_version__: { get_param: artifacts_version }
882 __dns_ip_addr__: { get_param: dns_ip_addr }
883 __docker_version__: { get_param: docker_version }
884 __gerrit_branch__: { get_param: gerrit_branch }
889 echo 127.0.0.1 $hn >> /etc/hosts
891 # Create configuration files
893 echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
894 echo "__nexus_username__" > /opt/config/nexus_username.txt
895 echo "__nexus_password__" > /opt/config/nexus_password.txt
896 echo "__docker_version__" > /opt/config/docker_version.txt
898 # Download dependencies
899 add-apt-repository -y ppa:openjdk-r/ppa
901 apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk git ntp ntpdate
903 # Download scripts from Nexus
904 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/docker_key.txt -o /opt/config/docker_key.txt
905 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/sdnc_vm_init.sh -o /opt/sdnc_vm_init.sh
906 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/sdnc_serv.sh -o /opt/sdnc_serv.sh
907 chmod +x /opt/sdnc_vm_init.sh
908 chmod +x /opt/sdnc_serv.sh
909 mv /opt/sdnc_serv.sh /etc/init.d
910 update-rc.d sdnc_serv.sh defaults
912 # Download and install docker-engine and docker-compose
913 DOCKER_KEY=$(cat /opt/config/docker_key.txt)
914 apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys $DOCKER_KEY
915 echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list
917 apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual
918 apt-get install -y --allow-unauthenticated docker-engine
922 curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /opt/docker/docker-compose
923 chmod +x /opt/docker/docker-compose
925 # Clone Gerrit repository
927 git clone -b __gerrit_branch__ --single-branch http://gerrit.onap.org/r/sdnc/oam.git sdnc
929 # DNS/GW IP address configuration
930 echo "nameserver __dns_ip_addr__" >> /etc/resolvconf/resolv.conf.d/head
933 # Reboot the VM to pick up configuration changes
939 type: OS::Neutron::Port
941 network: { get_resource: oam_ecomp }
942 fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: sdc_ip_addr }}]
945 type: OS::Neutron::FloatingIP
947 floating_network_id: { get_param: public_net_id }
948 port_id: { get_resource: sdc_private_port }
951 type: OS::Cinder::Volume
956 sdc_volume_attachment:
957 type: OS::Cinder::VolumeAttachment
959 volume_id: { get_resource: sdc_volume_data }
960 instance_uuid: { get_resource: sdc_vm }
964 type: OS::Nova::Server
966 image: { get_param: ubuntu_1604_image }
967 flavor: { get_param: flavor_xlarge }
972 base: { get_param: vm_base_name }
973 key_name: { get_resource: vm_key }
975 - port: { get_resource: sdc_private_port }
976 user_data_format: RAW
980 __nexus_repo__: { get_param: nexus_repo }
981 __nexus_docker_repo__: { get_param: nexus_docker_repo }
982 __nexus_username__: { get_param: nexus_username }
983 __nexus_password__: { get_param: nexus_password }
984 __env_name__: { get_param: dmaap_topic }
985 __artifacts_version__: { get_param: artifacts_version }
986 __dns_ip_addr__: { get_param: dns_ip_addr }
987 __mr_ip_addr__: { get_param: mr_ip_addr }
988 __public_ip__: { get_attr: [sdc_floating_ip, floating_ip_address] }
989 __docker_version__: { get_param: docker_version }
990 __gerrit_branch__: { get_param: gerrit_branch }
995 echo 127.0.0.1 $hn >> /etc/hosts
997 # Create configuration files
999 echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
1000 echo "__nexus_username__" > /opt/config/nexus_username.txt
1001 echo "__nexus_password__" > /opt/config/nexus_password.txt
1002 echo "__env_name__" > /opt/config/env_name.txt
1003 echo "__mr_ip_addr__" > /opt/config/mr_ip_addr.txt
1004 echo "__public_ip__" > /opt/config/public_ip.txt
1005 echo "__docker_version__" > /opt/config/docker_version.txt
1007 # Download dependencies
1008 add-apt-repository -y ppa:openjdk-r/ppa
1010 apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk git ntp ntpdate
1012 # Download scripts from Nexus
1013 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/docker_key.txt -o /opt/config/docker_key.txt
1014 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/asdc_vm_init.sh -o /opt/asdc_vm_init.sh
1015 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/asdc_serv.sh -o /opt/asdc_serv.sh
1016 chmod +x /opt/asdc_vm_init.sh
1017 chmod +x /opt/asdc_serv.sh
1018 mv /opt/asdc_serv.sh /etc/init.d
1019 update-rc.d asdc_serv.sh defaults
1021 # Download and install docker-engine and docker-compose
1022 DOCKER_KEY=$(cat /opt/config/docker_key.txt)
1023 apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys $DOCKER_KEY
1024 echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" | sudo tee /etc/apt/sources.list.d/docker.list
1026 apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual
1028 apt-get install -y --allow-unauthenticated docker-engine
1029 service docker start
1031 curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /opt/docker/docker-compose
1032 chmod +x /opt/docker/docker-compose
1034 # Create partition and mount the external volume
1035 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/asdc_ext_volume_partitions.txt -o /opt/asdc_ext_volume_partitions.txt
1036 sfdisk /dev/vdb < /opt/asdc_ext_volume_partitions.txt
1037 mkfs -t ext4 /dev/vdb1
1039 mount /dev/vdb1 /data
1040 echo "/dev/vdb1 /data ext4 errors=remount-ro,noatime,barrier=0 0 1" >> /etc/fstab
1042 # Run SDC-specific instructions
1044 mkdir -p /data/environments
1045 mkdir -p /data/scripts
1046 mkdir -p /data/logs/BE
1047 mkdir -p /data/logs/FE
1049 chmod 777 /data/logs/BE
1050 chmod 777 /data/logs/FE
1052 # Clone Gerrit repository
1053 git clone -b __gerrit_branch__ --single-branch http://gerrit.onap.org/r/sdc.git
1055 cat > /root/.bash_aliases << EOF
1056 alias dcls='/data/scripts/docker_clean.sh \$1'
1057 alias dlog='/data/scripts/docker_login.sh \$1'
1058 alias rund='/data/scripts/docker_run.sh'
1059 alias health='/data/scripts/docker_health.sh'
1062 # Rename network interface
1063 sed -i 's/GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX=\"net.ifnames=0 biosdevname=0\"/g' /etc/default/grub
1064 grub-mkconfig -o /boot/grub/grub.cfg
1065 sed -i 's/ens3/eth0/g' /etc/network/interfaces.d/*.cfg
1067 # DNS/GW IP address configuration
1068 echo "nameserver __dns_ip_addr__" >> /etc/resolvconf/resolv.conf.d/head
1071 # Disable cloud-init for networking on reboot
1072 echo 'network: {config: disabled}' >> /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
1074 # Reboot the VM to pick up configuration changes
1078 # PORTAL instantiation
1079 portal_private_port:
1080 type: OS::Neutron::Port
1082 network: { get_resource: oam_ecomp }
1083 fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: portal_ip_addr }}]
1086 type: OS::Neutron::FloatingIP
1088 floating_network_id: { get_param: public_net_id }
1089 port_id: { get_resource: portal_private_port }
1092 type: OS::Nova::Server
1094 image: { get_param: ubuntu_1404_image }
1095 flavor: { get_param: flavor_large }
1098 template: base-portal
1100 base: { get_param: vm_base_name }
1101 key_name: { get_resource: vm_key }
1103 - port: { get_resource: portal_private_port }
1104 user_data_format: RAW
1108 __nexus_repo__: { get_param: nexus_repo }
1109 __nexus_docker_repo__: { get_param: nexus_docker_repo }
1110 __nexus_username__: { get_param: nexus_username }
1111 __nexus_password__: { get_param: nexus_password }
1112 __artifacts_version__: { get_param: artifacts_version }
1113 __dns_ip_addr__: { get_param: dns_ip_addr }
1114 __public_ip__: { get_attr: [portal_floating_ip, floating_ip_address] }
1115 __docker_version__: { get_param: docker_version }
1116 __gerrit_branch__: { get_param: gerrit_branch }
1121 echo 127.0.0.1 $hn >> /etc/hosts
1123 # Create configuration files
1124 mkdir -p /opt/config
1125 echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
1126 echo "__nexus_username__" > /opt/config/nexus_username.txt
1127 echo "__nexus_password__" > /opt/config/nexus_password.txt
1128 echo "__public_ip__" > /opt/config/public_ip.txt
1129 echo "__docker_version__" > /opt/config/docker_version.txt
1131 # Download dependencies
1132 add-apt-repository -y ppa:openjdk-r/ppa
1134 apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk git unzip mysql-client-core-5.6 ntp ntpdate
1136 # Download scripts from Nexus
1137 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/docker_key.txt -o /opt/config/docker_key.txt
1138 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/portal_vm_init.sh -o /opt/portal_vm_init.sh
1139 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/portal_serv.sh -o /opt/portal_serv.sh
1140 chmod +x /opt/portal_vm_init.sh
1141 chmod +x /opt/portal_serv.sh
1142 mv /opt/portal_serv.sh /etc/init.d
1143 update-rc.d portal_serv.sh defaults
1145 # Download and install docker-engine and docker-compose
1146 DOCKER_KEY=$(cat /opt/config/docker_key.txt)
1147 apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys $DOCKER_KEY
1148 echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list
1150 apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual
1151 apt-get install -y --allow-unauthenticated docker-engine
1152 service docker start
1154 curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /opt/docker/docker-compose
1155 chmod +x /opt/docker/docker-compose
1157 # Clone Gerrit repository
1158 mkdir -p /PROJECT/OpenSource/UbuntuEP/logs
1160 git clone -b __gerrit_branch__ --single-branch http://gerrit.onap.org/r/portal.git
1162 # DNS/GW IP address configuration
1163 echo "nameserver __dns_ip_addr__" >> /etc/resolvconf/resolv.conf.d/head
1166 # Reboot the VM to pick up configuration changes
1170 # DCAE Controller instantiation
1171 dcae_c_private_port:
1172 type: OS::Neutron::Port
1174 network: { get_resource: oam_ecomp }
1175 fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: dcae_ip_addr }}]
1178 type: OS::Neutron::FloatingIP
1180 floating_network_id: { get_param: public_net_id }
1181 port_id: { get_resource: dcae_c_private_port }
1184 type: OS::Nova::Server
1186 image: { get_param: ubuntu_1404_image }
1187 flavor: { get_param: flavor_medium }
1190 template: base-dcae-controller
1192 base: { get_param: vm_base_name }
1193 key_name: { get_resource: vm_key }
1195 - port: { get_resource: dcae_c_private_port }
1196 user_data_format: RAW
1200 __nexus_repo__: { get_param: nexus_repo }
1201 __nexus_docker_repo__: { get_param: nexus_docker_repo }
1202 __nexus_username__: { get_param: nexus_username }
1203 __nexus_password__: { get_param: nexus_password }
1204 __nexus_url_snapshots__: { get_param: nexus_url_snapshot }
1205 __gitlab_branch__: { get_param: gitlab_branch }
1206 __dns_ip_addr__: { get_param: dns_ip_addr }
1207 __dcae_zone__: { get_param: dcae_zone }
1208 __dcae_state__: { get_param: dcae_state }
1209 __artifacts_version__: { get_param: artifacts_version }
1210 __tenant_id__: { get_param: openstack_tenant_id }
1211 __openstack_private_network_name__: { get_attr: [oam_ecomp, name] }
1212 __openstack_user__: { get_param: openstack_username }
1213 __openstack_password__: { get_param: openstack_api_key }
1214 __key_name__: { get_param: key_name }
1215 __rand_str__: { get_resource: random-str }
1216 __pub_key__: { get_param: pub_key }
1217 __nexus_repo_root__: { get_param: nexus_repo_root }
1218 __openstack_region__: { get_param: openstack_region }
1219 __horizon_url__ : { get_param: horizon_url }
1220 __keystone_url__ : { get_param: keystone_url }
1221 __docker_version__: { get_param: docker_version }
1222 __gerrit_branch__: { get_param: gerrit_branch }
1227 echo 127.0.0.1 $hn >> /etc/hosts
1229 # Create configuration files
1230 mkdir -p /opt/config
1231 echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
1232 echo "__nexus_username__" > /opt/config/nexus_username.txt
1233 echo "__nexus_password__" > /opt/config/nexus_password.txt
1234 echo "__gitlab_branch__" > /opt/config/gitlab_branch.txt
1235 echo "__docker_version__" > /opt/config/docker_version.txt
1237 # Download dependencies
1238 add-apt-repository -y ppa:openjdk-r/ppa
1240 apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk make git ntp ntpdate
1242 # Download scripts from Nexus
1243 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/docker_key.txt -o /opt/config/docker_key.txt
1244 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/dcae_vm_init.sh -o /opt/dcae_vm_init.sh
1245 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/dcae_serv.sh -o /opt/dcae_serv.sh
1246 chmod +x /opt/dcae_vm_init.sh
1247 chmod +x /opt/dcae_serv.sh
1248 mv /opt/dcae_serv.sh /etc/init.d
1249 update-rc.d dcae_serv.sh defaults
1251 # Download and install docker-engine and docker-compose
1252 DOCKER_KEY=$(cat /opt/config/docker_key.txt)
1253 apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys $DOCKER_KEY
1254 echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list
1256 apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual
1257 apt-get install -y --allow-unauthenticated docker-engine
1258 service docker start
1260 curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /opt/docker/docker-compose
1261 chmod +x /opt/docker/docker-compose
1263 # Clone Gerrit repository
1265 git clone -b __gerrit_branch__ --single-branch http://gerrit.onap.org/r/dcae/demo/startup/controller.git dcae-startup-vm-controller
1267 # DCAE Controller specific deployment
1268 cd /opt/dcae-startup-vm-controller
1269 mkdir -p /opt/app/dcae-controller
1270 cat > /opt/app/dcae-controller/config.yaml << EOF_CONFIG
1272 STATE: __dcae_state__
1273 DCAE-VERSION: __artifacts_version__
1274 HORIZON-URL: __horizon_url__/__openstack_user__
1275 KEYSTONE-URL: __keystone_url__
1276 OPENSTACK-TENANT-ID: __tenant_id__
1277 OPENSTACK-TENANT-NAME: OPEN-ECOMP
1278 OPENSTACK-REGION: __openstack_region__
1279 OPENSTACK-PRIVATE-NETWORK: __openstack_private_network_name__
1280 OPENSTACK-USER: __openstack_user__
1281 OPENSTACK-PASSWORD: __openstack_password__
1282 OPENSTACK-KEYNAME: __key_name_____rand_str___dcae
1283 OPENSTACK-PUBKEY: __pub_key__
1285 NEXUS-URL-ROOT: __nexus_repo_root__
1286 NEXUS-USER: __nexus_username__
1287 NEXUS-PASSWORD: __nexus_password__
1288 NEXUS-URL-SNAPSHOTS: __nexus_url_snapshots__
1289 NEXUS-RAWURL: __nexus_repo__
1291 DOCKER-REGISTRY: __nexus_docker_repo__
1293 GIT-MR-REPO: http://gerrit.onap.org/r/dcae/demo/startup/message-router.git
1296 # DNS/GW IP address configuration
1297 echo "nameserver __dns_ip_addr__" >> /etc/resolvconf/resolv.conf.d/head
1300 # Reboot the VM to pick up configuration changes
1304 # Policy Engine instantiation
1305 policy_private_port:
1306 type: OS::Neutron::Port
1308 network: { get_resource: oam_ecomp }
1309 fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: policy_ip_addr }}]
1312 type: OS::Neutron::FloatingIP
1314 floating_network_id: { get_param: public_net_id }
1315 port_id: { get_resource: policy_private_port }
1318 type: OS::Nova::Server
1320 image: { get_param: ubuntu_1404_image }
1321 flavor: { get_param: flavor_xlarge }
1324 template: base-policy
1326 base: { get_param: vm_base_name }
1327 key_name: { get_resource: vm_key }
1329 - port: { get_resource: policy_private_port }
1330 user_data_format: RAW
1334 __nexus_repo__: { get_param: nexus_repo }
1335 __nexus_docker_repo__: { get_param: nexus_docker_repo }
1336 __nexus_username__: { get_param: nexus_username }
1337 __nexus_password__: { get_param: nexus_password }
1338 __artifacts_version__: { get_param: artifacts_version }
1339 __dns_ip_addr__: { get_param: dns_ip_addr }
1340 __public_ip__: { get_attr: [policy_floating_ip, floating_ip_address] }
1341 __docker_version__: { get_param: docker_version }
1342 __gerrit_branch__: { get_param: gerrit_branch }
1347 echo 127.0.0.1 $hn >> /etc/hosts
1349 # Create configuration files
1350 mkdir -p /opt/config
1351 echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
1352 echo "__nexus_username__" > /opt/config/nexus_username.txt
1353 echo "__nexus_password__" > /opt/config/nexus_password.txt
1354 echo "__public_ip__" > /opt/config/public_ip.txt
1355 echo "__docker_version__" > /opt/config/docker_version.txt
1357 # Download dependencies
1358 add-apt-repository -y ppa:openjdk-r/ppa
1360 apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk git ntp ntpdate
1362 # Download scripts from Nexus
1363 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/docker_key.txt -o /opt/config/docker_key.txt
1364 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/policy_vm_init.sh -o /opt/policy_vm_init.sh
1365 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/policy_serv.sh -o /opt/policy_serv.sh
1366 chmod +x /opt/policy_vm_init.sh
1367 chmod +x /opt/policy_serv.sh
1368 mv /opt/policy_serv.sh /etc/init.d
1369 update-rc.d policy_serv.sh defaults
1371 # Download and install docker-engine and docker-compose
1372 DOCKER_KEY=$(cat /opt/config/docker_key.txt)
1373 apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys $DOCKER_KEY
1374 echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list
1376 apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual
1377 apt-get install -y --allow-unauthenticated docker-engine
1378 service docker start
1380 curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /opt/docker/docker-compose
1381 chmod +x /opt/docker/docker-compose
1383 # Clone Gerrit repository
1385 git clone -b __gerrit_branch__ --single-branch http://gerrit.onap.org/r/policy/docker.git policy
1387 # DNS/GW IP address configuration
1388 echo "nameserver __dns_ip_addr__" >> /etc/resolvconf/resolv.conf.d/head
1391 # Reboot the VM to pick up configuration changes
1395 # APP-C instantiation
1397 type: OS::Neutron::Port
1399 network: { get_resource: oam_ecomp }
1400 fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: appc_ip_addr }}]
1403 type: OS::Neutron::FloatingIP
1405 floating_network_id: { get_param: public_net_id }
1406 port_id: { get_resource: appc_private_port }
1409 type: OS::Nova::Server
1411 image: { get_param: ubuntu_1404_image }
1412 flavor: { get_param: flavor_large }
1417 base: { get_param: vm_base_name }
1418 key_name: { get_resource: vm_key }
1420 - port: { get_resource: appc_private_port }
1421 user_data_format: RAW
1425 __nexus_repo__: { get_param: nexus_repo }
1426 __nexus_docker_repo__: { get_param: nexus_docker_repo }
1427 __nexus_username__: { get_param: nexus_username }
1428 __nexus_password__: { get_param: nexus_password }
1429 __dmaap_topic__: { get_param: dmaap_topic }
1430 __artifacts_version__: { get_param: artifacts_version }
1431 __dns_ip_addr__: { get_param: dns_ip_addr }
1432 __docker_version__: { get_param: docker_version }
1433 __gerrit_branch__: { get_param: gerrit_branch }
1438 echo 127.0.0.1 $hn >> /etc/hosts
1440 # Create configuration files
1441 mkdir -p /opt/config
1442 echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
1443 echo "__nexus_username__" > /opt/config/nexus_username.txt
1444 echo "__nexus_password__" > /opt/config/nexus_password.txt
1445 echo "__dmaap_topic__" > /opt/config/dmaap_topic.txt
1446 echo "__docker_version__" > /opt/config/docker_version.txt
1448 # Download dependencies
1449 add-apt-repository -y ppa:openjdk-r/ppa
1451 apt-get install -y apt-transport-https ca-certificates wget openjdk-7-jdk git ntp ntpdate
1453 # Download scripts from Nexus
1454 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/docker_key.txt -o /opt/config/docker_key.txt
1455 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/appc_vm_init.sh -o /opt/appc_vm_init.sh
1456 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/appc_serv.sh -o /opt/appc_serv.sh
1457 chmod +x /opt/appc_vm_init.sh
1458 chmod +x /opt/appc_serv.sh
1459 mv /opt/appc_serv.sh /etc/init.d
1460 update-rc.d appc_serv.sh defaults
1462 # Download and install docker-engine and docker-compose
1463 DOCKER_KEY=$(cat /opt/config/docker_key.txt)
1464 apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys $DOCKER_KEY
1465 echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list
1467 apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual
1468 apt-get install -y --allow-unauthenticated docker-engine
1469 service docker start
1472 curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /opt/docker/docker-compose
1473 chmod +x /opt/docker/docker-compose
1475 # Clone Gerrit repository
1477 git clone -b __gerrit_branch__ --single-branch http://gerrit.onap.org/r/appc/deployment.git appc
1479 # DNS/GW IP address configuration
1480 echo "nameserver __dns_ip_addr__" >> /etc/resolvconf/resolv.conf.d/head
1483 # Reboot the VM to pick up configuration changes