Automatically Set Tenant In Robot VM
[demo.git] / heat / ONAP / onap_openstack.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: 2015-10-15
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   dns_list:
151     type: comma_delimited_list
152     description: List of External DNS for OAM ONAP network
153
154   external_dns:
155     type: string
156     description: First element of the dns_list for ONAP network
157
158   ### Private IP addresses ###
159   oam_network_cidr:
160     type: string
161     description: CIDR of the OAM ONAP network
162
163   aai1_ip_addr:
164     type: string
165     description: AAI Instance 1 IP Address
166
167   aai2_ip_addr:
168     type: string
169     description: AAI Instance 2 IP Address
170
171   appc_ip_addr:
172     type: string
173     description: APP-C IP Address
174
175   dcae_ip_addr:
176     type: string
177     description: DCAE IP Address
178  
179   dcae_coll_ip_addr:
180     type: string
181     description: DCAE Collector IP Address
182
183   dcae_db_ip_addr:
184     type: string
185     description: DCAE Database IP Address
186
187   dcae_hdp1_ip_addr:
188     type: string
189     description: Hadoop VM1 IP Address
190
191   dcae_hdp2_ip_addr:
192     type: string
193     description: Hadoop VM2 IP Address
194
195   dcae_hdp3_ip_addr:
196     type: string
197     description: Hadoop VM3 IP Address
198
199   dns_ip_addr:
200     type: string
201     description: DNS IP Address
202
203   mso_ip_addr:
204     type: string
205     description: MSO IP Address
206
207   mr_ip_addr:
208     type: string
209     description: Message Router IP Address
210
211   policy_ip_addr:
212     type: string
213     description: Policy Engine IP Address
214
215   portal_ip_addr:
216     type: string
217     description: Portal IP Address
218
219   robot_ip_addr:
220     type: string
221     description: Robot Framework IP Address
222
223   sdc_ip_addr:
224     type: string
225     description: SDC IP Address
226
227   sdnc_ip_addr:
228     type: string
229     description: SDN-C IP Address
230
231   vid_ip_addr:
232     type: string
233     description: VID IP Address
234
235   clamp_ip_addr:
236     type: string
237     description: CLAMP IP Address
238
239   dcae_coll_float_ip:
240     type: string
241     description: DCAE Collector Floating IP Address
242
243   dcae_db_float_ip:
244     type: string
245     description: DCAE Collector Database Floating IP Address
246
247   dcae_hdp1_float_ip:
248     type: string
249     description: Hadoop VM1 Floating IP Address
250
251   dcae_hdp2_float_ip:
252     type: string
253     description: Hadoop VM2 Floating IP Address
254
255   dcae_hdp3_float_ip:
256     type: string
257     description: Hadoop VM3 Floating IP Address
258
259   ###########################
260   #                         #
261   # Parameters used by DCAE #
262   #                         #
263   ###########################
264
265   dcae_base_environment:
266     type: string
267     description: DCAE Base Environment configuration (RACKSPACE/2-NIC/1-NIC-FLOATING-IPS)
268
269   dcae_zone:
270     type: string
271     description: DCAE Zone to use in VM names created by DCAE controller
272
273   dcae_state:
274     type: string
275     description: DCAE State to use in VM names created by DCAE controller
276
277   nexus_repo_root:
278     type: string
279     description: Root URL of Nexus repository
280
281   nexus_url_snapshot:
282     type: string
283     description: Snapshot of Maven repository for DCAE deployment
284
285   openstack_region:
286     type: string
287     description: Region where the DCAE controller will spin the VMs
288
289   gitlab_branch:
290     type: string
291     description: Branch of the Gitlab repository
292     
293   dcae_code_version:
294     type: string
295     description: DCAE Code Version Number
296
297   #####################
298   #                   #
299   # ONAP repositories #
300   #                   #
301   #####################
302
303   aai_repo:
304     type: string
305     description: AAI repository
306
307   appc_repo:
308     type: string
309     description: APPC repository
310
311   dcae_repo:
312     type: string
313     description: DCAE repository
314
315   mr_repo:
316     type: string
317     description: Message Router repository
318
319   mso_repo:
320     type: string
321     description: MSO repository
322
323   policy_repo:
324     type: string
325     description: Policy repository
326
327   portal_repo:
328     type: string
329     description: Portal repository
330
331   robot_repo:
332     type: string
333     description: Robot repository
334
335   sdc_repo:
336     type: string
337     description: SDC repository
338
339   sdnc_repo:
340     type: string
341     description: SDNC repository
342
343   vid_repo:
344     type: string
345     description: VID repository
346
347   clamp_repo:
348     type: string
349     description: CLAMP repository
350
351
352 #############
353 #           #
354 # RESOURCES #
355 #           #
356 #############
357
358 resources:
359   random-str:
360     type: OS::Heat::RandomString
361     properties:
362       length: 4
363
364
365   # Public key used to access ONAP components
366   vm_key:
367     type: OS::Nova::KeyPair
368     properties:
369       name:
370         str_replace:
371           template: base_rand
372           params:
373             base: { get_param: key_name }
374             rand: { get_resource: random-str }
375       public_key: { get_param: pub_key }
376       save_private_key: false
377
378
379   # ONAP management private network
380   oam_onap:
381     type: OS::Neutron::Net
382     properties:
383       name:
384         str_replace:
385           template: oam_onap_rand
386           params:
387             rand: { get_resource: random-str }
388
389   oam_onap_subnet:
390     type: OS::Neutron::Subnet
391     properties:
392       name:
393         str_replace:
394           template: oam_onap_rand
395           params:
396             rand: { get_resource: random-str }
397       network_id: { get_resource: oam_onap }
398       cidr: { get_param: oam_network_cidr }
399       dns_nameservers: { get_param: dns_list }
400
401   router:
402     type: OS::Neutron::Router
403     properties:
404       external_gateway_info:
405         network: { get_param: public_net_id }
406
407   router_interface:
408     type: OS::Neutron::RouterInterface
409     properties:
410       router_id: { get_resource: router }
411       subnet_id: { get_resource: oam_onap_subnet }
412
413
414   # DNS Server instantiation
415   dns_private_port:
416     type: OS::Neutron::Port
417     properties:
418       network: { get_resource: oam_onap }
419       fixed_ips: [{"subnet": { get_resource: oam_onap_subnet }, "ip_address": { get_param: dns_ip_addr }}]
420
421   dns_floating_ip:
422     type: OS::Neutron::FloatingIP
423     properties:
424       floating_network_id: { get_param: public_net_id }
425       port_id: { get_resource: dns_private_port }
426
427   dns_vm:
428     type: OS::Nova::Server
429     properties:
430       image: { get_param: ubuntu_1404_image }
431       flavor: { get_param: flavor_small }
432       name:
433         str_replace:
434           template: base-dns-server
435           params:
436             base: { get_param: vm_base_name }
437       key_name: { get_resource: vm_key }
438       networks:
439         - port: { get_resource: dns_private_port }
440       user_data_format: RAW
441       user_data:
442         str_replace:
443           params:
444             __nexus_repo__: { get_param: nexus_repo }
445             __artifacts_version__: { get_param: artifacts_version }
446             __oam_network_cidr__: { get_attr: [oam_onap_subnet, cidr] }
447             __dns_ip_addr__: { get_param: dns_ip_addr }
448             __aai1_ip_addr__: { get_param: aai1_ip_addr }
449             __aai2_ip_addr__: { get_param: aai2_ip_addr }
450             __appc_ip_addr__: { get_param: appc_ip_addr }
451             __dcae_ip_addr__: { get_param: dcae_ip_addr }
452             __dcae_coll_ip_addr__: { get_param: dcae_coll_ip_addr }
453             __mso_ip_addr__: { get_param: mso_ip_addr }
454             __mr_ip_addr__: { get_param: mr_ip_addr }
455             __policy_ip_addr__: { get_param: policy_ip_addr }
456             __portal_ip_addr__: { get_param: portal_ip_addr }
457             __robot_ip_addr__: { get_param: robot_ip_addr }
458             __sdc_ip_addr__: { get_param: sdc_ip_addr }
459             __sdnc_ip_addr__: { get_param: sdnc_ip_addr }
460             __vid_ip_addr__: { get_param: vid_ip_addr }
461             __clamp_ip_addr__: { get_param: clamp_ip_addr }
462             __cloud_env__: { get_param: cloud_env }
463             __external_dns__: { get_param: external_dns }
464           template: |
465             #!/bin/bash
466
467             # Create configuration files
468             mkdir -p /opt/config
469             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
470             echo "__cloud_env__" > /opt/config/cloud_env.txt
471             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
472             echo "__oam_network_cidr__" > /opt/config/oam_network_cidr.txt
473             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
474             echo "__aai1_ip_addr__" > /opt/config/aai1_ip_addr.txt
475             echo "__aai2_ip_addr__" > /opt/config/aai2_ip_addr.txt
476             echo "__appc_ip_addr__" > /opt/config/appc_ip_addr.txt
477             echo "__dcae_ip_addr__" > /opt/config/dcae_ip_addr.txt
478             echo "__dcae_coll_ip_addr__" > /opt/config/dcae_coll_ip_addr.txt
479             echo "__mso_ip_addr__" > /opt/config/mso_ip_addr.txt
480             echo "__mr_ip_addr__" > /opt/config/mr_ip_addr.txt
481             echo "__policy_ip_addr__" > /opt/config/policy_ip_addr.txt
482             echo "__portal_ip_addr__" > /opt/config/portal_ip_addr.txt
483             echo "__robot_ip_addr__" > /opt/config/robot_ip_addr.txt
484             echo "__sdc_ip_addr__" > /opt/config/sdc_ip_addr.txt
485             echo "__sdnc_ip_addr__" > /opt/config/sdnc_ip_addr.txt
486             echo "__vid_ip_addr__" > /opt/config/vid_ip_addr.txt
487             echo "__clamp_ip_addr__" > /opt/config/clamp_ip_addr.txt
488             echo "__external_dns__" > /opt/config/external_dns.txt
489
490             # Download and run install script
491             curl -k __nexus_repo__/org.onap.demo/boot/__artifacts_version__/dns_install.sh -o /opt/dns_install.sh
492             cd /opt
493             chmod +x dns_install.sh
494             ./dns_install.sh
495
496
497   # A&AI instantiation (2 VMs)
498   aai1_private_port:
499     type: OS::Neutron::Port
500     properties:
501       network: { get_resource: oam_onap }
502       fixed_ips: [{"subnet": { get_resource: oam_onap_subnet }, "ip_address": { get_param: aai1_ip_addr }}]
503
504   aai1_floating_ip:
505     type: OS::Neutron::FloatingIP
506     properties:
507       floating_network_id: { get_param: public_net_id }
508       port_id: { get_resource: aai1_private_port }
509
510   aai1_vm:
511     type: OS::Nova::Server
512     depends_on: aai2_vm
513     properties:
514       image: { get_param: ubuntu_1404_image }
515       flavor: { get_param: flavor_xlarge }
516       name:
517         str_replace:
518           template: base-aai-inst1
519           params:
520             base: { get_param: vm_base_name }      
521       key_name: { get_resource: vm_key }
522       networks:
523         - port: { get_resource: aai1_private_port }
524       user_data_format: RAW
525       user_data:
526         str_replace:
527           params:
528             __nexus_repo__: { get_param: nexus_repo }
529             __nexus_docker_repo__: { get_param: nexus_docker_repo }
530             __nexus_username__: { get_param: nexus_username }
531             __nexus_password__: { get_param: nexus_password }
532             __dmaap_topic__: { get_param: dmaap_topic }
533             __artifacts_version__: { get_param: artifacts_version }
534             __dns_ip_addr__: { get_param: dns_ip_addr }
535             __docker_version__: { get_param: docker_version }
536             __gerrit_branch__: { get_param: gerrit_branch }
537             __cloud_env__: { get_param: cloud_env }
538             __external_dns__: { get_param: external_dns }
539             __aai_repo__: { get_param: aai_repo }
540           template: |
541             #!/bin/bash
542
543             # Create configuration files
544             mkdir -p /opt/config
545             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
546             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
547             echo "__nexus_username__" > /opt/config/nexus_username.txt
548             echo "__nexus_password__" > /opt/config/nexus_password.txt
549             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
550             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
551             echo "__dmaap_topic__" > /opt/config/dmaap_topic.txt
552             echo "__docker_version__" > /opt/config/docker_version.txt
553             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
554             echo "aai_instance_1" > /opt/config/aai_instance.txt
555             echo "__cloud_env__" > /opt/config/cloud_env.txt
556             echo "__external_dns__" > /opt/config/external_dns.txt
557             echo "__aai_repo__" > /opt/config/remote_repo.txt
558
559             # Download and run install script
560             curl -k __nexus_repo__/org.onap.demo/boot/__artifacts_version__/aai_install.sh -o /opt/aai_install.sh
561             cd /opt
562             chmod +x aai_install.sh
563             ./aai_install.sh
564
565
566   aai2_private_port:
567     type: OS::Neutron::Port
568     properties:
569       network: { get_resource: oam_onap }
570       fixed_ips: [{"subnet": { get_resource: oam_onap_subnet }, "ip_address": { get_param: aai2_ip_addr }}]
571
572   aai2_floating_ip:
573     type: OS::Neutron::FloatingIP
574     properties:
575       floating_network_id: { get_param: public_net_id }
576       port_id: { get_resource: aai2_private_port }
577
578   aai2_vm:
579     type: OS::Nova::Server
580     properties:
581       image: { get_param: ubuntu_1404_image }
582       flavor: { get_param: flavor_xlarge }
583       name:
584         str_replace:
585           template: base-aai-inst2
586           params:
587             base: { get_param: vm_base_name }      
588       key_name: { get_resource: vm_key }
589       networks:
590         - port: { get_resource: aai2_private_port }
591       user_data_format: RAW
592       user_data:
593         str_replace:
594           params:
595             __nexus_repo__: { get_param: nexus_repo }
596             __nexus_docker_repo__: { get_param: nexus_docker_repo }
597             __nexus_username__: { get_param: nexus_username }
598             __nexus_password__: { get_param: nexus_password }
599             __dmaap_topic__: { get_param: dmaap_topic }
600             __artifacts_version__: { get_param: artifacts_version }
601             __dns_ip_addr__: { get_param: dns_ip_addr }
602             __docker_version__: { get_param: docker_version }
603             __gerrit_branch__: { get_param: gerrit_branch }
604             __cloud_env__: { get_param: cloud_env }
605             __external_dns__: { get_param: external_dns }
606             __aai_repo__: { get_param: aai_repo }
607           template: |
608             #!/bin/bash
609
610             # Create configuration files
611             mkdir -p /opt/config
612             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
613             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
614             echo "__nexus_username__" > /opt/config/nexus_username.txt
615             echo "__nexus_password__" > /opt/config/nexus_password.txt
616             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
617             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
618             echo "__dmaap_topic__" > /opt/config/dmaap_topic.txt
619             echo "__docker_version__" > /opt/config/docker_version.txt
620             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
621             echo "aai_instance_2" > /opt/config/aai_instance.txt
622             echo "__cloud_env__" > /opt/config/cloud_env.txt
623             echo "__external_dns__" > /opt/config/external_dns.txt
624             echo "__aai_repo__" > /opt/config/remote_repo.txt
625
626             # Download and run install script
627             curl -k __nexus_repo__/org.onap.demo/boot/__artifacts_version__/aai_install.sh -o /opt/aai_install.sh
628             cd /opt
629             chmod +x aai_install.sh
630             ./aai_install.sh
631
632
633   # MSO instantiation
634   mso_private_port:
635     type: OS::Neutron::Port
636     properties:
637       network: { get_resource: oam_onap }
638       fixed_ips: [{"subnet": { get_resource: oam_onap_subnet }, "ip_address": { get_param: mso_ip_addr }}]
639
640   mso_floating_ip:
641     type: OS::Neutron::FloatingIP
642     properties:
643       floating_network_id: { get_param: public_net_id }
644       port_id: { get_resource: mso_private_port }
645
646   mso_vm:
647     type: OS::Nova::Server
648     properties:
649       image: { get_param: ubuntu_1604_image }
650       flavor: { get_param: flavor_large }
651       name:
652         str_replace:
653           template: base-mso
654           params:
655             base: { get_param: vm_base_name }      
656       key_name: { get_resource: vm_key }
657       networks:
658         - port: { get_resource: mso_private_port }
659       user_data_format: RAW
660       user_data:
661         str_replace:
662           params:
663             __nexus_repo__: { get_param: nexus_repo }
664             __nexus_docker_repo__: { get_param: nexus_docker_repo }
665             __nexus_username__: { get_param: nexus_username }
666             __nexus_password__: { get_param: nexus_password }
667             __openstack_username__: { get_param: openstack_username }
668             __openstack_tenant_id__: { get_param: openstack_tenant_id }
669             __openstack_api_key__: { get_param: openstack_api_key }
670             __openstack_region__: { get_param: openstack_region }
671             __keystone_url__: { get_param: keystone_url }
672             __dmaap_topic__: { get_param: dmaap_topic }
673             __artifacts_version__: { get_param: artifacts_version }
674             __dns_ip_addr__: { get_param: dns_ip_addr }
675             __docker_version__: { get_param: docker_version }
676             __gerrit_branch__: { get_param: gerrit_branch }
677             __cloud_env__: { get_param: cloud_env }
678             __external_dns__: { get_param: external_dns }
679             __mso_repo__: { get_param: mso_repo }
680           template: |
681             #!/bin/bash
682
683             # Create configuration files
684             mkdir -p /opt/config
685             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
686             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
687             echo "__nexus_username__" > /opt/config/nexus_username.txt
688             echo "__nexus_password__" > /opt/config/nexus_password.txt
689             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
690             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
691             echo "__dmaap_topic__" > /opt/config/dmaap_topic.txt
692             echo "__openstack_username__" > /opt/config/openstack_username.txt
693             echo "__openstack_tenant_id__" > /opt/config/tenant_id.txt
694             echo "__openstack_api_key__" > /opt/config/openstack_api_key.txt
695             echo "__openstack_region__" > /opt/config/openstack_region.txt
696             echo "__keystone_url__" > /opt/config/keystone.txt
697             echo "__docker_version__" > /opt/config/docker_version.txt
698             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
699             echo "__cloud_env__" > /opt/config/cloud_env.txt
700             echo "__external_dns__" > /opt/config/external_dns.txt
701             echo "__mso_repo__" > /opt/config/remote_repo.txt
702
703             # Download and run install script
704             curl -k __nexus_repo__/org.onap.demo/boot/__artifacts_version__/mso_install.sh -o /opt/mso_install.sh
705             cd /opt
706             chmod +x mso_install.sh
707             ./mso_install.sh
708
709
710   # Message Router instantiation
711   mrouter_private_port:
712     type: OS::Neutron::Port
713     properties:
714       network: { get_resource: oam_onap }
715       fixed_ips: [{"subnet": { get_resource: oam_onap_subnet }, "ip_address": { get_param: mr_ip_addr }}]
716
717   mrouter_floating_ip:
718     type: OS::Neutron::FloatingIP
719     properties:
720       floating_network_id: { get_param: public_net_id }
721       port_id: { get_resource: mrouter_private_port }
722
723   mrouter_vm:
724     type: OS::Nova::Server
725     properties:
726       image: { get_param: ubuntu_1404_image }
727       flavor: { get_param: flavor_large }
728       name:
729         str_replace: 
730           template: base-message-router
731           params:
732             base: { get_param: vm_base_name }
733       key_name: { get_resource: vm_key }
734       networks:
735         - port: { get_resource: mrouter_private_port }
736       user_data_format: RAW
737       user_data:
738         str_replace:
739           params:
740             __nexus_repo__: { get_param: nexus_repo }
741             __nexus_docker_repo__: { get_param: nexus_docker_repo }
742             __nexus_username__: { get_param: nexus_username }
743             __nexus_password__: { get_param: nexus_password }
744             __artifacts_version__: { get_param: artifacts_version }
745             __dns_ip_addr__: { get_param: dns_ip_addr }
746             __gerrit_branch__: { get_param: gerrit_branch }
747             __cloud_env__: { get_param: cloud_env }
748             __external_dns__: { get_param: external_dns }
749             __mr_repo__: { get_param: mr_repo }
750           template: |
751             #!/bin/bash
752
753             # Create configuration files
754             mkdir -p /opt/config
755             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
756             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
757             echo "__nexus_username__" > /opt/config/nexus_username.txt
758             echo "__nexus_password__" > /opt/config/nexus_password.txt
759             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
760             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
761             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
762             echo "__cloud_env__" > /opt/config/cloud_env.txt
763             echo "__external_dns__" > /opt/config/external_dns.txt
764             echo "__mr_repo__" > /opt/config/remote_repo.txt
765
766             # Download and run install script
767             curl -k __nexus_repo__/org.onap.demo/boot/__artifacts_version__/mr_install.sh -o /opt/mr_install.sh
768             cd /opt
769             chmod +x mr_install.sh
770             ./mr_install.sh
771
772
773   # Robot Framework instantiation
774   robot_private_port:
775     type: OS::Neutron::Port
776     properties:
777       network: { get_resource: oam_onap }
778       fixed_ips: [{"subnet": { get_resource: oam_onap_subnet }, "ip_address": { get_param: robot_ip_addr }}]
779
780   robot_floating_ip:
781     type: OS::Neutron::FloatingIP
782     properties:
783       floating_network_id: { get_param: public_net_id }
784       port_id: { get_resource: robot_private_port }
785  
786   robot_vm:
787     type: OS::Nova::Server
788     properties:
789       image: { get_param: ubuntu_1604_image }
790       flavor: { get_param: flavor_small }
791       name:
792         str_replace: 
793           template: base-robot
794           params:
795             base: { get_param: vm_base_name }
796       key_name: { get_resource: vm_key }
797       networks:
798         - port: { get_resource: robot_private_port }
799       user_data_format: RAW
800       user_data:
801         str_replace:
802           params:
803             __nexus_repo__: { get_param: nexus_repo }
804             __nexus_docker_repo__: { get_param: nexus_docker_repo }
805             __nexus_username__: { get_param: nexus_username }
806             __nexus_password__: { get_param: nexus_password }
807             __network_name__: { get_attr: [oam_onap, name] }
808             __openstack_username__: { get_param: openstack_username }
809             __openstack_api_key__: { get_param : openstack_api_key }
810             __openstack_tenant_id__: { get_param: openstack_tenant_id }
811             __artifacts_version__: { get_param: artifacts_version }
812             __openstack_region__: { get_param: openstack_region }
813             __dns_ip_addr__: { get_param: dns_ip_addr }
814             __docker_version__: { get_param: docker_version }
815             __gerrit_branch__: { get_param: gerrit_branch }
816             __cloud_env__: { get_param: cloud_env }
817             __keystone_url__: { get_param: keystone_url }
818             __aai1_ip_addr__: { get_param: aai1_ip_addr }
819             __aai2_ip_addr__: { get_param: aai2_ip_addr }
820             __appc_ip_addr__: { get_param: appc_ip_addr }
821             __dcae_ip_addr__: { get_param: dcae_ip_addr }
822             __mso_ip_addr__: { get_param: mso_ip_addr }
823             __mr_ip_addr__: { get_param: mr_ip_addr }
824             __policy_ip_addr__: { get_param: policy_ip_addr }
825             __portal_ip_addr__: { get_param: portal_ip_addr }
826             __sdc_ip_addr__: { get_param: sdc_ip_addr }
827             __sdnc_ip_addr__: { get_param: sdnc_ip_addr }
828             __vid_ip_addr__: { get_param: vid_ip_addr }
829             __external_dns__: { get_param: external_dns }
830             __vm_image_name__: { get_param: ubuntu_1404_image }
831             __vm_flavor__: { get_param: flavor_medium }
832             __robot_repo__: { get_param: robot_repo }
833           template: |
834             #!/bin/bash
835
836             # Create configuration files
837             mkdir -p /opt/config
838             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
839             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
840             echo "__nexus_username__" > /opt/config/nexus_username.txt
841             echo "__nexus_password__" > /opt/config/nexus_password.txt
842             echo "__network_name__" > /opt/config/network.txt
843             echo "__openstack_username__" > /opt/config/openstack_username.txt
844             echo "__openstack_api_key__" > /opt/config/openstack_password.txt
845             echo "__openstack_tenant_id__" > /opt/config/openstack_tenant_id.txt
846             echo "__openstack_region__" > /opt/config/region.txt
847             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
848             echo "__docker_version__" > /opt/config/docker_version.txt
849             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
850             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
851             echo "__keystone_url__" > /opt/config/keystone.txt
852             echo "__aai1_ip_addr__" > /opt/config/aai1_ip_addr.txt
853             echo "__aai2_ip_addr__" > /opt/config/aai2_ip_addr.txt
854             echo "__appc_ip_addr__" > /opt/config/appc_ip_addr.txt
855             echo "__dcae_ip_addr__" > /opt/config/dcae_ip_addr.txt
856             echo "__mso_ip_addr__" > /opt/config/mso_ip_addr.txt
857             echo "__mr_ip_addr__" > /opt/config/mr_ip_addr.txt
858             echo "__policy_ip_addr__" > /opt/config/policy_ip_addr.txt
859             echo "__portal_ip_addr__" > /opt/config/portal_ip_addr.txt
860             echo "__sdc_ip_addr__" > /opt/config/sdc_ip_addr.txt
861             echo "__sdnc_ip_addr__" > /opt/config/sdnc_ip_addr.txt
862             echo "__vid_ip_addr__" > /opt/config/vid_ip_addr.txt
863             echo "__cloud_env__" > /opt/config/cloud_env.txt
864             echo "__external_dns__" > /opt/config/external_dns.txt
865             echo "__vm_image_name__" > /opt/config/vm_image_name.txt
866             echo "__vm_flavor__" > /opt/config/vm_flavor.txt
867             echo "__robot_repo__" > /opt/config/remote_repo.txt
868
869             # Download and run install script
870             curl -k __nexus_repo__/org.onap.demo/boot/__artifacts_version__/robot_install.sh -o /opt/robot_install.sh
871             cd /opt
872             chmod +x robot_install.sh
873             ./robot_install.sh
874
875
876   # VID instantiation
877   vid_private_port:
878     type: OS::Neutron::Port
879     properties:
880       network: { get_resource: oam_onap }
881       fixed_ips: [{"subnet": { get_resource: oam_onap_subnet }, "ip_address": { get_param: vid_ip_addr }}]
882
883   vid_floating_ip:
884     type: OS::Neutron::FloatingIP
885     properties:
886       floating_network_id: { get_param: public_net_id }
887       port_id: { get_resource: vid_private_port }
888
889   vid_vm:
890     type: OS::Nova::Server
891     properties:
892       image: { get_param: ubuntu_1404_image }
893       flavor: { get_param: flavor_medium }
894       name:
895         str_replace: 
896           template: base-vid
897           params:
898             base: { get_param: vm_base_name }
899       key_name: { get_resource: vm_key }
900       networks:
901         - port: { get_resource: vid_private_port }
902       user_data_format: RAW
903       user_data:
904         str_replace:
905           params:
906             __nexus_repo__: { get_param: nexus_repo }
907             __nexus_docker_repo__: { get_param: nexus_docker_repo }
908             __nexus_username__: { get_param: nexus_username }
909             __nexus_password__: { get_param: nexus_password }
910             __artifacts_version__: { get_param: artifacts_version }
911             __dns_ip_addr__: { get_param: dns_ip_addr }
912             __docker_version__: { get_param: docker_version }
913             __gerrit_branch__: { get_param: gerrit_branch }
914             __cloud_env__: { get_param: cloud_env }
915             __external_dns__: { get_param: external_dns }
916             __vid_repo__: { get_param: vid_repo }
917           template: |
918             #!/bin/bash
919
920             # Create configuration files
921             mkdir -p /opt/config
922             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
923             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
924             echo "__nexus_username__" > /opt/config/nexus_username.txt
925             echo "__nexus_password__" > /opt/config/nexus_password.txt
926             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
927             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
928             echo "__docker_version__" > /opt/config/docker_version.txt
929             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
930             echo "__cloud_env__" > /opt/config/cloud_env.txt
931             echo "__external_dns__" > /opt/config/external_dns.txt
932             echo "__vid_repo__" > /opt/config/remote_repo.txt
933
934             # Download and run install script
935             curl -k __nexus_repo__/org.onap.demo/boot/__artifacts_version__/vid_install.sh -o /opt/vid_install.sh
936             cd /opt
937             chmod +x vid_install.sh
938             ./vid_install.sh
939
940  
941   # SDN-C instantiation
942   sdnc_private_port:
943     type: OS::Neutron::Port
944     properties:
945       network: { get_resource: oam_onap }
946       fixed_ips: [{"subnet": { get_resource: oam_onap_subnet }, "ip_address": { get_param: sdnc_ip_addr }}]
947
948   sdnc_floating_ip:
949     type: OS::Neutron::FloatingIP
950     properties:
951       floating_network_id: { get_param: public_net_id }
952       port_id: { get_resource: sdnc_private_port }
953
954   sdnc_vm:
955     type: OS::Nova::Server
956     properties:
957       image: { get_param: ubuntu_1404_image }
958       flavor: { get_param: flavor_large }
959       name:
960         str_replace: 
961           template: base-sdnc
962           params:
963             base: { get_param: vm_base_name }
964       key_name: { get_resource: vm_key }
965       networks:
966         - port: { get_resource: sdnc_private_port }
967       user_data_format: RAW
968       user_data:
969         str_replace:
970           params:
971             __nexus_repo__: { get_param: nexus_repo }
972             __nexus_docker_repo__: { get_param: nexus_docker_repo }
973             __nexus_username__: { get_param: nexus_username }
974             __nexus_password__: { get_param: nexus_password }
975             __artifacts_version__: { get_param: artifacts_version }
976             __dns_ip_addr__: { get_param: dns_ip_addr }
977             __docker_version__: { get_param: docker_version }
978             __gerrit_branch__: { get_param: gerrit_branch }
979             __cloud_env__: { get_param: cloud_env }
980             __external_dns__: { get_param: external_dns }
981             __sdnc_repo__: { get_param: sdnc_repo }
982           template: |
983             #!/bin/bash
984
985             # Create configuration files
986             mkdir -p /opt/config
987             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
988             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
989             echo "__nexus_username__" > /opt/config/nexus_username.txt
990             echo "__nexus_password__" > /opt/config/nexus_password.txt
991             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
992             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
993             echo "__docker_version__" > /opt/config/docker_version.txt
994             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
995             echo "__cloud_env__" > /opt/config/cloud_env.txt
996             echo "__external_dns__" > /opt/config/external_dns.txt
997             echo "__sdnc_repo__" > /opt/config/remote_repo.txt
998
999             # Download and run install script
1000             curl -k __nexus_repo__/org.onap.demo/boot/__artifacts_version__/sdnc_install.sh -o /opt/sdnc_install.sh
1001             cd /opt
1002             chmod +x sdnc_install.sh
1003             ./sdnc_install.sh
1004
1005
1006   # SDC instantiation
1007   sdc_private_port:
1008     type: OS::Neutron::Port
1009     properties:
1010       network: { get_resource: oam_onap }
1011       fixed_ips: [{"subnet": { get_resource: oam_onap_subnet }, "ip_address": { get_param: sdc_ip_addr }}]
1012
1013   sdc_floating_ip:
1014     type: OS::Neutron::FloatingIP
1015     properties:
1016       floating_network_id: { get_param: public_net_id }
1017       port_id: { get_resource: sdc_private_port }
1018
1019   sdc_volume_data:
1020     type: OS::Cinder::Volume
1021     properties:
1022       name: vol1-sdc-data
1023       size: 100
1024
1025   sdc_vm:
1026     type: OS::Nova::Server
1027     properties:
1028       image: { get_param: ubuntu_1604_image }
1029       flavor: { get_param: flavor_xlarge }
1030       name:
1031         str_replace: 
1032           template: base-sdc
1033           params:
1034             base: { get_param: vm_base_name }
1035       key_name: { get_resource: vm_key }
1036       networks:
1037         - port: { get_resource: sdc_private_port }
1038       block_device_mapping:
1039         - device_name: /dev/vdb
1040           volume_id: {get_resource: sdc_volume_data}
1041       user_data_format: RAW
1042       user_data:
1043         str_replace:
1044           params:
1045             __nexus_repo__: { get_param: nexus_repo }
1046             __nexus_docker_repo__: { get_param: nexus_docker_repo }
1047             __nexus_username__: { get_param: nexus_username }
1048             __nexus_password__: { get_param: nexus_password }
1049             __env_name__: { get_param: dmaap_topic }
1050             __artifacts_version__: { get_param: artifacts_version }
1051             __dns_ip_addr__: { get_param: dns_ip_addr }
1052             __mr_ip_addr__: { get_param: mr_ip_addr }
1053             __public_ip__: { get_attr: [sdc_floating_ip, floating_ip_address] }
1054             __docker_version__: { get_param: docker_version }
1055             __gerrit_branch__: { get_param: gerrit_branch }
1056             __cloud_env__: { get_param: cloud_env }
1057             __external_dns__: { get_param: external_dns }
1058             __sdc_repo__: { get_param: sdc_repo }
1059           template: |
1060             #!/bin/bash
1061
1062             # Create configuration files
1063             mkdir -p /opt/config
1064             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
1065             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
1066             echo "__nexus_username__" > /opt/config/nexus_username.txt
1067             echo "__nexus_password__" > /opt/config/nexus_password.txt
1068             echo "__env_name__" > /opt/config/env_name.txt
1069             echo "__mr_ip_addr__" > /opt/config/mr_ip_addr.txt
1070             echo "__public_ip__" > /opt/config/public_ip.txt
1071             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
1072             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
1073             echo "__docker_version__" > /opt/config/docker_version.txt
1074             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
1075             echo "__cloud_env__" > /opt/config/cloud_env.txt
1076             echo "__external_dns__" > /opt/config/external_dns.txt
1077             echo "__sdc_repo__" > /opt/config/remote_repo.txt
1078
1079             # Download and run install script
1080             curl -k __nexus_repo__/org.onap.demo/boot/__artifacts_version__/sdc_install.sh -o /opt/sdc_install.sh
1081             cd /opt
1082             chmod +x sdc_install.sh
1083             ./sdc_install.sh
1084
1085
1086   # PORTAL instantiation
1087   portal_private_port:
1088     type: OS::Neutron::Port
1089     properties:
1090       network: { get_resource: oam_onap }
1091       fixed_ips: [{"subnet": { get_resource: oam_onap_subnet }, "ip_address": { get_param: portal_ip_addr }}]
1092
1093   portal_floating_ip:
1094     type: OS::Neutron::FloatingIP
1095     properties:
1096       floating_network_id: { get_param: public_net_id }
1097       port_id: { get_resource: portal_private_port }
1098
1099   portal_vm:
1100     type: OS::Nova::Server
1101     properties:
1102       image: { get_param: ubuntu_1404_image }
1103       flavor: { get_param: flavor_large }
1104       name:
1105         str_replace: 
1106           template: base-portal
1107           params:
1108             base: { get_param: vm_base_name }
1109       key_name: { get_resource: vm_key }
1110       networks:
1111         - port: { get_resource: portal_private_port }
1112       user_data_format: RAW
1113       user_data:
1114         str_replace:
1115           params:
1116             __nexus_repo__: { get_param: nexus_repo }
1117             __nexus_docker_repo__: { get_param: nexus_docker_repo }
1118             __nexus_username__: { get_param: nexus_username }
1119             __nexus_password__: { get_param: nexus_password }
1120             __artifacts_version__: { get_param: artifacts_version }
1121             __dns_ip_addr__: { get_param: dns_ip_addr }
1122             __public_ip__: { get_attr: [portal_floating_ip, floating_ip_address] }
1123             __docker_version__: { get_param: docker_version }
1124             __gerrit_branch__: { get_param: gerrit_branch }
1125             __cloud_env__: { get_param: cloud_env }
1126             __external_dns__: { get_param: external_dns }
1127             __portal_repo__: { get_param: portal_repo }
1128           template: |
1129             #!/bin/bash
1130
1131             # Create configuration files
1132             mkdir -p /opt/config
1133             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
1134             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
1135             echo "__nexus_username__" > /opt/config/nexus_username.txt
1136             echo "__nexus_password__" > /opt/config/nexus_password.txt
1137             echo "__public_ip__" > /opt/config/public_ip.txt
1138             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
1139             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
1140             echo "__docker_version__" > /opt/config/docker_version.txt
1141             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
1142             echo "__cloud_env__" > /opt/config/cloud_env.txt
1143             echo "__external_dns__" > /opt/config/external_dns.txt
1144             echo "__portal_repo__" > /opt/config/remote_repo.txt
1145
1146             # Download and run install script
1147             curl -k __nexus_repo__/org.onap.demo/boot/__artifacts_version__/portal_install.sh -o /opt/portal_install.sh
1148             cd /opt
1149             chmod +x portal_install.sh
1150             ./portal_install.sh
1151
1152
1153   # DCAE Controller instantiation
1154   dcae_c_private_port:
1155     type: OS::Neutron::Port
1156     properties:
1157       network: { get_resource: oam_onap }
1158       fixed_ips: [{"subnet": { get_resource: oam_onap_subnet }, "ip_address": { get_param: dcae_ip_addr }}]
1159
1160   dcae_c_floating_ip:
1161     type: OS::Neutron::FloatingIP
1162     properties:
1163       floating_network_id: { get_param: public_net_id }
1164       port_id: { get_resource: dcae_c_private_port }
1165
1166   dcae_c_vm:
1167     type: OS::Nova::Server
1168     properties:
1169       image: { get_param: ubuntu_1404_image }
1170       flavor: { get_param: flavor_medium }
1171       name:
1172         str_replace: 
1173           template: base-dcae-controller
1174           params:
1175             base: { get_param: vm_base_name }
1176       key_name: { get_resource: vm_key }
1177       networks:
1178         - port: { get_resource: dcae_c_private_port }
1179       user_data_format: RAW
1180       user_data:
1181         str_replace:
1182           params:
1183             __nexus_repo__: { get_param: nexus_repo }
1184             __nexus_docker_repo__: { get_param: nexus_docker_repo }
1185             __nexus_username__: { get_param: nexus_username }
1186             __nexus_password__: { get_param: nexus_password }
1187             __nexus_url_snapshots__: { get_param: nexus_url_snapshot }
1188             __gitlab_branch__: { get_param: gitlab_branch }
1189             __dns_ip_addr__: { get_param: dns_ip_addr }
1190             __dcae_zone__: { get_param: dcae_zone }
1191             __dcae_state__: { get_param: dcae_state }
1192             __artifacts_version__: { get_param: artifacts_version }
1193             __tenant_id__: { get_param: openstack_tenant_id }
1194             __openstack_private_network_name__: { get_attr: [oam_onap, name] }
1195             __openstack_user__: { get_param: openstack_username }
1196             __openstack_password__: { get_param: openstack_api_key }
1197             __openstack_auth_method__: { get_param: openstack_auth_method }
1198             __key_name__: { get_param: key_name }
1199             __rand_str__: { get_resource: random-str }
1200             __pub_key__: { get_param: pub_key }
1201             __nexus_repo_root__: { get_param: nexus_repo_root }
1202             __openstack_region__: { get_param: openstack_region }
1203             __horizon_url__: { get_param: horizon_url }
1204             __keystone_url__: { get_param: keystone_url }
1205             __docker_version__: { get_param: docker_version }
1206             __gerrit_branch__: { get_param: gerrit_branch }
1207             __dcae_code_version__: { get_param: dcae_code_version }
1208             __cloud_env__: { get_param: cloud_env }
1209             __public_net_id__: { get_param: public_net_id }
1210             __dcae_base_environment__: { get_param: dcae_base_environment }
1211             __dcae_ip_addr__: { get_param: dcae_ip_addr }
1212             __dcae_coll_ip_addr__: { get_param: dcae_coll_ip_addr }
1213             __dcae_db_ip_addr__: { get_param: dcae_db_ip_addr }
1214             __dcae_hdp1_ip_addr__: { get_param: dcae_hdp1_ip_addr }
1215             __dcae_hdp2_ip_addr__: { get_param: dcae_hdp2_ip_addr }
1216             __dcae_hdp3_ip_addr__: { get_param: dcae_hdp3_ip_addr }
1217             __dcae_float_ip__: { get_attr: [dcae_c_floating_ip, floating_ip_address] }
1218             __dcae_coll_float_ip__: { get_param: dcae_coll_float_ip }
1219             __dcae_db_float_ip__: { get_param: dcae_db_float_ip }
1220             __dcae_hdp1_float_ip__: { get_param: dcae_hdp1_float_ip }
1221             __dcae_hdp2_float_ip__: { get_param: dcae_hdp2_float_ip }
1222             __dcae_hdp3_float_ip__: { get_param: dcae_hdp3_float_ip }
1223             __external_dns__: { get_param: external_dns }
1224             __ubuntu_1404_image__: { get_param: ubuntu_1404_image }
1225             __ubuntu_1604_image__: { get_param: ubuntu_1604_image }
1226             __flavor_small__: { get_param: flavor_small }
1227             __flavor_medium__: { get_param: flavor_medium }
1228             __flavor_large__: { get_param: flavor_large }
1229             __flavor_xlarge__: { get_param: flavor_xlarge }
1230             __dcae_repo__: { get_param: dcae_repo }
1231             __mr_repo__: { get_param: mr_repo }
1232           template: |
1233             #!/bin/bash
1234
1235             # Create configuration files
1236             mkdir -p /opt/config
1237             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
1238             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
1239             echo "__nexus_username__" > /opt/config/nexus_username.txt
1240             echo "__nexus_password__" > /opt/config/nexus_password.txt
1241             echo "__nexus_url_snapshots__" > /opt/config/nexus_url_snapshots.txt
1242             echo "__gitlab_branch__" > /opt/config/gitlab_branch.txt
1243             echo "__docker_version__" > /opt/config/docker_version.txt
1244             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
1245             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
1246             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
1247             echo "__dcae_zone__" > /opt/config/dcae_zone.txt
1248             echo "__dcae_state__" > /opt/config/dcae_state.txt
1249             echo "__tenant_id__" > /opt/config/tenant_id.txt
1250             echo "__openstack_private_network_name__" > /opt/config/openstack_private_network_name.txt
1251             echo "__openstack_user__" > /opt/config/openstack_user.txt
1252             echo "__openstack_password__" > /opt/config/openstack_password.txt
1253             echo "__openstack_auth_method__" > /opt/config/openstack_auth_method.txt
1254             echo "__key_name__" > /opt/config/key_name.txt
1255             echo "__rand_str__" > /opt/config/rand_str.txt
1256             echo "__pub_key__" > /opt/config/pub_key.txt
1257             echo "__nexus_repo_root__" > /opt/config/nexus_repo_root.txt
1258             echo "__openstack_region__" > /opt/config/openstack_region.txt
1259             echo "__horizon_url__" > /opt/config/horizon_url.txt
1260             echo "__keystone_url__" > /opt/config/keystone_url.txt
1261             echo "__cloud_env__" > /opt/config/cloud_env.txt
1262             echo "__public_net_id__" > /opt/config/public_net_id.txt
1263             echo "__dcae_base_environment__" > /opt/config/dcae_base_environment.txt
1264             echo "__dcae_code_version__" > /opt/config/dcae_code_version.txt
1265             echo "__dcae_ip_addr__" > /opt/config/dcae_ip_addr.txt
1266             echo "__dcae_coll_ip_addr__" > /opt/config/dcae_coll_ip_addr.txt
1267             echo "__dcae_db_ip_addr__" > /opt/config/dcae_db_ip_addr.txt
1268             echo "__dcae_hdp1_ip_addr__" > /opt/config/dcae_hdp1_ip_addr.txt
1269             echo "__dcae_hdp2_ip_addr__" > /opt/config/dcae_hdp2_ip_addr.txt
1270             echo "__dcae_hdp3_ip_addr__" > /opt/config/dcae_hdp3_ip_addr.txt
1271             echo "__dcae_float_ip__" > /opt/config/dcae_float_ip.txt
1272             echo "__dcae_coll_float_ip__" > /opt/config/dcae_coll_float_ip.txt
1273             echo "__dcae_db_float_ip__" > /opt/config/dcae_db_float_ip.txt
1274             echo "__dcae_hdp1_float_ip__" > /opt/config/dcae_hdp1_float_ip.txt
1275             echo "__dcae_hdp2_float_ip__" > /opt/config/dcae_hdp2_float_ip.txt
1276             echo "__dcae_hdp3_float_ip__" > /opt/config/dcae_hdp3_float_ip.txt
1277             echo "__external_dns__" > /opt/config/external_dns.txt
1278             echo "__ubuntu_1404_image__" > /opt/config/ubuntu_1404_image.txt
1279             echo "__ubuntu_1604_image__" > /opt/config/ubuntu_1604_image.txt
1280             echo "__flavor_small__" > /opt/config/flavor_small.txt
1281             echo "__flavor_medium__" > /opt/config/flavor_medium.txt
1282             echo "__flavor_large__" > /opt/config/flavor_large.txt
1283             echo "__flavor_xlarge__" > /opt/config/flavor_xlarge.txt
1284             echo "__dcae_repo__" > /opt/config/remote_repo.txt
1285             echo "__mr_repo__" > /opt/config/mr_repo.txt
1286
1287             # Download and run install script
1288             curl -k __nexus_repo__/org.onap.demo/boot/__artifacts_version__/dcae_install.sh -o /opt/dcae_install.sh
1289             cd /opt
1290             chmod +x dcae_install.sh
1291             ./dcae_install.sh
1292
1293
1294   # Policy Engine instantiation
1295   policy_private_port:
1296     type: OS::Neutron::Port
1297     properties:
1298       network: { get_resource: oam_onap }
1299       fixed_ips: [{"subnet": { get_resource: oam_onap_subnet }, "ip_address": { get_param: policy_ip_addr }}]
1300
1301   policy_floating_ip:
1302     type: OS::Neutron::FloatingIP
1303     properties:
1304       floating_network_id: { get_param: public_net_id }
1305       port_id: { get_resource: policy_private_port }
1306
1307   policy_vm:
1308     type: OS::Nova::Server
1309     properties:
1310       image: { get_param: ubuntu_1404_image }
1311       flavor: { get_param: flavor_xlarge }
1312       name:
1313         str_replace: 
1314           template: base-policy
1315           params:
1316             base: { get_param: vm_base_name }
1317       key_name: { get_resource: vm_key }
1318       networks:
1319         - port: { get_resource: policy_private_port }
1320       user_data_format: RAW
1321       user_data:
1322         str_replace:
1323           params:
1324             __nexus_repo__: { get_param: nexus_repo }
1325             __nexus_docker_repo__: { get_param: nexus_docker_repo }
1326             __nexus_username__: { get_param: nexus_username }
1327             __nexus_password__: { get_param: nexus_password }
1328             __artifacts_version__: { get_param: artifacts_version }
1329             __dns_ip_addr__: { get_param: dns_ip_addr }
1330             __public_ip__: { get_attr: [policy_floating_ip, floating_ip_address] }
1331             __docker_version__: { get_param: docker_version }
1332             __gerrit_branch__: { get_param: gerrit_branch }
1333             __cloud_env__: { get_param: cloud_env }
1334             __external_dns__: { get_param: external_dns }
1335             __policy_repo__: { get_param: policy_repo }
1336           template: |
1337             #!/bin/bash
1338
1339             # Create configuration files
1340             mkdir -p /opt/config
1341             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
1342             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
1343             echo "__nexus_username__" > /opt/config/nexus_username.txt
1344             echo "__nexus_password__" > /opt/config/nexus_password.txt
1345             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
1346             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
1347             echo "__public_ip__" > /opt/config/public_ip.txt
1348             echo "__docker_version__" > /opt/config/docker_version.txt
1349             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
1350             echo "__cloud_env__" > /opt/config/cloud_env.txt
1351             echo "__external_dns__" > /opt/config/external_dns.txt
1352             echo "__policy_repo__" > /opt/config/remote_repo.txt
1353
1354             # Download and run install script
1355             curl -k __nexus_repo__/org.onap.demo/boot/__artifacts_version__/policy_install.sh -o /opt/policy_install.sh
1356             cd /opt
1357             chmod +x policy_install.sh
1358             ./policy_install.sh
1359
1360
1361   # APP-C instantiation
1362   appc_private_port:
1363     type: OS::Neutron::Port
1364     properties:
1365       network: { get_resource: oam_onap }
1366       fixed_ips: [{"subnet": { get_resource: oam_onap_subnet }, "ip_address": { get_param: appc_ip_addr }}]
1367
1368   appc_floating_ip:
1369     type: OS::Neutron::FloatingIP
1370     properties:
1371       floating_network_id: { get_param: public_net_id }
1372       port_id: { get_resource: appc_private_port }
1373
1374   appc_vm:
1375     type: OS::Nova::Server
1376     properties:
1377       image: { get_param: ubuntu_1404_image }
1378       flavor: { get_param: flavor_large }
1379       name:
1380         str_replace: 
1381           template: base-appc
1382           params:
1383             base: { get_param: vm_base_name }
1384       key_name: { get_resource: vm_key }
1385       networks:
1386         - port: { get_resource: appc_private_port }
1387       user_data_format: RAW
1388       user_data:
1389         str_replace:
1390           params:
1391             __nexus_repo__: { get_param: nexus_repo }
1392             __nexus_docker_repo__: { get_param: nexus_docker_repo }
1393             __nexus_username__: { get_param: nexus_username }
1394             __nexus_password__: { get_param: nexus_password }
1395             __dmaap_topic__: { get_param: dmaap_topic }
1396             __artifacts_version__: { get_param: artifacts_version }
1397             __dns_ip_addr__: { get_param: dns_ip_addr }
1398             __docker_version__: { get_param: docker_version }
1399             __gerrit_branch__: { get_param: gerrit_branch }
1400             __cloud_env__: { get_param: cloud_env }
1401             __external_dns__: { get_param: external_dns }
1402             __appc_repo__: { get_param: appc_repo }
1403           template: |
1404             #!/bin/bash
1405
1406             # Create configuration files
1407             mkdir -p /opt/config
1408             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
1409             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
1410             echo "__nexus_username__" > /opt/config/nexus_username.txt
1411             echo "__nexus_password__" > /opt/config/nexus_password.txt
1412             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
1413             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
1414             echo "__dmaap_topic__" > /opt/config/dmaap_topic.txt
1415             echo "__docker_version__" > /opt/config/docker_version.txt
1416             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
1417             echo "__cloud_env__" > /opt/config/cloud_env.txt
1418             echo "__external_dns__" > /opt/config/external_dns.txt
1419             echo "__appc_repo__" > /opt/config/remote_repo.txt
1420
1421             # Download and run install script
1422             curl -k __nexus_repo__/org.onap.demo/boot/__artifacts_version__/appc_install.sh -o /opt/appc_install.sh
1423             cd /opt
1424             chmod +x appc_install.sh
1425             ./appc_install.sh
1426
1427
1428   # CLAMP instantiation
1429   clamp_private_port:
1430     type: OS::Neutron::Port
1431     properties:
1432       network: { get_resource: oam_onap }
1433       fixed_ips: [{"subnet": { get_resource: oam_onap_subnet }, "ip_address": { get_param: clamp_ip_addr }}]
1434
1435   clamp_floating_ip:
1436     type: OS::Neutron::FloatingIP
1437     properties:
1438       floating_network_id: { get_param: public_net_id }
1439       port_id: { get_resource: clamp_private_port }
1440
1441   clamp_vm:
1442     type: OS::Nova::Server
1443     properties:
1444       image: { get_param: ubuntu_1604_image }
1445       flavor: { get_param: flavor_medium }
1446       name:
1447         str_replace:
1448           template: base-clamp
1449           params:
1450             base: { get_param: vm_base_name }      
1451       key_name: { get_resource: vm_key }
1452       networks:
1453         - port: { get_resource: clamp_private_port }
1454       user_data_format: RAW
1455       user_data:
1456         str_replace:
1457           params:
1458             __nexus_repo__: { get_param: nexus_repo }
1459             __nexus_docker_repo__: { get_param: nexus_docker_repo }
1460             __nexus_username__: { get_param: nexus_username }
1461             __nexus_password__: { get_param: nexus_password }
1462             __openstack_username__: { get_param: openstack_username }
1463             __openstack_tenant_id__: { get_param: openstack_tenant_id }
1464             __openstack_api_key__: { get_param: openstack_api_key }
1465             __openstack_region__: { get_param: openstack_region }
1466             __keystone_url__: { get_param: keystone_url }
1467             __dmaap_topic__: { get_param: dmaap_topic }
1468             __artifacts_version__: { get_param: artifacts_version }
1469             __dns_ip_addr__: { get_param: dns_ip_addr }
1470             __docker_version__: { get_param: docker_version }
1471             __gerrit_branch__: { get_param: gerrit_branch }
1472             __cloud_env__: { get_param: cloud_env }
1473             __external_dns__: { get_param: external_dns }
1474             __clamp_repo__: { get_param: clamp_repo }
1475           template: |
1476             #!/bin/bash
1477
1478             # Create configuration files
1479             mkdir -p /opt/config
1480             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
1481             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
1482             echo "__nexus_username__" > /opt/config/nexus_username.txt
1483             echo "__nexus_password__" > /opt/config/nexus_password.txt
1484             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
1485             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
1486             echo "__dmaap_topic__" > /opt/config/dmaap_topic.txt
1487             echo "__openstack_username__" > /opt/config/openstack_username.txt
1488             echo "__openstack_tenant_id__" > /opt/config/tenant_id.txt
1489             echo "__openstack_api_key__" > /opt/config/openstack_api_key.txt
1490             echo "__openstack_region__" > /opt/config/openstack_region.txt
1491             echo "__keystone_url__" > /opt/config/keystone.txt
1492             echo "__docker_version__" > /opt/config/docker_version.txt
1493             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
1494             echo "__cloud_env__" > /opt/config/cloud_env.txt
1495             echo "__external_dns__" > /opt/config/external_dns.txt
1496             echo "__clamp_repo__" > /opt/config/remote_repo.txt
1497
1498             # Download and run install script
1499             curl -k __nexus_repo__/org.onap.demo/boot/__artifacts_version__/clamp_install.sh -o /opt/clamp_install.sh
1500             cd /opt
1501             chmod +x clamp_install.sh
1502             ./clamp_install.sh