remove gerrit credentials from heat
[demo.git] / heat / OpenECOMP / openecomp_rackspace.yaml
1 heat_template_version: 2013-05-23
2
3 description: Heat template to deploy ONAP components
4
5 parameters:
6
7   # Generic parameters used across all ONAP components
8   public_net_id:
9     type: string
10     label: Public network name or ID
11     description: Public network that enables remote connection to the compute instance
12
13   key_name:
14     type: string
15     label: Key pair name
16     description: Public/Private key pair name
17
18   pub_key:
19     type: string
20     label: Public key
21     description: Public key or SSL certificate to be installed on the compute instance
22
23   nexus_repo:
24     type: string
25     label: Nexus Repository
26     description: Complete URL for the Nexus repository.
27
28   nexus_docker_repo:
29     type: string
30     label: Nexus Docker Images Repository
31     description: Complete URL for the Nexus repository for docker images.
32
33   nexus_username:
34     type: string
35     label: Nexus Repository Username
36     description: Nexus Repository username
37
38   nexus_password:
39     type: string
40     label: Nexus Repository Password
41     description: Nexus Repository Password
42
43   dmaap_topic:
44     type: string
45     label: DmaaP Topic
46     description: DmaaP Topic that MSO and A&AI listen to
47
48   artifacts_version:
49     type: string
50     label: Artifacts Version
51     description: Artifacts version of ONAP components
52     
53   docker_version:
54     type: string
55     label: Docker Version
56     description: Docker version of ONAP docker images
57
58   gerrit_branch:
59     type: string
60     label: Gerrit code branch
61     description: Gerrit branch where to download the code from
62
63   # Parameters for DCAE instantiation
64   dcae_zone:
65     type: string
66     label: DCAE Zone
67     description: DCAE Zone to use in VM names created by DCAE controller
68
69   dcae_state:
70     type: string
71     label: DCAE State
72     description: DCAE State to use in VM names created by DCAE controller
73
74   openstack_tenant_id:
75     type: string
76     label: Rackspace tenant ID
77     description: Rackspace tenant ID
78
79   openstack_username:
80     type: string
81     label: Rackspace username
82     description: Rackspace username
83
84   openstack_api_key:
85     type: string
86     label: Rackspace API Key
87     description: Rackspace API Key
88
89   openstack_password:
90     type: string
91     label: Rackspace Password
92     description: Rackspace Password
93
94   nexus_repo_root:
95     type: string
96     label: Root URL of nexus repository
97     description: Root URL of nexus repository
98     
99   nexus_url_snapshot:
100     type: string
101     label: Snapshot of Maven repository for DCAE deployment
102     description: Snapshot of Maven repository
103
104   openstack_region:
105     type: string
106     label: Rackspace Region
107     description: Rackspace region where the DCAE controller will spin the VMs
108
109   gitlab_branch:
110     type: string
111     label: Branch of the Gitlab repository
112     description: Branch of the Gitlab repository
113     
114
115 resources:
116   random-str:
117     type: OS::Heat::RandomString
118     properties:
119       length: 4
120
121   # Public key used to access ONAP components
122   vm_key:
123     type: OS::Nova::KeyPair
124     properties:
125       name: 
126         str_replace:
127           template: base_rand
128           params:
129             base: { get_param: key_name }
130             rand: { get_resource: random-str }         
131       public_key: { get_param: pub_key }
132       save_private_key: false
133
134
135   # ONAP management private network
136   oam_ecomp:
137     type: OS::Neutron::Net
138     properties:
139       name: 
140         str_replace:
141           template: oam_ecomp_rand
142           params:
143             rand: { get_resource: random-str }
144
145   oam_ecomp_subnet:
146     type: OS::Neutron::Subnet
147     properties:
148       name: 
149         str_replace:
150           template: oam_ecomp_rand
151           params:
152             rand: { get_resource: random-str }
153       network_id: { get_resource: oam_ecomp }
154       cidr: 10.0.0.0/8
155
156
157   # DNS Server instantiation
158   dns_private_port:
159     type: OS::Neutron::Port
160     properties:
161       network: { get_resource: oam_ecomp }
162       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": 10.0.0.1}]
163
164   dns_vm:
165     type: OS::Nova::Server
166     properties:
167       image: Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM)
168       flavor: 4 GB General Purpose v1
169       name: vm1-dns-server
170       key_name: { get_resource: vm_key }
171       networks:
172         - network: { get_param: public_net_id }
173         - port: { get_resource: dns_private_port }
174       user_data_format: RAW
175       user_data:
176         str_replace:
177           params:
178             __nexus_repo__: { get_param: nexus_repo }
179             __artifacts_version__: { get_param: artifacts_version }
180           template: |
181             #!/bin/bash
182
183             # Download dependencies
184             add-apt-repository -y ppa:openjdk-r/ppa
185             apt-get update
186             apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk bind9 bind9utils bind9-doc ntp ntpdate
187
188             # Download script
189             mkdir /etc/bind/zones
190
191             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/db_simpledemo_openecomp_org -o /etc/bind/zones/db.simpledemo.openecomp.org
192             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/named.conf.options -o /etc/bind/named.conf.options
193             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/named.conf.local -o /etc/bind/named.conf.local
194
195             # Configure Bind
196             modprobe ip_gre
197             sed -i "s/OPTIONS=.*/OPTIONS=\"-4 -u bind\"/g" /etc/default/bind9
198             service bind9 restart
199
200
201   # A&AI instantiation
202   aai_private_port:
203     type: OS::Neutron::Port
204     properties:
205       network: { get_resource: oam_ecomp }
206       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": 10.0.1.1}]
207
208   aai_volume:
209     type: OS::Cinder::Volume
210     properties:
211       name: vol1-aai
212       size: 50
213       volume_type: SSD
214       image: Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM)
215
216   aai_vm:
217     type: OS::Nova::Server
218     depends_on: sdc_vm
219     properties:
220       flavor: 15 GB Compute v1
221       name: vm1-aai
222       key_name: { get_resource: vm_key }
223       block_device_mapping:
224         - volume_id: { get_resource: aai_volume }
225           device_name: vda
226       networks:
227         - network: { get_param: public_net_id }
228         - port: { get_resource: aai_private_port }
229       user_data_format: RAW
230       user_data:
231         str_replace:
232           params:
233             __nexus_repo__: { get_param: nexus_repo }
234             __nexus_docker_repo__: { get_param: nexus_docker_repo }
235             __nexus_username__: { get_param: nexus_username }
236             __nexus_password__: { get_param: nexus_password }
237             __dmaap_topic__: { get_param: dmaap_topic }
238             __artifacts_version__: { get_param: artifacts_version }
239             __docker_version__: { get_param: docker_version }
240           template: |
241             #!/bin/bash
242
243             # DNS/GW IP address configuration
244             echo "nameserver 10.0.0.1" >> /etc/resolvconf/resolv.conf.d/head
245             resolvconf -u
246             
247             # Download dependencies
248             add-apt-repository -y ppa:openjdk-r/ppa
249             apt-get update
250             apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk git ntp ntpdate
251
252             # Download scripts from Nexus
253             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/aai_vm_init.sh -o /opt/aai_vm_init.sh
254             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/aai_serv.sh -o /opt/aai_serv.sh
255             chmod +x /opt/aai_vm_init.sh
256             chmod +x /opt/aai_serv.sh
257             mv /opt/aai_serv.sh /etc/init.d
258             update-rc.d aai_serv.sh defaults
259
260             # Download and install docker-engine and docker-compose
261             apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
262             echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list
263             apt-get update
264             apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual
265             apt-get install -y docker-engine
266             service docker start
267
268             mkdir -p /opt/openecomp/aai/logs
269             mkdir -p /opt/openecomp/aai/data
270             mkdir /opt/docker
271             curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /opt/docker/docker-compose
272             chmod +x /opt/docker/docker-compose
273             
274             # Store credentials in files
275             mkdir -p /opt/config
276             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
277             echo "__nexus_username__" > /opt/config/nexus_username.txt
278             echo "__nexus_password__" > /opt/config/nexus_password.txt
279             echo "__dmaap_topic__" > /opt/config/dmaap_topic.txt
280             echo "__docker_version__" > /opt/config/docker_version.txt
281             
282             # Execute docker instructions
283             cd /opt
284             ./aai_vm_init.sh
285
286
287   # MSO instantiation
288   mso_private_port:
289     type: OS::Neutron::Port
290     properties:
291       network: { get_resource: oam_ecomp }
292       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": 10.0.5.1}]
293
294   mso_vm:
295     type: OS::Nova::Server
296     properties:
297       image: Ubuntu 16.04 LTS (Xenial Xerus) (PVHVM)
298       flavor: 4 GB General Purpose v1
299       name: vm1-mso
300       key_name: { get_resource: vm_key }
301       networks:
302         - network: { get_param: public_net_id }
303         - port: { get_resource: mso_private_port }
304       user_data_format: RAW
305       user_data:
306         str_replace:
307           params:
308             __nexus_repo__: { get_param: nexus_repo }
309             __nexus_docker_repo__: { get_param: nexus_docker_repo }
310             __nexus_username__: { get_param: nexus_username }
311             __nexus_password__: { get_param: nexus_password }
312             __openstack_username__: { get_param: openstack_username }
313             __openstack_tenant_id__: { get_param: openstack_tenant_id }
314             __openstack_api_key__: { get_param: openstack_api_key }
315             __dmaap_topic__: { get_param: dmaap_topic }
316             __artifacts_version__: { get_param: artifacts_version }
317             __docker_version__: { get_param: docker_version }
318             __gerrit_branch__: { get_param: gerrit_branch }
319           template: |
320             #!/bin/bash
321
322             # DNS/GW IP address configuration
323             echo "nameserver 10.0.0.1" >> /etc/resolvconf/resolv.conf.d/head
324             resolvconf -u
325
326             # Download dependencies
327             add-apt-repository -y ppa:openjdk-r/ppa
328             apt-get update
329             apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk git ntp ntpdate
330
331             # Download scripts from Nexus
332             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/mso_vm_init.sh -o /opt/mso_vm_init.sh
333             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/mso_serv.sh -o /opt/mso_serv.sh
334             chmod +x /opt/mso_vm_init.sh
335             chmod +x /opt/mso_serv.sh
336             mv /opt/mso_serv.sh /etc/init.d
337             update-rc.d mso_serv.sh defaults
338
339             # Download and install docker-engine and docker-compose
340             apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
341             echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" | sudo tee /etc/apt/sources.list.d/docker.list
342             apt-get update
343             apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual
344             apt-get install -y docker-engine
345             service docker start
346
347             mkdir /opt/docker
348             curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /opt/docker/docker-compose
349             chmod +x /opt/docker/docker-compose
350
351             # Store credentials in files
352             mkdir -p /opt/config
353             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
354             echo "__nexus_username__" > /opt/config/nexus_username.txt
355             echo "__nexus_password__" > /opt/config/nexus_password.txt
356             echo "__openstack_username__" > /opt/config/openstack_username.txt
357             echo "__openstack_tenant_id__" > /opt/config/tenant_id.txt
358             echo "__dmaap_topic__" > /opt/config/dmaap_topic.txt
359             echo "__docker_version__" > /opt/config/docker_version.txt
360
361             # Run docker-compose to spin up containers
362             cd /opt
363             git clone -b __gerrit_branch__ --single-branch http://gerrit.onap.org/r/mso/docker-config.git test_lab
364             MSO_ENCRYPTION_KEY=$(cat /opt/test_lab/encryption.key)
365             echo -n "__openstack_api_key__" | openssl aes-128-ecb -e -K $MSO_ENCRYPTION_KEY -nosalt | xxd -c 256 -p > /opt/config/api_key.txt
366             ./mso_vm_init.sh
367
368
369   # Message Router instantiation
370   mrouter_private_port:
371     type: OS::Neutron::Port
372     properties:
373       network: { get_resource: oam_ecomp }
374       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": 10.0.11.1}]
375
376   mrouter_vm:
377     type: OS::Nova::Server
378     properties:
379       image: Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM)
380       flavor: 15 GB I/O v1
381       name: vm1-message-router
382       key_name: { get_resource: vm_key }
383       networks:
384         - network: { get_param: public_net_id }
385         - port: { get_resource: mrouter_private_port }
386       user_data_format: RAW
387       user_data:
388         str_replace:
389           params:
390             __nexus_repo__: { get_param: nexus_repo }
391             __nexus_docker_repo__: { get_param: nexus_docker_repo }
392             __nexus_username__: { get_param: nexus_username }
393             __nexus_password__: { get_param: nexus_password }
394             __artifacts_version__: { get_param: artifacts_version }
395             __gerrit_branch__: { get_param: gerrit_branch }
396           template: |
397             #!/bin/bash
398
399             # DNS/GW IP address configuration
400             echo "nameserver 10.0.0.1" >> /etc/resolvconf/resolv.conf.d/head
401             resolvconf -u
402
403             # Download dependencies
404             add-apt-repository -y ppa:openjdk-r/ppa
405             apt-get update
406             apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk git ntp ntpdate
407             
408             # Download scripts from Nexus
409             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/mr_vm_init.sh -o /opt/mr_vm_init.sh
410             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/mr_serv.sh -o /opt/mr_serv.sh
411             chmod +x /opt/mr_vm_init.sh
412             chmod +x /opt/mr_serv.sh
413             mv /opt/mr_serv.sh /etc/init.d
414             update-rc.d mr_serv.sh defaults
415
416             # Download and install docker-engine and docker-compose
417             apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
418             echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list
419             apt-get update
420             apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual
421             apt-get install -y docker-engine
422             service docker start
423
424             mkdir /opt/docker
425             curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /opt/docker/docker-compose
426             chmod +x /opt/docker/docker-compose
427
428             # Store credentials in files
429             mkdir -p /opt/config
430             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
431             echo "__nexus_username__" > /opt/config/nexus_username.txt
432             echo "__nexus_password__" > /opt/config/nexus_password.txt
433
434             # Run docker-compose to spin up containers
435             cd /opt
436             git clone -b __gerrit_branch__ --single-branch http://gerrit.onap.org/r/dcae/demo/startup/message-router.git dcae-startup-vm-message-router
437             ./mr_vm_init.sh
438
439
440   # RobotE2E instantiation
441   robot_private_port:
442     type: OS::Neutron::Port
443     properties:
444       network: { get_resource: oam_ecomp }
445       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": 10.0.10.1}]
446  
447   robot_vm:
448     type: OS::Nova::Server
449     properties:
450       image: Ubuntu 16.04 LTS (Xenial Xerus) (PVHVM)
451       flavor: 2 GB General Purpose v1
452       name: vm1-robot
453       key_name: { get_resource: vm_key }
454       networks:
455         - network: { get_param: public_net_id }
456         - port: { get_resource: robot_private_port }
457       user_data_format: RAW
458       user_data:
459         str_replace:
460           params:
461             __nexus_repo__: { get_param: nexus_repo }
462             __nexus_docker_repo__: { get_param: nexus_docker_repo }
463             __nexus_username__: { get_param: nexus_username }
464             __nexus_password__: { get_param: nexus_password }
465             __network_name__: { get_attr: [oam_ecomp, name] }
466             __openstack_username__: { get_param: openstack_username }
467             __openstack_api_key__: { get_param : openstack_api_key }
468             __openstack_password__: { get_param: openstack_password }
469             __artifacts_version__: { get_param: artifacts_version }
470             __openstack_region__: { get_param: openstack_region }
471             __docker_version__: { get_param: docker_version }
472             __gerrit_branch__: { get_param: gerrit_branch }
473           template: |
474             #!/bin/bash
475
476             # DNS/GW IP address configuration
477             echo "nameserver 10.0.0.1" >> /etc/resolvconf/resolv.conf.d/head
478             resolvconf -u
479  
480             # Download dependencies
481             add-apt-repository -y ppa:openjdk-r/ppa
482             apt-get update
483             apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk git ntp ntpdate
484             echo "APT::Periodic::Unattended-Upgrade \"0\";" >> /etc/apt/apt.conf.d/10periodic
485
486             # Download scripts from Nexus
487             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/robot_vm_init.sh -o /opt/robot_vm_init.sh
488             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/robot_serv.sh -o /opt/robot_serv.sh
489             chmod +x /opt/robot_vm_init.sh
490             chmod +x /opt/robot_serv.sh
491             mv /opt/robot_serv.sh /etc/init.d
492             update-rc.d robot_serv.sh defaults
493  
494             # Download and install docker-engine and docker-compose
495             apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
496             echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" | sudo tee /etc/apt/sources.list.d/docker.list
497             apt-get update
498             apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual
499             apt-get install -y docker-engine
500             service docker start
501  
502             mkdir /opt/docker
503             curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /opt/docker/docker-compose
504             chmod +x /opt/docker/docker-compose
505  
506             # Store credentials in files
507             mkdir -p /opt/config
508             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
509             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
510             echo "__nexus_username__" > /opt/config/nexus_username.txt
511             echo "__nexus_password__" > /opt/config/nexus_password.txt
512             echo "__network_name__" > /opt/config/network.txt
513             echo "__openstack_username__" > /opt/config/openstack_username.txt
514             echo "__openstack_password__" > /opt/config/openstack_password.txt
515             echo "__openstack_api_key__" > /opt/config/openstack_api_key.txt
516             echo "__openstack_region__" > /opt/config/region.txt
517             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
518             echo "__docker_version__" > /opt/config/docker_version.txt
519
520             # Execute RobotETE-specific instructions: create share folder to run as a docker volume
521             mkdir -p /opt/eteshare/logs
522             mkdir -p /opt/eteshare/config
523
524             # Run docker-compose to spin up containers
525             cd /opt
526             git clone -b __gerrit_branch__ --single-branch http://gerrit.onap.org/r/testsuite/properties.git testsuite/properties
527             ./robot_vm_init.sh
528
529
530   # VID instantiation
531   vid_private_port:
532     type: OS::Neutron::Port
533     properties:
534       network: { get_resource: oam_ecomp }
535       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": 10.0.8.1}]
536
537   vid_vm:
538     type: OS::Nova::Server
539     properties:
540       image: Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM)
541       flavor: 2 GB General Purpose v1
542       name: vm1-vid
543       key_name: { get_resource: vm_key }
544       networks:
545         - network: { get_param: public_net_id }
546         - port: { get_resource: vid_private_port }
547       user_data_format: RAW
548       user_data:
549         str_replace:
550           params:
551             __nexus_repo__: { get_param: nexus_repo }
552             __nexus_docker_repo__: { get_param: nexus_docker_repo }
553             __nexus_username__: { get_param: nexus_username }
554             __nexus_password__: { get_param: nexus_password }
555             __artifacts_version__: { get_param: artifacts_version }
556             __docker_version__: { get_param: docker_version }
557             __gerrit_branch__: { get_param: gerrit_branch }
558           template: |
559             #!/bin/bash
560
561             # DNS/GW IP address configuration
562             echo "nameserver 10.0.0.1" >> /etc/resolvconf/resolv.conf.d/head
563             resolvconf -u
564
565             # Download dependencies
566             add-apt-repository -y ppa:openjdk-r/ppa
567             apt-get update
568             apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk make git ntp ntpdate
569
570             # Download scripts from Nexus
571             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/vid_vm_init.sh -o /opt/vid_vm_init.sh
572             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/vid_serv.sh -o /opt/vid_serv.sh
573             chmod +x /opt/vid_vm_init.sh
574             chmod +x /opt/vid_serv.sh
575             mv /opt/vid_serv.sh /etc/init.d
576             update-rc.d vid_serv.sh defaults
577
578             # Download and install docker-engine and docker-compose
579             apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
580             echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list
581             apt-get update
582             apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual
583             apt-get install -y docker-engine
584             service docker start
585
586             mkdir /opt/docker
587             curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /opt/docker/docker-compose
588             chmod +x /opt/docker/docker-compose
589
590             # Store credentials in files
591             mkdir -p /opt/config
592             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
593             echo "__nexus_username__" > /opt/config/nexus_username.txt
594             echo "__nexus_password__" > /opt/config/nexus_password.txt
595             echo "__docker_version__" > /opt/config/docker_version.txt
596
597             # Run script to spin up containers
598             cd /opt
599             git clone -b __gerrit_branch__ --single-branch http://gerrit.onap.org/r/vid.git
600             ./vid_vm_init.sh
601
602
603   # SDN-C instantiation
604   sdnc_private_port:
605     type: OS::Neutron::Port
606     properties:
607       network: { get_resource: oam_ecomp }
608       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": 10.0.7.1}]
609
610   sdnc_vm:
611     type: OS::Nova::Server
612     properties:
613       image: Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM)
614       flavor: 4 GB General Purpose v1
615       name: vm1-sdnc
616       key_name: { get_resource: vm_key }
617       networks:
618         - network: { get_param: public_net_id }
619         - port: { get_resource: sdnc_private_port }
620       user_data_format: RAW
621       user_data:
622         str_replace:
623           params:
624             __nexus_repo__: { get_param: nexus_repo }
625             __nexus_docker_repo__: { get_param: nexus_docker_repo }
626             __nexus_username__: { get_param: nexus_username }
627             __nexus_password__: { get_param: nexus_password }
628             __artifacts_version__: { get_param: artifacts_version }
629             __docker_version__: { get_param: docker_version }
630             __gerrit_branch__: { get_param: gerrit_branch }
631           template: |
632             #!/bin/bash
633
634             # DNS/GW IP address configuration
635             mkdir /opt/config
636             echo "10.0.0.1" > /opt/config/dns_gw_ip.txt
637             echo "nameserver 10.0.0.1" >> /etc/resolvconf/resolv.conf.d/head
638             resolvconf -u
639
640             # Download dependencies
641             add-apt-repository -y ppa:openjdk-r/ppa
642             apt-get update
643             apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk git ntp ntpdate
644
645             # Download scripts from Nexus
646             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/sdnc_vm_init.sh -o /opt/sdnc_vm_init.sh
647             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/sdnc_serv.sh -o /opt/sdnc_serv.sh
648             chmod +x /opt/sdnc_vm_init.sh
649             chmod +x /opt/sdnc_serv.sh
650             mv /opt/sdnc_serv.sh /etc/init.d
651             update-rc.d sdnc_serv.sh defaults
652             
653             # Download and install docker-engine and docker-compose
654             apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
655             echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list
656             apt-get update
657             apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual
658             apt-get install -y docker-engine
659             service docker start
660
661             mkdir /opt/docker
662             curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /opt/docker/docker-compose
663             chmod +x /opt/docker/docker-compose
664             
665             # Store credentials in files
666             mkdir -p /opt/config
667             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
668             echo "__nexus_username__" > /opt/config/nexus_username.txt
669             echo "__nexus_password__" > /opt/config/nexus_password.txt
670             echo "__docker_version__" > /opt/config/docker_version.txt
671
672             # Run docker-compose to spin up containers
673             cd /opt
674             git clone -b __gerrit_branch__ --single-branch http://gerrit.onap.org/r/sdnc/oam.git sdnc
675             ./sdnc_vm_init.sh
676
677
678   # SDC instantiation
679   sdc_private_port:
680     type: OS::Neutron::Port
681     properties:
682       network: { get_resource: oam_ecomp }
683       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": 10.0.3.1}]
684
685   sdc_volume_local:
686     type: OS::Cinder::Volume
687     properties:
688       name: vol1-sdc-local
689       size: 50
690       volume_type: SSD
691       image: Ubuntu 16.04 LTS (Xenial Xerus) (PVHVM)
692
693   sdc_volume_data:
694     type: OS::Cinder::Volume
695     properties:
696       name: vol1-sdc-data
697       size: 100
698       volume_type: SSD
699
700   sdc_volume_attachment:
701     type: OS::Cinder::VolumeAttachment
702     properties:
703       volume_id: { get_resource: sdc_volume_data }
704       instance_uuid: { get_resource: sdc_vm }
705       mountpoint: /dev/xvdb
706
707   sdc_vm:
708     type: OS::Nova::Server
709     properties:
710       flavor: 15 GB Compute v1
711       name: vm1-sdc
712       key_name: { get_resource: vm_key }
713       block_device_mapping:
714         - volume_id: { get_resource: sdc_volume_local }
715           device_name: vda
716       networks:
717         - network: { get_param: public_net_id }
718         - port: { get_resource: sdc_private_port }
719       user_data_format: RAW
720       user_data:
721         str_replace:
722           params:
723             __nexus_repo__: { get_param: nexus_repo }
724             __nexus_docker_repo__: { get_param: nexus_docker_repo }
725             __nexus_username__: { get_param: nexus_username }
726             __nexus_password__: { get_param: nexus_password }
727             __env_name__: { get_param: dmaap_topic }
728             __artifacts_version__: { get_param: artifacts_version }
729             __docker_version__: { get_param: docker_version }
730             __gerrit_branch__: { get_param: gerrit_branch }
731           template: |
732             #!/bin/bash
733             
734             # DNS/GW IP address configuration
735             mkdir /opt/config
736             echo "10.0.0.1" > /opt/config/dns_gw_ip.txt
737             echo "nameserver 10.0.0.1" >> /etc/resolvconf/resolv.conf.d/head
738             resolvconf -u
739           
740             # Download dependencies
741             add-apt-repository -y ppa:openjdk-r/ppa
742             apt-get update
743             apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk git ntp ntpdate
744             
745             # Download scripts from Nexus
746             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/asdc_vm_init.sh -o /opt/asdc_vm_init.sh
747             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/asdc_serv.sh -o /opt/asdc_serv.sh
748             chmod +x /opt/asdc_vm_init.sh
749             chmod +x /opt/asdc_serv.sh
750             mv /opt/asdc_serv.sh /etc/init.d
751             update-rc.d asdc_serv.sh defaults
752             
753             # Download and install docker-engine and docker-compose
754             apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
755             echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" | sudo tee /etc/apt/sources.list.d/docker.list
756             apt-get update
757             apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual
758             apt-get install -y docker-engine
759             service docker start
760             mkdir /opt/docker
761             curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /opt/docker/docker-compose
762             chmod +x /opt/docker/docker-compose
763
764             # Create partition and mount the external volume
765             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/asdc_ext_volume_partitions.txt -o /opt/asdc_ext_volume_partitions.txt
766             sfdisk /dev/xvdb < /opt/asdc_ext_volume_partitions.txt
767             mkfs -t ext4 /dev/xvdb1
768             mkdir -p /data
769             mount /dev/xvdb1 /data
770             echo "/dev/xvdb1  /data           ext4    errors=remount-ro,noatime,barrier=0 0       1" >> /etc/fstab
771
772             # Store credentials in files
773             mkdir -p /opt/config
774             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
775             echo "__nexus_username__" > /opt/config/nexus_username.txt
776             echo "__nexus_password__" > /opt/config/nexus_password.txt
777             echo "__env_name__" > /opt/config/env_name.txt
778             echo "10.0.11.1" > /opt/config/mr_ip_addr.txt
779             echo "__docker_version__" > /opt/config/docker_version.txt
780
781             # Run SDC-specific instructions
782             cd /opt
783             mkdir -p /data/environments
784             mkdir -p /data/scripts
785             mkdir -p /data/logs/BE
786             mkdir -p /data/logs/FE
787             chmod 777 /data
788             chmod 777 /data/logs/BE
789             chmod 777 /data/logs/FE
790
791             git clone -b __gerrit_branch__ --single-branch http://gerrit.onap.org/r/sdc.git
792
793             cat > /root/.bash_aliases << EOF
794             alias dcls='/data/scripts/docker_clean.sh \$1'
795             alias dlog='/data/scripts/docker_login.sh \$1'
796             alias rund='/data/scripts/docker_run.sh'
797             alias health='/data/scripts/docker_health.sh'
798             EOF
799
800             # Run docker-compose to spin up containers
801             ./asdc_vm_init.sh
802             
803
804   # PORTAL instantiation
805   portal_private_port:
806     type: OS::Neutron::Port
807     properties:
808       network: { get_resource: oam_ecomp }
809       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": 10.0.9.1}]
810
811   portal_volume:
812     type: OS::Cinder::Volume
813     properties:
814       name: vol1-portal
815       size: 50
816       volume_type: SSD
817       image: Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM)
818
819   portal_vm:
820     type: OS::Nova::Server
821     properties:
822       flavor: 15 GB Memory v1
823       name: vm1-portal
824       key_name: { get_resource: vm_key }
825       block_device_mapping:
826         - volume_id: { get_resource: portal_volume }
827           device_name: vda
828       networks:
829         - network: { get_param: public_net_id }
830         - port: { get_resource: portal_private_port }
831       user_data_format: RAW
832       user_data:
833         str_replace:
834           params:
835             __nexus_repo__: { get_param: nexus_repo }
836             __nexus_docker_repo__: { get_param: nexus_docker_repo }
837             __nexus_username__: { get_param: nexus_username }
838             __nexus_password__: { get_param: nexus_password }
839             __artifacts_version__: { get_param: artifacts_version }
840             __docker_version__: { get_param: docker_version }
841             __gerrit_branch__: { get_param: gerrit_branch }
842           template: |
843             #!/bin/bash
844             
845             # DNS/GW IP address configuration
846             mkdir /opt/config
847             echo "10.0.0.1" > /opt/config/dns_gw_ip.txt
848             echo "nameserver 10.0.0.1" >> /etc/resolvconf/resolv.conf.d/head
849             resolvconf -u
850             
851             # Download dependencies
852             add-apt-repository -y ppa:openjdk-r/ppa
853             apt-get update
854             apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk git unzip mysql-client-core-5.6 ntp ntpdate
855             
856             # Download scripts from Nexus
857             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/portal_vm_init.sh -o /opt/portal_vm_init.sh
858             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/portal_serv.sh -o /opt/portal_serv.sh
859             chmod +x /opt/portal_vm_init.sh
860             chmod +x /opt/portal_serv.sh
861             mv /opt/portal_serv.sh /etc/init.d
862             update-rc.d portal_serv.sh defaults
863             
864             # Download and install docker-engine and docker-compose
865             apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
866             echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list
867             apt-get update
868             apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual
869             apt-get install -y docker-engine
870             service docker start
871             mkdir /opt/docker
872             curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /opt/docker/docker-compose
873             chmod +x /opt/docker/docker-compose
874
875             # Store credentials in files
876             mkdir -p /opt/config
877             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
878             echo "__nexus_username__" > /opt/config/nexus_username.txt
879             echo "__nexus_password__" > /opt/config/nexus_password.txt
880             echo "__docker_version__" > /opt/config/docker_version.txt
881
882             # Run Portal-specific instructions
883             mkdir -p /PROJECT/OpenSource/UbuntuEP/logs
884             cd /opt
885             git clone -b __gerrit_branch__ --single-branch http://gerrit.onap.org/r/portal.git
886
887             # Run docker-compose to spin up containers
888             ./portal_vm_init.sh
889
890
891   # DCAE Controller instantiation
892   dcae_c_private_port:
893     type: OS::Neutron::Port
894     properties:
895       network: { get_resource: oam_ecomp }
896       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": 10.0.4.1}]
897   dcae_c_vm:
898     type: OS::Nova::Server
899     properties:
900       image: Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM)
901       flavor: 8 GB General Purpose v1
902       name: vm1-dcae-controller
903       key_name: { get_resource: vm_key }
904       networks:
905         - network: { get_param: public_net_id }
906         - port: { get_resource: dcae_c_private_port }
907       user_data_format: RAW
908       user_data: 
909         str_replace:
910           params:
911             __nexus_repo__: { get_param: nexus_repo }
912             __nexus_docker_repo__: { get_param: nexus_docker_repo }
913             __nexus_username__: { get_param: nexus_username }
914             __nexus_password__: { get_param: nexus_password }
915             __nexus_url_snapshots__: { get_param: nexus_url_snapshot }
916             __gitlab_branch__: { get_param: gitlab_branch }
917             __dcae_zone__: { get_param: dcae_zone }
918             __dcae_state__: { get_param: dcae_state }
919             __artifacts_version__: { get_param: artifacts_version }
920             __tenant_id__: { get_param: openstack_tenant_id }
921             __openstack_private_network_name__: { get_attr: [oam_ecomp, name] }
922             __openstack_user__: { get_param: openstack_username }
923             __openstack_password__: { get_param: openstack_api_key }
924             __key_name__: { get_param: key_name }
925             __rand_str__: { get_resource: random-str }
926             __pub_key__: { get_param: pub_key }
927             __nexus_repo_root__: { get_param: nexus_repo_root }
928             __openstack_region__: { get_param: openstack_region }
929             __docker_version__: { get_param: docker_version }
930             __gerrit_branch__: { get_param: gerrit_branch }
931           template: |
932             #!/bin/bash
933             
934             # DNS/GW IP address configuration
935             echo "nameserver 10.0.0.1" >> /etc/resolvconf/resolv.conf.d/head
936             resolvconf -u
937
938             # Download dependencies
939             add-apt-repository -y ppa:openjdk-r/ppa
940             apt-get update
941             apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk make git ntp ntpdate
942
943             # Download scripts from Nexus
944             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/dcae_vm_init.sh -o /opt/dcae_vm_init.sh
945             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/dcae_serv.sh -o /opt/dcae_serv.sh
946             chmod +x /opt/dcae_vm_init.sh
947             chmod +x /opt/dcae_serv.sh
948             mv /opt/dcae_serv.sh /etc/init.d
949             update-rc.d dcae_serv.sh defaults
950
951             # Download and install docker-engine and docker-compose
952             apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
953             echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list
954             apt-get update
955             apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual
956             apt-get install -y docker-engine
957             service docker start
958             mkdir /opt/docker
959             curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /opt/docker/docker-compose
960             chmod +x /opt/docker/docker-compose
961             
962             # DCAE Controller specific deployment
963             cd /opt
964             git clone -b __gerrit_branch__ --single-branch http://gerrit.onap.org/r/dcae/demo/startup/controller.git dcae-startup-vm-controller
965
966             cd dcae-startup-vm-controller
967             mkdir -p /opt/app/dcae-controller
968             cat > /opt/app/dcae-controller/config.yaml << EOF_CONFIG
969             ZONE: __dcae_zone__
970             STATE: __dcae_state__
971             DCAE-VERSION: __artifacts_version__
972             HORIZON-URL: https://mycloud.rackspace.com/cloud/__tenant_id__
973             KEYSTONE-URL: https://identity.api.rackspacecloud.com/v2.0
974             OPENSTACK-TENANT-ID: __tenant_id__
975             OPENSTACK-TENANT-NAME: OPEN-ECOMP
976             OPENSTACK-REGION: __openstack_region__
977             OPENSTACK-PRIVATE-NETWORK: __openstack_private_network_name__
978             OPENSTACK-USER: __openstack_user__
979             OPENSTACK-PASSWORD: __openstack_password__
980             OPENSTACK-KEYNAME: __key_name_____rand_str___dcae
981             OPENSTACK-PUBKEY: __pub_key__
982             
983             NEXUS-URL-ROOT: __nexus_repo_root__
984             NEXUS-USER: __nexus_username__
985             NEXUS-PASSWORD: __nexus_password__
986             NEXUS-URL-SNAPSHOTS: __nexus_url_snapshots__
987             NEXUS-RAWURL: __nexus_repo__
988             
989             DOCKER-REGISTRY: __nexus_docker_repo__
990
991             GIT-MR-REPO: http://gerrit.onap.org/r/dcae/demo/startup/message-router.git
992             EOF_CONFIG
993
994             # Store credentials in files
995             mkdir -p /opt/config
996             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
997             echo "__nexus_username__" > /opt/config/nexus_username.txt
998             echo "__nexus_password__" > /opt/config/nexus_password.txt
999             echo "__gitlab_branch__" > /opt/config/gitlab_branch.txt
1000             echo "__docker_version__" > /opt/config/docker_version.txt
1001
1002             cd /opt
1003             ./dcae_vm_init.sh
1004
1005
1006   # Policy engine instantiation
1007   policy_private_port:
1008     type: OS::Neutron::Port
1009     properties:
1010       network: { get_resource: oam_ecomp }
1011       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": 10.0.6.1}]
1012
1013   policy_volume:
1014     type: OS::Cinder::Volume
1015     properties:
1016       name: vol1-policy
1017       size: 50
1018       volume_type: SSD
1019       image: Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM)
1020
1021   policy_vm:
1022     type: OS::Nova::Server
1023     properties:
1024       flavor: 15 GB Compute v1
1025       name: vm1-policy
1026       key_name: { get_resource: vm_key }
1027       block_device_mapping:
1028         - volume_id: { get_resource: policy_volume }
1029           device_name: vda
1030       networks:
1031         - network: { get_param: public_net_id }
1032         - port: { get_resource: policy_private_port }
1033       user_data_format: RAW
1034       user_data:
1035         str_replace:
1036           params:
1037             __nexus_repo__: { get_param: nexus_repo }
1038             __nexus_docker_repo__: { get_param: nexus_docker_repo }
1039             __nexus_username__: { get_param: nexus_username }
1040             __nexus_password__: { get_param: nexus_password }
1041             __artifacts_version__: { get_param: artifacts_version }
1042             __docker_version__: { get_param: docker_version }
1043             __gerrit_branch__: { get_param: gerrit_branch }
1044           template: |
1045             #!/bin/bash
1046             
1047             # DNS/GW IP address configuration
1048             mkdir /opt/config
1049             echo "10.0.0.1" > /opt/config/dns_gw_ip.txt
1050             echo "nameserver 10.0.0.1" >> /etc/resolvconf/resolv.conf.d/head
1051             resolvconf -u
1052
1053             # Download dependencies
1054             add-apt-repository -y ppa:openjdk-r/ppa
1055             apt-get update
1056             apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk git ntp ntpdate
1057
1058             # Download scripts from Nexus
1059             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/policy_vm_init.sh -o /opt/policy_vm_init.sh
1060             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/policy_serv.sh -o /opt/policy_serv.sh
1061             chmod +x /opt/policy_vm_init.sh
1062             chmod +x /opt/policy_serv.sh
1063             mv /opt/policy_serv.sh /etc/init.d
1064             update-rc.d policy_serv.sh defaults
1065
1066             # Download and install docker-engine and docker-compose
1067             apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
1068             echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list
1069             apt-get update
1070             apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual
1071             apt-get install -y docker-engine
1072             service docker start
1073             mkdir /opt/docker
1074             curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /opt/docker/docker-compose
1075             chmod +x /opt/docker/docker-compose
1076
1077             # Store credentials in files
1078             mkdir -p /opt/config
1079             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
1080             echo "__nexus_username__" > /opt/config/nexus_username.txt
1081             echo "__nexus_password__" > /opt/config/nexus_password.txt
1082             echo "__docker_version__" > /opt/config/docker_version.txt
1083
1084             # Run docker-compose to spin up containers
1085             cd /opt
1086             git clone -b __gerrit_branch__ --single-branch http://gerrit.onap.org/r/policy/docker.git policy
1087
1088             ./policy_vm_init.sh
1089
1090
1091   # APP-C instantiation
1092   appc_private_port:
1093     type: OS::Neutron::Port
1094     properties:
1095       network: { get_resource: oam_ecomp }
1096       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": 10.0.2.1}]
1097
1098   appc_vm:
1099     type: OS::Nova::Server
1100     properties:
1101       image: Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM)
1102       flavor: 4 GB General Purpose v1
1103       name: vm1-appc
1104       key_name: { get_resource: vm_key }
1105       networks:
1106         - network: { get_param: public_net_id }
1107         - port: { get_resource: appc_private_port }
1108       user_data_format: RAW
1109       user_data:
1110         str_replace:
1111           params:
1112             __nexus_repo__: { get_param: nexus_repo }
1113             __nexus_docker_repo__: { get_param: nexus_docker_repo }
1114             __nexus_username__: { get_param: nexus_username }
1115             __nexus_password__: { get_param: nexus_password }
1116             __dmaap_topic__: { get_param: dmaap_topic }
1117             __artifacts_version__: { get_param: artifacts_version }
1118             __docker_version__: { get_param: docker_version }
1119             __gerrit_branch__: { get_param: gerrit_branch }
1120           template: |
1121             #!/bin/bash
1122
1123             # DNS/GW IP address configuration
1124             mkdir /opt/config
1125             echo "10.0.0.1" > /opt/config/dns_gw_ip.txt
1126             echo "nameserver 10.0.0.1" >> /etc/resolvconf/resolv.conf.d/head
1127             resolvconf -u
1128
1129             # Download dependencies
1130             add-apt-repository -y ppa:openjdk-r/ppa
1131             apt-get update
1132             apt-get install -y apt-transport-https ca-certificates wget openjdk-7-jdk git ntp ntpdate
1133
1134             # Download scripts from Nexus
1135             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/appc_vm_init.sh -o /opt/appc_vm_init.sh
1136             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/appc_serv.sh -o /opt/appc_serv.sh
1137             chmod +x /opt/appc_vm_init.sh
1138             chmod +x /opt/appc_serv.sh
1139             mv /opt/appc_serv.sh /etc/init.d
1140             update-rc.d appc_serv.sh defaults
1141             
1142             # Download and install docker-engine and docker-compose
1143             apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
1144             echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list
1145             apt-get update
1146             apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual
1147             apt-get install -y docker-engine
1148             service docker start
1149
1150             mkdir /opt/docker
1151             curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /opt/docker/docker-compose
1152             chmod +x /opt/docker/docker-compose
1153             
1154             # Store credentials in files
1155             mkdir -p /opt/config
1156             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
1157             echo "__nexus_username__" > /opt/config/nexus_username.txt
1158             echo "__nexus_password__" > /opt/config/nexus_password.txt
1159             echo "__dmaap_topic__" > /opt/config/dmaap_topic.txt
1160             echo "__docker_version__" > /opt/config/docker_version.txt
1161
1162             # Run docker-compose to spin up containers
1163             cd /opt
1164             git clone -b __gerrit_branch__ --single-branch http://gerrit.onap.org/r/appc/deployment.git appc
1165             ./appc_vm_init.sh
1166