Parametrize ONAP installation repositories
[demo.git] / heat / ONAP / onap_openstack_nofloat.yaml
1 ##########################################################################
2 #
3 #==================LICENSE_START==========================================
4
5 #
6 # Copyright © 2017 AT&T Intellectual Property. All rights reserved.
7 #
8 # Licensed under the Apache License, Version 2.0 (the "License");
9 # you may not use this file except in compliance with the License.
10 # You may obtain a copy of the License at
11 #        http://www.apache.org/licenses/LICENSE-2.0
12 #
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
18 #
19 #==================LICENSE_END============================================
20 #
21 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
22 #
23 ##########################################################################
24
25 heat_template_version: 2013-05-23
26
27 description: Heat template to install ONAP components
28
29 ##############
30 #            #
31 # PARAMETERS #
32 #            #
33 ##############
34
35 parameters:
36
37   ##############################################
38   #                                            #
39   # Parameters used across all ONAP components #
40   #                                            #
41   ##############################################
42   
43   public_net_id:
44     type: string
45     description: Public network for floating IP address allocation
46
47   ubuntu_1404_image:
48     type: string
49     description: Name of the Ubuntu 14.04 image
50
51   ubuntu_1604_image:
52     type: string
53     description: Name of the Ubuntu 16.04 image
54
55   flavor_small:
56     type: string
57     description: Name of the Small Flavor supported by the cloud provider
58
59   flavor_medium:
60     type: string
61     description: Name of the Medium Flavor supported by the cloud provider
62
63   flavor_large:
64     type: string
65     description: Name of the Large Flavor supported by the cloud provider
66
67   flavor_xlarge:
68     type: string
69     description: Name of the Extra Large Flavor supported by the cloud provider
70
71   vm_base_name:
72     type: string
73     description: Base name of ONAP VMs
74
75   key_name:
76     type: string
77     description: Public/Private key pair name
78
79   pub_key:
80     type: string
81     description: Public key to be installed on the compute instance
82
83   nexus_repo:
84     type: string
85     description: Complete URL for the Nexus repository.
86
87   nexus_docker_repo:
88     type: string
89     description: Complete URL for the Nexus repository for docker images.
90
91   nexus_username:
92     type: string
93     description: Nexus Repository username
94
95   nexus_password:
96     type: string
97     description: Nexus Repository Password
98
99   artifacts_version:
100     type: string
101     description: Artifacts version of ONAP components
102
103   docker_version:
104     type: string
105     label: Version number of ONAP docker images
106
107   gerrit_branch:
108     type: string
109     label: Gerrit code branch
110     description: Gerrit branch where to download the code from
111
112   dmaap_topic:
113     type: string
114     description: DMaaP Topic name
115
116   openstack_tenant_id:
117     type: string
118     description: Openstack tenant ID
119
120   openstack_username:
121     type: string
122     description: Openstack username
123
124   openstack_auth_method:
125     type: string
126     description: Openstack authentication method (password VS. api-key)
127
128   openstack_api_key:
129     type: string
130     description: Openstack API Key
131
132   horizon_url:
133     type: string
134     description: URL of Openstack Horizon
135
136   keystone_url:
137     type: string
138     description: URL of Openstack Keystone
139
140   cloud_env:
141     type: string
142     description: Cloud Provider Name
143
144   ######################
145   #                    #
146   # Network parameters #
147   #                    #
148   ######################
149
150   external_dns:
151     type: string
152     description: External DNS for OAM ONAP network
153
154   ### Private IP addresses ###
155   oam_network_cidr:
156     type: string
157     description: CIDR of the OAM ONAP network
158
159   aai1_ip_addr:
160     type: string
161     description: AAI Instance 1 IP Address
162
163   aai2_ip_addr:
164     type: string
165     description: AAI Instance 2 IP Address
166
167   appc_ip_addr:
168     type: string
169     description: APP-C IP Address
170
171   dcae_ip_addr:
172     type: string
173     description: DCAE IP Address
174  
175   dcae_coll_ip_addr:
176     type: string
177     description: DCAE Collector IP Address
178
179   dcae_db_ip_addr:
180     type: string
181     description: DCAE Database IP Address
182
183   dcae_hdp1_ip_addr:
184     type: string
185     description: Hadoop VM1 IP Address
186
187   dcae_hdp2_ip_addr:
188     type: string
189     description: Hadoop VM2 IP Address
190
191   dcae_hdp3_ip_addr:
192     type: string
193     description: Hadoop VM3 IP Address
194
195   dns_ip_addr:
196     type: string
197     description: DNS IP Address
198
199   mso_ip_addr:
200     type: string
201     description: MSO IP Address
202
203   mr_ip_addr:
204     type: string
205     description: Message Router IP Address
206
207   policy_ip_addr:
208     type: string
209     description: Policy Engine IP Address
210
211   portal_ip_addr:
212     type: string
213     description: Portal IP Address
214
215   robot_ip_addr:
216     type: string
217     description: Robot Framework IP Address
218
219   sdc_ip_addr:
220     type: string
221     description: SDC IP Address
222
223   sdnc_ip_addr:
224     type: string
225     description: SDN-C IP Address
226
227   vid_ip_addr:
228     type: string
229     description: VID IP Address
230
231
232   ###########################
233   #                         #
234   # Parameters used by DCAE #
235   #                         #
236   ###########################
237
238   dcae_base_environment:
239     type: string
240     description: DCAE Base Environment configuration (RACKSPACE/2-NIC/1-NIC-FLOATING-IPS)
241
242   dcae_zone:
243     type: string
244     description: DCAE Zone to use in VM names created by DCAE controller
245
246   dcae_state:
247     type: string
248     description: DCAE State to use in VM names created by DCAE controller
249
250   nexus_repo_root:
251     type: string
252     description: Root URL of Nexus repository
253
254   nexus_url_snapshot:
255     type: string
256     description: Snapshot of Maven repository for DCAE deployment
257
258   openstack_region:
259     type: string
260     description: Region where the DCAE controller will spin the VMs
261
262   gitlab_branch:
263     type: string
264     description: Branch of the Gitlab repository
265     
266   dcae_code_version:
267     type: string
268     description: DCAE Code Version Number
269
270   #####################
271   #                   #
272   # ONAP repositories #
273   #                   #
274   #####################
275
276   aai_repo:
277     type: string
278     description: AAI repository
279
280   appc_repo:
281     type: string
282     description: APPC repository
283
284   dcae_repo:
285     type: string
286     description: DCAE repository
287
288   mr_repo:
289     type: string
290     description: Message Router repository
291
292   mso_repo:
293     type: string
294     description: MSO repository
295
296   policy_repo:
297     type: string
298     description: Policy repository
299
300   portal_repo:
301     type: string
302     description: Portal repository
303
304   robot_repo:
305     type: string
306     description: Robot repository
307
308   sdc_repo:
309     type: string
310     description: SDC repository
311
312   sdnc_repo:
313     type: string
314     description: SDNC repository
315
316   vid_repo:
317     type: string
318     description: VID repository
319
320
321 #############
322 #           #
323 # RESOURCES #
324 #           #
325 #############
326
327 resources:
328   random-str:
329     type: OS::Heat::RandomString
330     properties:
331       length: 4
332
333
334   # Public key used to access ONAP components
335   vm_key:
336     type: OS::Nova::KeyPair
337     properties:
338       name:
339         str_replace:
340           template: base_rand
341           params:
342             base: { get_param: key_name }
343             rand: { get_resource: random-str }
344       public_key: { get_param: pub_key }
345       save_private_key: false
346
347
348   # ONAP management private network
349   oam_onap:
350     type: OS::Neutron::Net
351     properties:
352       name:
353         str_replace:
354           template: oam_onap_rand
355           params:
356             rand: { get_resource: random-str }
357
358   oam_onap_subnet:
359     type: OS::Neutron::Subnet
360     properties:
361       name:
362         str_replace:
363           template: oam_onap_rand
364           params:
365             rand: { get_resource: random-str }
366       network_id: { get_resource: oam_onap }
367       cidr: { get_param: oam_network_cidr }
368
369
370   # DNS Server instantiation
371   dns_private_port:
372     type: OS::Neutron::Port
373     properties:
374       network: { get_resource: oam_onap }
375       fixed_ips: [{"subnet": { get_resource: oam_onap_subnet }, "ip_address": { get_param: dns_ip_addr }}]
376
377   dns_vm:
378     type: OS::Nova::Server
379     properties:
380       image: { get_param: ubuntu_1404_image }
381       flavor: { get_param: flavor_small }
382       name:
383         str_replace:
384           template: base-dns-server
385           params:
386             base: { get_param: vm_base_name }
387       key_name: { get_resource: vm_key }
388       networks:
389         - network: { get_param: public_net_id }
390         - port: { get_resource: dns_private_port }
391       user_data_format: RAW
392       user_data:
393         str_replace:
394           params:
395             __nexus_repo__: { get_param: nexus_repo }
396             __artifacts_version__: { get_param: artifacts_version }
397             __oam_network_cidr__: { get_param: oam_network_cidr }
398             __dns_ip_addr__: { get_param: dns_ip_addr }
399             __aai1_ip_addr__: { get_param: aai1_ip_addr }
400             __aai2_ip_addr__: { get_param: aai2_ip_addr }
401             __appc_ip_addr__: { get_param: appc_ip_addr }
402             __dcae_ip_addr__: { get_param: dcae_ip_addr }
403             __dcae_coll_ip_addr__: { get_param: dcae_coll_ip_addr }
404             __mso_ip_addr__: { get_param: mso_ip_addr }
405             __mr_ip_addr__: { get_param: mr_ip_addr }
406             __policy_ip_addr__: { get_param: policy_ip_addr }
407             __portal_ip_addr__: { get_param: portal_ip_addr }
408             __robot_ip_addr__: { get_param: robot_ip_addr }
409             __sdc_ip_addr__: { get_param: sdc_ip_addr }
410             __sdnc_ip_addr__: { get_param: sdnc_ip_addr }
411             __vid_ip_addr__: { get_param: vid_ip_addr }
412             __cloud_env__: { get_param: cloud_env }
413             __external_dns__: { get_param: external_dns }
414           template: |
415             #!/bin/bash
416
417             # Create configuration files
418             mkdir -p /opt/config
419             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
420             echo "__cloud_env__" > /opt/config/cloud_env.txt
421             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
422             echo "__oam_network_cidr__" > /opt/config/oam_network_cidr.txt
423             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
424             echo "__aai1_ip_addr__" > /opt/config/aai1_ip_addr.txt
425             echo "__aai2_ip_addr__" > /opt/config/aai2_ip_addr.txt
426             echo "__appc_ip_addr__" > /opt/config/appc_ip_addr.txt
427             echo "__dcae_ip_addr__" > /opt/config/dcae_ip_addr.txt
428             echo "__dcae_coll_ip_addr__" > /opt/config/dcae_coll_ip_addr.txt
429             echo "__mso_ip_addr__" > /opt/config/mso_ip_addr.txt
430             echo "__mr_ip_addr__" > /opt/config/mr_ip_addr.txt
431             echo "__policy_ip_addr__" > /opt/config/policy_ip_addr.txt
432             echo "__portal_ip_addr__" > /opt/config/portal_ip_addr.txt
433             echo "__robot_ip_addr__" > /opt/config/robot_ip_addr.txt
434             echo "__sdc_ip_addr__" > /opt/config/sdc_ip_addr.txt
435             echo "__sdnc_ip_addr__" > /opt/config/sdnc_ip_addr.txt
436             echo "__vid_ip_addr__" > /opt/config/vid_ip_addr.txt
437             echo "__external_dns__" > /opt/config/external_dns.txt
438
439             # Download and run install script
440             curl -k __nexus_repo__/org.onap.demo/boot/__artifacts_version__/dns_install.sh -o /opt/dns_install.sh
441             cd /opt
442             chmod +x dns_install.sh
443             ./dns_install.sh
444
445
446   # A&AI instantiation (2 VMs)
447   aai1_private_port:
448     type: OS::Neutron::Port
449     properties:
450       network: { get_resource: oam_onap }
451       fixed_ips: [{"subnet": { get_resource: oam_onap_subnet }, "ip_address": { get_param: aai1_ip_addr }}]
452
453   aai1_vm:
454     type: OS::Nova::Server
455     depends_on: aai2_vm
456     properties:
457       image: { get_param: ubuntu_1404_image }
458       flavor: { get_param: flavor_xlarge }
459       name:
460         str_replace:
461           template: base-aai-inst1
462           params:
463             base: { get_param: vm_base_name }      
464       key_name: { get_resource: vm_key }
465       networks:
466         - network: { get_param: public_net_id }
467         - port: { get_resource: aai1_private_port }
468       user_data_format: RAW
469       user_data:
470         str_replace:
471           params:
472             __nexus_repo__: { get_param: nexus_repo }
473             __nexus_docker_repo__: { get_param: nexus_docker_repo }
474             __nexus_username__: { get_param: nexus_username }
475             __nexus_password__: { get_param: nexus_password }
476             __dmaap_topic__: { get_param: dmaap_topic }
477             __artifacts_version__: { get_param: artifacts_version }
478             __dns_ip_addr__: { get_param: dns_ip_addr }
479             __aai_ip_addr__: { get_param: aai1_ip_addr }
480             __oam_network_cidr__: { get_param: oam_network_cidr }
481             __docker_version__: { get_param: docker_version }
482             __gerrit_branch__: { get_param: gerrit_branch }
483             __cloud_env__: { get_param: cloud_env }
484             __external_dns__: { get_param: external_dns }
485             __aai_repo__: { get_param: aai_repo }
486           template: |
487             #!/bin/bash
488
489             # Create configuration files
490             mkdir -p /opt/config
491             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
492             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
493             echo "__nexus_username__" > /opt/config/nexus_username.txt
494             echo "__nexus_password__" > /opt/config/nexus_password.txt
495             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
496             echo "__aai_ip_addr__" > /opt/config/local_ip_addr.txt
497             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
498             echo "__oam_network_cidr__" > /opt/config/oam_network_cidr.txt
499             echo "__dmaap_topic__" > /opt/config/dmaap_topic.txt
500             echo "__docker_version__" > /opt/config/docker_version.txt
501             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
502             echo "aai_instance_1" > /opt/config/aai_instance.txt
503             echo "__cloud_env__" > /opt/config/cloud_env.txt
504             echo "__external_dns__" > /opt/config/external_dns.txt
505             echo "__aai_repo__" > /opt/config/remote_repo.txt
506
507             # Download and run install script
508             curl -k __nexus_repo__/org.onap.demo/boot/__artifacts_version__/aai_install.sh -o /opt/aai_install.sh
509             cd /opt
510             chmod +x aai_install.sh
511             ./aai_install.sh
512
513
514   aai2_private_port:
515     type: OS::Neutron::Port
516     properties:
517       network: { get_resource: oam_onap }
518       fixed_ips: [{"subnet": { get_resource: oam_onap_subnet }, "ip_address": { get_param: aai2_ip_addr }}]
519
520   aai2_vm:
521     type: OS::Nova::Server
522     properties:
523       image: { get_param: ubuntu_1404_image }
524       flavor: { get_param: flavor_xlarge }
525       name:
526         str_replace:
527           template: base-aai-inst2
528           params:
529             base: { get_param: vm_base_name }      
530       key_name: { get_resource: vm_key }
531       networks:
532         - network: { get_param: public_net_id }
533         - port: { get_resource: aai2_private_port }
534       user_data_format: RAW
535       user_data:
536         str_replace:
537           params:
538             __nexus_repo__: { get_param: nexus_repo }
539             __nexus_docker_repo__: { get_param: nexus_docker_repo }
540             __nexus_username__: { get_param: nexus_username }
541             __nexus_password__: { get_param: nexus_password }
542             __dmaap_topic__: { get_param: dmaap_topic }
543             __artifacts_version__: { get_param: artifacts_version }
544             __dns_ip_addr__: { get_param: dns_ip_addr }
545             __aai_ip_addr__: { get_param: aai2_ip_addr }
546             __oam_network_cidr__: { get_param: oam_network_cidr }
547             __docker_version__: { get_param: docker_version }
548             __gerrit_branch__: { get_param: gerrit_branch }
549             __cloud_env__: { get_param: cloud_env }
550             __external_dns__: { get_param: external_dns }
551             __aai_repo__: { get_param: aai_repo }
552           template: |
553             #!/bin/bash
554
555             # Create configuration files
556             mkdir -p /opt/config
557             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
558             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
559             echo "__nexus_username__" > /opt/config/nexus_username.txt
560             echo "__nexus_password__" > /opt/config/nexus_password.txt
561             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
562             echo "__aai_ip_addr__" > /opt/config/local_ip_addr.txt
563             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
564             echo "__oam_network_cidr__" > /opt/config/oam_network_cidr.txt
565             echo "__dmaap_topic__" > /opt/config/dmaap_topic.txt
566             echo "__docker_version__" > /opt/config/docker_version.txt
567             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
568             echo "aai_instance_2" > /opt/config/aai_instance.txt
569             echo "__cloud_env__" > /opt/config/cloud_env.txt
570             echo "__external_dns__" > /opt/config/external_dns.txt
571             echo "__aai_repo__" > /opt/config/remote_repo.txt
572
573             # Download and run install script
574             curl -k __nexus_repo__/org.onap.demo/boot/__artifacts_version__/aai_install.sh -o /opt/aai_install.sh
575             cd /opt
576             chmod +x aai_install.sh
577             ./aai_install.sh
578
579
580   # MSO instantiation
581   mso_private_port:
582     type: OS::Neutron::Port
583     properties:
584       network: { get_resource: oam_onap }
585       fixed_ips: [{"subnet": { get_resource: oam_onap_subnet }, "ip_address": { get_param: mso_ip_addr }}]
586
587   mso_vm:
588     type: OS::Nova::Server
589     properties:
590       image: { get_param: ubuntu_1604_image }
591       flavor: { get_param: flavor_large }
592       name:
593         str_replace:
594           template: base-mso
595           params:
596             base: { get_param: vm_base_name }      
597       key_name: { get_resource: vm_key }
598       networks:
599         - network: { get_param: public_net_id }
600         - port: { get_resource: mso_private_port }
601       user_data_format: RAW
602       user_data:
603         str_replace:
604           params:
605             __nexus_repo__: { get_param: nexus_repo }
606             __nexus_docker_repo__: { get_param: nexus_docker_repo }
607             __nexus_username__: { get_param: nexus_username }
608             __nexus_password__: { get_param: nexus_password }
609             __openstack_username__: { get_param: openstack_username }
610             __openstack_tenant_id__: { get_param: openstack_tenant_id }
611             __openstack_api_key__: { get_param: openstack_api_key }
612             __openstack_region__: { get_param: openstack_region }
613             __keystone_url__: { get_param: keystone_url }
614             __dmaap_topic__: { get_param: dmaap_topic }
615             __artifacts_version__: { get_param: artifacts_version }
616             __dns_ip_addr__: { get_param: dns_ip_addr }
617             __mso_ip_addr__: { get_param: mso_ip_addr }
618             __oam_network_cidr__: { get_param: oam_network_cidr }
619             __docker_version__: { get_param: docker_version }
620             __gerrit_branch__: { get_param: gerrit_branch }
621             __cloud_env__: { get_param: cloud_env }
622             __external_dns__: { get_param: external_dns }
623             __mso_repo__: { get_param: mso_repo }
624           template: |
625             #!/bin/bash
626
627             # Create configuration files
628             mkdir -p /opt/config
629             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
630             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
631             echo "__nexus_username__" > /opt/config/nexus_username.txt
632             echo "__nexus_password__" > /opt/config/nexus_password.txt
633             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
634             echo "__mso_ip_addr__" > /opt/config/local_ip_addr.txt
635             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
636             echo "__oam_network_cidr__" > /opt/config/oam_network_cidr.txt
637             echo "__dmaap_topic__" > /opt/config/dmaap_topic.txt
638             echo "__openstack_username__" > /opt/config/openstack_username.txt
639             echo "__openstack_tenant_id__" > /opt/config/tenant_id.txt
640             echo "__openstack_api_key__" > /opt/config/openstack_api_key.txt
641             echo "__openstack_region__" > /opt/config/openstack_region.txt
642             echo "__keystone_url__" > /opt/config/keystone.txt
643             echo "__docker_version__" > /opt/config/docker_version.txt
644             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
645             echo "__cloud_env__" > /opt/config/cloud_env.txt
646             echo "__external_dns__" > /opt/config/external_dns.txt
647             echo "__mso_repo__" > /opt/config/remote_repo.txt
648
649             # Download and run install script
650             curl -k __nexus_repo__/org.onap.demo/boot/__artifacts_version__/mso_install.sh -o /opt/mso_install.sh
651             cd /opt
652             chmod +x mso_install.sh
653             ./mso_install.sh
654
655
656   # Message Router instantiation
657   mrouter_private_port:
658     type: OS::Neutron::Port
659     properties:
660       network: { get_resource: oam_onap }
661       fixed_ips: [{"subnet": { get_resource: oam_onap_subnet }, "ip_address": { get_param: mr_ip_addr }}]
662
663   mrouter_vm:
664     type: OS::Nova::Server
665     properties:
666       image: { get_param: ubuntu_1404_image }
667       flavor: { get_param: flavor_large }
668       name:
669         str_replace: 
670           template: base-message-router
671           params:
672             base: { get_param: vm_base_name }
673       key_name: { get_resource: vm_key }
674       networks:
675         - network: { get_param: public_net_id }
676         - port: { get_resource: mrouter_private_port }
677       user_data_format: RAW
678       user_data:
679         str_replace:
680           params:
681             __nexus_repo__: { get_param: nexus_repo }
682             __nexus_docker_repo__: { get_param: nexus_docker_repo }
683             __nexus_username__: { get_param: nexus_username }
684             __nexus_password__: { get_param: nexus_password }
685             __artifacts_version__: { get_param: artifacts_version }
686             __mr_ip_addr__: { get_param: mr_ip_addr }
687             __dns_ip_addr__: { get_param: dns_ip_addr }
688             __oam_network_cidr__: { get_param: oam_network_cidr }
689             __gerrit_branch__: { get_param: gerrit_branch }
690             __cloud_env__: { get_param: cloud_env }
691             __external_dns__: { get_param: external_dns }
692             __mr_repo__: { get_param: mr_repo }
693           template: |
694             #!/bin/bash
695
696             # Create configuration files
697             mkdir -p /opt/config
698             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
699             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
700             echo "__nexus_username__" > /opt/config/nexus_username.txt
701             echo "__nexus_password__" > /opt/config/nexus_password.txt
702             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
703             echo "__mr_ip_addr__" > /opt/config/local_ip_addr.txt
704             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
705             echo "__oam_network_cidr__" > /opt/config/oam_network_cidr.txt
706             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
707             echo "__cloud_env__" > /opt/config/cloud_env.txt
708             echo "__external_dns__" > /opt/config/external_dns.txt
709             echo "__mr_repo__" > /opt/config/remote_repo.txt
710
711             # Download and run install script
712             curl -k __nexus_repo__/org.onap.demo/boot/__artifacts_version__/mr_install.sh -o /opt/mr_install.sh
713             cd /opt
714             chmod +x mr_install.sh
715             ./mr_install.sh
716
717
718   # Robot Framework instantiation
719   robot_private_port:
720     type: OS::Neutron::Port
721     properties:
722       network: { get_resource: oam_onap }
723       fixed_ips: [{"subnet": { get_resource: oam_onap_subnet }, "ip_address": { get_param: robot_ip_addr }}]
724  
725   robot_vm:
726     type: OS::Nova::Server
727     properties:
728       image: { get_param: ubuntu_1604_image }
729       flavor: { get_param: flavor_small }
730       name:
731         str_replace: 
732           template: base-robot
733           params:
734             base: { get_param: vm_base_name }
735       key_name: { get_resource: vm_key }
736       networks:
737         - network: { get_param: public_net_id }
738         - port: { get_resource: robot_private_port }
739       user_data_format: RAW
740       user_data:
741         str_replace:
742           params:
743             __nexus_repo__: { get_param: nexus_repo }
744             __nexus_docker_repo__: { get_param: nexus_docker_repo }
745             __nexus_username__: { get_param: nexus_username }
746             __nexus_password__: { get_param: nexus_password }
747             __network_name__: { get_attr: [oam_onap, name] }
748             __openstack_username__: { get_param: openstack_username }
749             __openstack_api_key__: { get_param : openstack_api_key }
750             __artifacts_version__: { get_param: artifacts_version }
751             __openstack_region__: { get_param: openstack_region }
752             __robot_ip_addr__: { get_param: robot_ip_addr }
753             __dns_ip_addr__: { get_param: dns_ip_addr }
754             __oam_network_cidr__: { get_param: oam_network_cidr }
755             __docker_version__: { get_param: docker_version }
756             __gerrit_branch__: { get_param: gerrit_branch }
757             __keystone_url__: { get_param: keystone_url }
758             __aai1_ip_addr__: { get_param: aai1_ip_addr }
759             __aai2_ip_addr__: { get_param: aai2_ip_addr }
760             __appc_ip_addr__: { get_param: appc_ip_addr }
761             __dcae_ip_addr__: { get_param: dcae_ip_addr }
762             __mso_ip_addr__: { get_param: mso_ip_addr }
763             __mr_ip_addr__: { get_param: mr_ip_addr }
764             __policy_ip_addr__: { get_param: policy_ip_addr }
765             __portal_ip_addr__: { get_param: portal_ip_addr }
766             __sdc_ip_addr__: { get_param: sdc_ip_addr }
767             __sdnc_ip_addr__: { get_param: sdnc_ip_addr }
768             __vid_ip_addr__: { get_param: vid_ip_addr }
769             __cloud_env__: { get_param: cloud_env }
770             __external_dns__: { get_param: external_dns }
771             __vm_image_name__: { get_param: ubuntu_1404_image }
772             __vm_flavor__: { get_param: flavor_medium }
773             __robot_repo__: { get_param: robot_repo }
774           template: |
775             #!/bin/bash
776
777             # Create configuration files
778             mkdir -p /opt/config
779             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
780             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
781             echo "__nexus_username__" > /opt/config/nexus_username.txt
782             echo "__nexus_password__" > /opt/config/nexus_password.txt
783             echo "__network_name__" > /opt/config/network.txt
784             echo "__openstack_username__" > /opt/config/openstack_username.txt
785             echo "__openstack_api_key__" > /opt/config/openstack_password.txt
786             echo "__openstack_region__" > /opt/config/region.txt
787             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
788             echo "__robot_ip_addr__" > /opt/config/local_ip_addr.txt
789             echo "__docker_version__" > /opt/config/docker_version.txt
790             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
791             echo "__oam_network_cidr__" > /opt/config/oam_network_cidr.txt
792             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
793             echo "__keystone_url__" > /opt/config/keystone.txt
794             echo "__aai1_ip_addr__" > /opt/config/aai1_ip_addr.txt
795             echo "__aai2_ip_addr__" > /opt/config/aai2_ip_addr.txt
796             echo "__appc_ip_addr__" > /opt/config/appc_ip_addr.txt
797             echo "__dcae_ip_addr__" > /opt/config/dcae_ip_addr.txt
798             echo "__mso_ip_addr__" > /opt/config/mso_ip_addr.txt
799             echo "__mr_ip_addr__" > /opt/config/mr_ip_addr.txt
800             echo "__policy_ip_addr__" > /opt/config/policy_ip_addr.txt
801             echo "__portal_ip_addr__" > /opt/config/portal_ip_addr.txt
802             echo "__sdc_ip_addr__" > /opt/config/sdc_ip_addr.txt
803             echo "__sdnc_ip_addr__" > /opt/config/sdnc_ip_addr.txt
804             echo "__vid_ip_addr__" > /opt/config/vid_ip_addr.txt
805             echo "__cloud_env__" > /opt/config/cloud_env.txt
806             echo "__external_dns__" > /opt/config/external_dns.txt
807             echo "__vm_image_name__" > /opt/config/vm_image_name.txt
808             echo "__vm_flavor__" > /opt/config/vm_flavor.txt
809             echo "__robot_repo__" > /opt/config/remote_repo.txt
810
811             # Download and run install script
812             curl -k __nexus_repo__/org.onap.demo/boot/__artifacts_version__/robot_install.sh -o /opt/robot_install.sh
813             cd /opt
814             chmod +x robot_install.sh
815             ./robot_install.sh
816
817
818   # VID instantiation
819   vid_private_port:
820     type: OS::Neutron::Port
821     properties:
822       network: { get_resource: oam_onap }
823       fixed_ips: [{"subnet": { get_resource: oam_onap_subnet }, "ip_address": { get_param: vid_ip_addr }}]
824
825   vid_vm:
826     type: OS::Nova::Server
827     properties:
828       image: { get_param: ubuntu_1404_image }
829       flavor: { get_param: flavor_medium }
830       name:
831         str_replace: 
832           template: base-vid
833           params:
834             base: { get_param: vm_base_name }
835       key_name: { get_resource: vm_key }
836       networks:
837         - network: { get_param: public_net_id }
838         - port: { get_resource: vid_private_port }
839       user_data_format: RAW
840       user_data:
841         str_replace:
842           params:
843             __nexus_repo__: { get_param: nexus_repo }
844             __nexus_docker_repo__: { get_param: nexus_docker_repo }
845             __nexus_username__: { get_param: nexus_username }
846             __nexus_password__: { get_param: nexus_password }
847             __artifacts_version__: { get_param: artifacts_version }
848             __vid_ip_addr__: { get_param: vid_ip_addr }
849             __dns_ip_addr__: { get_param: dns_ip_addr }
850             __oam_network_cidr__: { get_param: oam_network_cidr }
851             __docker_version__: { get_param: docker_version }
852             __gerrit_branch__: { get_param: gerrit_branch }
853             __cloud_env__: { get_param: cloud_env }
854             __external_dns__: { get_param: external_dns }
855             __vid_repo__: { get_param: vid_repo }
856           template: |
857             #!/bin/bash
858
859             # Create configuration files
860             mkdir -p /opt/config
861             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
862             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
863             echo "__nexus_username__" > /opt/config/nexus_username.txt
864             echo "__nexus_password__" > /opt/config/nexus_password.txt
865             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
866             echo "__vid_ip_addr__" > /opt/config/local_ip_addr.txt
867             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
868             echo "__oam_network_cidr__" > /opt/config/oam_network_cidr.txt
869             echo "__docker_version__" > /opt/config/docker_version.txt
870             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
871             echo "__cloud_env__" > /opt/config/cloud_env.txt
872             echo "__external_dns__" > /opt/config/external_dns.txt
873             echo "__vid_repo__" > /opt/config/remote_repo.txt
874
875             # Download and run install script
876             curl -k __nexus_repo__/org.onap.demo/boot/__artifacts_version__/vid_install.sh -o /opt/vid_install.sh
877             cd /opt
878             chmod +x vid_install.sh
879             ./vid_install.sh
880
881  
882   # SDN-C instantiation
883   sdnc_private_port:
884     type: OS::Neutron::Port
885     properties:
886       network: { get_resource: oam_onap }
887       fixed_ips: [{"subnet": { get_resource: oam_onap_subnet }, "ip_address": { get_param: sdnc_ip_addr }}]
888
889   sdnc_vm:
890     type: OS::Nova::Server
891     properties:
892       image: { get_param: ubuntu_1404_image }
893       flavor: { get_param: flavor_large }
894       name:
895         str_replace: 
896           template: base-sdnc
897           params:
898             base: { get_param: vm_base_name }
899       key_name: { get_resource: vm_key }
900       networks:
901         - network: { get_param: public_net_id }
902         - port: { get_resource: sdnc_private_port }
903       user_data_format: RAW
904       user_data:
905         str_replace:
906           params:
907             __nexus_repo__: { get_param: nexus_repo }
908             __nexus_docker_repo__: { get_param: nexus_docker_repo }
909             __nexus_username__: { get_param: nexus_username }
910             __nexus_password__: { get_param: nexus_password }
911             __artifacts_version__: { get_param: artifacts_version }
912             __sdnc_ip_addr__: { get_param: sdnc_ip_addr }
913             __dns_ip_addr__: { get_param: dns_ip_addr }
914             __oam_network_cidr__: { get_param: oam_network_cidr }
915             __docker_version__: { get_param: docker_version }
916             __gerrit_branch__: { get_param: gerrit_branch }
917             __cloud_env__: { get_param: cloud_env }
918             __external_dns__: { get_param: external_dns }
919             __sdnc_repo__: { get_param: sdnc_repo }
920           template: |
921             #!/bin/bash
922
923             # Create configuration files
924             mkdir -p /opt/config
925             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
926             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
927             echo "__nexus_username__" > /opt/config/nexus_username.txt
928             echo "__nexus_password__" > /opt/config/nexus_password.txt
929             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
930             echo "__sdnc_ip_addr__" > /opt/config/local_ip_addr.txt
931             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
932             echo "__oam_network_cidr__" > /opt/config/oam_network_cidr.txt
933             echo "__docker_version__" > /opt/config/docker_version.txt
934             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
935             echo "__cloud_env__" > /opt/config/cloud_env.txt
936             echo "__external_dns__" > /opt/config/external_dns.txt
937             echo "__sdnc_repo__" > /opt/config/remote_repo.txt
938
939             # Download and run install script
940             curl -k __nexus_repo__/org.onap.demo/boot/__artifacts_version__/sdnc_install.sh -o /opt/sdnc_install.sh
941             cd /opt
942             chmod +x sdnc_install.sh
943             ./sdnc_install.sh
944
945
946   # SDC instantiation
947   sdc_private_port:
948     type: OS::Neutron::Port
949     properties:
950       network: { get_resource: oam_onap }
951       fixed_ips: [{"subnet": { get_resource: oam_onap_subnet }, "ip_address": { get_param: sdc_ip_addr }}]
952
953   sdc_volume_data:
954     type: OS::Cinder::Volume
955     properties:
956       name: vol1-sdc-data
957       size: 100
958
959   sdc_vm:
960     type: OS::Nova::Server
961     properties:
962       image: { get_param: ubuntu_1604_image }
963       flavor: { get_param: flavor_xlarge }
964       name:
965         str_replace:
966           template: base-sdc
967           params:
968             base: { get_param: vm_base_name }
969       key_name: { get_resource: vm_key }
970       networks:
971         - network: { get_param: public_net_id }
972         - port: { get_resource: sdc_private_port }
973       block_device_mapping:
974         - device_name: /dev/vdb
975           volume_id: { get_resource: sdc_volume_data }
976       user_data_format: RAW
977       user_data:
978         str_replace:
979           params:
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             __sdc_ip_addr__: { get_param: sdc_ip_addr }
987             __dns_ip_addr__: { get_param: dns_ip_addr }
988             __oam_network_cidr__: { get_param: oam_network_cidr }
989             __mr_ip_addr__: { get_param: mr_ip_addr }
990             __docker_version__: { get_param: docker_version }
991             __gerrit_branch__: { get_param: gerrit_branch }
992             __cloud_env__: { get_param: cloud_env }
993             __external_dns__: { get_param: external_dns }
994             __sdc_repo__: { get_param: sdc_repo }
995           template: |
996             #!/bin/bash
997
998             # Create configuration files
999             mkdir -p /opt/config
1000             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
1001             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
1002             echo "__nexus_username__" > /opt/config/nexus_username.txt
1003             echo "__nexus_password__" > /opt/config/nexus_password.txt
1004             echo "__env_name__" > /opt/config/env_name.txt
1005             echo "__mr_ip_addr__" > /opt/config/mr_ip_addr.txt
1006             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
1007             echo "__sdc_ip_addr__" > /opt/config/local_ip_addr.txt
1008             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
1009             echo "__oam_network_cidr__" > /opt/config/oam_network_cidr.txt
1010             echo "__docker_version__" > /opt/config/docker_version.txt
1011             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
1012             echo "__cloud_env__" > /opt/config/cloud_env.txt
1013             echo "__external_dns__" > /opt/config/external_dns.txt
1014             echo "__sdc_repo__" > /opt/config/remote_repo.txt
1015
1016             # Download and run install script
1017             curl -k __nexus_repo__/org.onap.demo/boot/__artifacts_version__/asdc_install.sh -o /opt/asdc_install.sh
1018             cd /opt
1019             chmod +x asdc_install.sh
1020             ./asdc_install.sh
1021
1022
1023   # PORTAL instantiation
1024   portal_private_port:
1025     type: OS::Neutron::Port
1026     properties:
1027       network: { get_resource: oam_onap }
1028       fixed_ips: [{"subnet": { get_resource: oam_onap_subnet }, "ip_address": { get_param: portal_ip_addr }}]
1029
1030   portal_vm:
1031     type: OS::Nova::Server
1032     properties:
1033       image: { get_param: ubuntu_1404_image }
1034       flavor: { get_param: flavor_large }
1035       name:
1036         str_replace: 
1037           template: base-portal
1038           params:
1039             base: { get_param: vm_base_name }
1040       key_name: { get_resource: vm_key }
1041       networks:
1042         - network: { get_param: public_net_id }
1043         - port: { get_resource: portal_private_port }
1044       user_data_format: RAW
1045       user_data:
1046         str_replace:
1047           params:
1048             __nexus_repo__: { get_param: nexus_repo }
1049             __nexus_docker_repo__: { get_param: nexus_docker_repo }
1050             __nexus_username__: { get_param: nexus_username }
1051             __nexus_password__: { get_param: nexus_password }
1052             __artifacts_version__: { get_param: artifacts_version }
1053             __portal_ip_addr__: { get_param: portal_ip_addr }
1054             __dns_ip_addr__: { get_param: dns_ip_addr }
1055             __oam_network_cidr__: { get_param: oam_network_cidr }
1056             __docker_version__: { get_param: docker_version }
1057             __gerrit_branch__: { get_param: gerrit_branch }
1058             __cloud_env__: { get_param: cloud_env }
1059             __external_dns__: { get_param: external_dns }
1060             __portal_repo__: { get_param: portal_repo }
1061           template: |
1062             #!/bin/bash
1063
1064             # Create configuration files
1065             mkdir -p /opt/config
1066             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
1067             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
1068             echo "__nexus_username__" > /opt/config/nexus_username.txt
1069             echo "__nexus_password__" > /opt/config/nexus_password.txt
1070             echo "__oam_network_cidr__" > /opt/config/oam_network_cidr.txt
1071             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
1072             echo "__portal_ip_addr__" > /opt/config/local_ip_addr.txt
1073             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
1074             echo "__docker_version__" > /opt/config/docker_version.txt
1075             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
1076             echo "__cloud_env__" > /opt/config/cloud_env.txt
1077             echo "__external_dns__" > /opt/config/external_dns.txt
1078             echo "__portal_repo__" > /opt/config/remote_repo.txt
1079
1080             # Download and run install script
1081             curl -k __nexus_repo__/org.onap.demo/boot/__artifacts_version__/portal_install.sh -o /opt/portal_install.sh
1082             cd /opt
1083             chmod +x portal_install.sh
1084             ./portal_install.sh
1085
1086
1087   # DCAE Controller instantiation
1088   dcae_c_private_port:
1089     type: OS::Neutron::Port
1090     properties:
1091       network: { get_resource: oam_onap }
1092       fixed_ips: [{"subnet": { get_resource: oam_onap_subnet }, "ip_address": { get_param: dcae_ip_addr }}]
1093
1094   dcae_c_vm:
1095     type: OS::Nova::Server
1096     properties:
1097       image: { get_param: ubuntu_1404_image }
1098       flavor: { get_param: flavor_medium }
1099       name:
1100         str_replace: 
1101           template: base-dcae-controller
1102           params:
1103             base: { get_param: vm_base_name }
1104       key_name: { get_resource: vm_key }
1105       networks:
1106         - network: { get_param: public_net_id }
1107         - port: { get_resource: dcae_c_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             __nexus_url_snapshots__: { get_param: nexus_url_snapshot }
1117             __gitlab_branch__: { get_param: gitlab_branch }
1118             __dns_ip_addr__: { get_param: dns_ip_addr }
1119             __oam_network_cidr__: { get_param: oam_network_cidr }
1120             __dcae_zone__: { get_param: dcae_zone }
1121             __dcae_state__: { get_param: dcae_state }
1122             __artifacts_version__: { get_param: artifacts_version }
1123             __tenant_id__: { get_param: openstack_tenant_id }
1124             __openstack_private_network_name__: { get_attr: [oam_onap, name] }
1125             __openstack_user__: { get_param: openstack_username }
1126             __openstack_password__: { get_param: openstack_api_key }
1127             __openstack_auth_method__: { get_param: openstack_auth_method }
1128             __key_name__: { get_param: key_name }
1129             __rand_str__: { get_resource: random-str }
1130             __pub_key__: { get_param: pub_key }
1131             __nexus_repo_root__: { get_param: nexus_repo_root }
1132             __openstack_region__: { get_param: openstack_region }
1133             __horizon_url__: { get_param: horizon_url }
1134             __keystone_url__: { get_param: keystone_url }
1135             __docker_version__: { get_param: docker_version }
1136             __gerrit_branch__: { get_param: gerrit_branch }
1137             __dcae_code_version__: { get_param: dcae_code_version }
1138             __cloud_env__: { get_param: cloud_env }
1139             __public_net_id__: { get_param: public_net_id }
1140             __dcae_base_environment__: { get_param: dcae_base_environment }
1141             __dcae_ip_addr__: { get_param: dcae_ip_addr }
1142             __dcae_coll_ip_addr__: { get_param: dcae_coll_ip_addr }
1143             __dcae_db_ip_addr__: { get_param: dcae_db_ip_addr }
1144             __dcae_hdp1_ip_addr__: { get_param: dcae_hdp1_ip_addr }
1145             __dcae_hdp2_ip_addr__: { get_param: dcae_hdp2_ip_addr }
1146             __dcae_hdp3_ip_addr__: { get_param: dcae_hdp3_ip_addr }
1147             __external_dns__: { get_param: external_dns }
1148             __ubuntu_1404_image__: { get_param: ubuntu_1404_image }
1149             __ubuntu_1604_image__: { get_param: ubuntu_1604_image }
1150             __flavor_small__: { get_param: flavor_small }
1151             __flavor_medium__: { get_param: flavor_medium }
1152             __flavor_large__: { get_param: flavor_large }
1153             __flavor_xlarge__: { get_param: flavor_xlarge }
1154             __dcae_repo__: { get_param: dcae_repo }
1155             __mr_repo__: { get_param: mr_repo }
1156           template: |
1157             #!/bin/bash
1158
1159             # Create configuration files
1160             mkdir -p /opt/config
1161             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
1162             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
1163             echo "__nexus_username__" > /opt/config/nexus_username.txt
1164             echo "__nexus_password__" > /opt/config/nexus_password.txt
1165             echo "__nexus_url_snapshots__" > /opt/config/nexus_url_snapshots.txt
1166             echo "__gitlab_branch__" > /opt/config/gitlab_branch.txt
1167             echo "__docker_version__" > /opt/config/docker_version.txt
1168             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
1169             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
1170             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
1171             echo "__dcae_zone__" > /opt/config/dcae_zone.txt
1172             echo "__dcae_state__" > /opt/config/dcae_state.txt
1173             echo "__tenant_id__" > /opt/config/tenant_id.txt
1174             echo "__openstack_private_network_name__" > /opt/config/openstack_private_network_name.txt
1175             echo "__openstack_user__" > /opt/config/openstack_user.txt
1176             echo "__openstack_password__" > /opt/config/openstack_password.txt
1177             echo "__openstack_auth_method__" > /opt/config/openstack_auth_method.txt
1178             echo "__key_name__" > /opt/config/key_name.txt
1179             echo "__rand_str__" > /opt/config/rand_str.txt
1180             echo "__pub_key__" > /opt/config/pub_key.txt
1181             echo "__nexus_repo_root__" > /opt/config/nexus_repo_root.txt
1182             echo "__openstack_region__" > /opt/config/openstack_region.txt
1183             echo "__horizon_url__" > /opt/config/horizon_url.txt
1184             echo "__keystone_url__" > /opt/config/keystone_url.txt
1185             echo "__cloud_env__" > /opt/config/cloud_env.txt
1186             echo "__oam_network_cidr__" > /opt/config/oam_network_cidr.txt
1187             echo "__public_net_id__" > /opt/config/public_net_id.txt
1188             echo "__dcae_base_environment__" > /opt/config/dcae_base_environment.txt
1189             echo "__dcae_code_version__" > /opt/config/dcae_code_version.txt
1190             echo "__dcae_ip_addr__" > /opt/config/dcae_ip_addr.txt
1191             echo "__dcae_coll_ip_addr__" > /opt/config/dcae_coll_ip_addr.txt
1192             echo "__dcae_db_ip_addr__" > /opt/config/dcae_db_ip_addr.txt
1193             echo "__dcae_hdp1_ip_addr__" > /opt/config/dcae_hdp1_ip_addr.txt
1194             echo "__dcae_hdp2_ip_addr__" > /opt/config/dcae_hdp2_ip_addr.txt
1195             echo "__dcae_hdp3_ip_addr__" > /opt/config/dcae_hdp3_ip_addr.txt
1196             echo "__external_dns__" > /opt/config/external_dns.txt
1197             echo "__ubuntu_1404_image__" > /opt/config/ubuntu_1404_image.txt
1198             echo "__ubuntu_1604_image__" > /opt/config/ubuntu_1604_image.txt
1199             echo "__flavor_small__" > /opt/config/flavor_small.txt
1200             echo "__flavor_medium__" > /opt/config/flavor_medium.txt
1201             echo "__flavor_large__" > /opt/config/flavor_large.txt
1202             echo "__flavor_xlarge__" > /opt/config/flavor_xlarge.txt
1203             echo "__dcae_repo__" > /opt/config/remote_repo.txt
1204             echo "__mr_repo__" > /opt/config/mr_repo.txt
1205
1206             # Download and run install script
1207             curl -k __nexus_repo__/org.onap.demo/boot/__artifacts_version__/dcae_install.sh -o /opt/dcae_install.sh
1208             cd /opt
1209             chmod +x dcae_install.sh
1210             ./dcae_install.sh
1211
1212
1213   # Policy Engine instantiation
1214   policy_private_port:
1215     type: OS::Neutron::Port
1216     properties:
1217       network: { get_resource: oam_onap }
1218       fixed_ips: [{"subnet": { get_resource: oam_onap_subnet }, "ip_address": { get_param: policy_ip_addr }}]
1219
1220   policy_vm:
1221     type: OS::Nova::Server
1222     properties:
1223       image: { get_param: ubuntu_1404_image }
1224       flavor: { get_param: flavor_xlarge }
1225       name:
1226         str_replace: 
1227           template: base-policy
1228           params:
1229             base: { get_param: vm_base_name }
1230       key_name: { get_resource: vm_key }
1231       networks:
1232         - network: { get_param: public_net_id }
1233         - port: { get_resource: policy_private_port }
1234       user_data_format: RAW
1235       user_data:
1236         str_replace:
1237           params:
1238             __nexus_repo__: { get_param: nexus_repo }
1239             __nexus_docker_repo__: { get_param: nexus_docker_repo }
1240             __nexus_username__: { get_param: nexus_username }
1241             __nexus_password__: { get_param: nexus_password }
1242             __artifacts_version__: { get_param: artifacts_version }
1243             __policy_ip_addr__: { get_param: policy_ip_addr }
1244             __dns_ip_addr__: { get_param: dns_ip_addr }
1245             __oam_network_cidr__: { get_param: oam_network_cidr }
1246             __docker_version__: { get_param: docker_version }
1247             __gerrit_branch__: { get_param: gerrit_branch }
1248             __cloud_env__: { get_param: cloud_env }
1249             __external_dns__: { get_param: external_dns }
1250             __policy_repo__: { get_param: policy_repo }
1251           template: |
1252             #!/bin/bash
1253
1254             # Create configuration files
1255             mkdir -p /opt/config
1256             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
1257             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
1258             echo "__nexus_username__" > /opt/config/nexus_username.txt
1259             echo "__nexus_password__" > /opt/config/nexus_password.txt
1260             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
1261             echo "__policy_ip_addr__" > /opt/config/local_ip_addr.txt
1262             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
1263             echo "__oam_network_cidr__" > /opt/config/oam_network_cidr.txt
1264             echo "__docker_version__" > /opt/config/docker_version.txt
1265             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
1266             echo "__cloud_env__" > /opt/config/cloud_env.txt
1267             echo "__external_dns__" > /opt/config/external_dns.txt
1268             echo "__policy_repo__" > /opt/config/remote_repo.txt
1269
1270             # Download and run install script
1271             curl -k __nexus_repo__/org.onap.demo/boot/__artifacts_version__/policy_install.sh -o /opt/policy_install.sh
1272             cd /opt
1273             chmod +x policy_install.sh
1274             ./policy_install.sh
1275
1276
1277   # APP-C instantiation
1278   appc_private_port:
1279     type: OS::Neutron::Port
1280     properties:
1281       network: { get_resource: oam_onap }
1282       fixed_ips: [{"subnet": { get_resource: oam_onap_subnet }, "ip_address": { get_param: appc_ip_addr }}]
1283
1284   appc_vm:
1285     type: OS::Nova::Server
1286     properties:
1287       image: { get_param: ubuntu_1404_image }
1288       flavor: { get_param: flavor_large }
1289       name:
1290         str_replace: 
1291           template: base-appc
1292           params:
1293             base: { get_param: vm_base_name }
1294       key_name: { get_resource: vm_key }
1295       networks:
1296         - network: { get_param: public_net_id }
1297         - port: { get_resource: appc_private_port }
1298       user_data_format: RAW
1299       user_data:
1300         str_replace:
1301           params:
1302             __nexus_repo__: { get_param: nexus_repo }
1303             __nexus_docker_repo__: { get_param: nexus_docker_repo }
1304             __nexus_username__: { get_param: nexus_username }
1305             __nexus_password__: { get_param: nexus_password }
1306             __dmaap_topic__: { get_param: dmaap_topic }
1307             __artifacts_version__: { get_param: artifacts_version }
1308             __appc_ip_addr__: { get_param: appc_ip_addr }
1309             __dns_ip_addr__: { get_param: dns_ip_addr }
1310             __oam_network_cidr__: { get_param: oam_network_cidr }
1311             __docker_version__: { get_param: docker_version }
1312             __gerrit_branch__: { get_param: gerrit_branch }
1313             __cloud_env__: { get_param: cloud_env }
1314             __external_dns__: { get_param: external_dns }
1315             __appc_repo__: { get_param: appc_repo }
1316           template: |
1317             #!/bin/bash
1318
1319             # Create configuration files
1320             mkdir -p /opt/config
1321             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
1322             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
1323             echo "__nexus_username__" > /opt/config/nexus_username.txt
1324             echo "__nexus_password__" > /opt/config/nexus_password.txt
1325             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
1326             echo "__appc_ip_addr__" > /opt/config/local_ip_addr.txt
1327             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
1328             echo "__oam_network_cidr__" > /opt/config/oam_network_cidr.txt
1329             echo "__dmaap_topic__" > /opt/config/dmaap_topic.txt
1330             echo "__docker_version__" > /opt/config/docker_version.txt
1331             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
1332             echo "__cloud_env__" > /opt/config/cloud_env.txt
1333             echo "__external_dns__" > /opt/config/external_dns.txt
1334             echo "__appc_repo__" > /opt/config/remote_repo.txt
1335
1336             # Download and run install script
1337             curl -k __nexus_repo__/org.onap.demo/boot/__artifacts_version__/appc_install.sh -o /opt/appc_install.sh
1338             cd /opt
1339             chmod +x appc_install.sh
1340             ./appc_install.sh