Initial OpenECOMP MSO commit
[so.git] / packages / arquillian-unit-tests / src / test / resources / resource-examples / asdc / demo-dns-V1 / artifacts / base_vlb.yaml
1 heat_template_version: 2013-05-23
2
3 description: Heat template to deploy vLoadBalancer/vDNS demo app for OpenECOMP
4
5 parameters:
6   vlb_image_name:
7     type: string
8     label: Image name or ID
9     description: Image to be used for compute instance
10   vlb_flavor_name:
11     type: string
12     label: Flavor
13     description: Type of instance (flavor) to be used
14   public_net_id:
15     type: string
16     label: Public network name or ID
17     description: Public network that enables remote connection to VNF
18   vlb_private_net_id:
19     type: string
20     label: vLoadBalancer private network name or ID
21     description: Private network that connects vLoadBalancer with vDNSs
22   ecomp_private_net_id:
23     type: string
24     label: ECOMP management network name or ID
25     description: Private network that connects ECOMP component and the VNF
26   vlb_private_net_cidr:
27     type: string
28     label: vLoadBalancer private network CIDR
29     description: The CIDR of the vLoadBalancer private network
30   ecomp_private_net_cidr:
31     type: string
32     label: ECOMP private network CIDR
33     description: The CIDR of the protected private network
34   vlb_private_ip_0:
35     type: string
36     label: vLoadBalancer private IP address towards the private network
37     description: Private IP address that is assigned to the vLoadBalancer to communicate with the vDNSs
38   vlb_private_ip_1:
39     type: string
40     label: vLoadBalancer private IP address towards the ECOMP management network
41     description: Private IP address that is assigned to the vLoadBalancer to communicate with ECOMP components
42   vdns_private_ip_0:
43     type: string
44     label: vDNS private IP address towards the private network
45     description: Private IP address that is assigned to the vDNS to communicate with the vLoadBalancer
46   vdns_private_ip_1:
47     type: string
48     label: vDNS private IP address towards the ECOMP management network
49     description: Private IP address that is assigned to the vDNS to communicate with ECOMP components
50   vlb_name_0:
51     type: string
52     label: vLoadBalancer name
53     description: Name of the vLoadBalancer
54   vdsn_name_0:
55     type: string
56     label: vDNS name
57     description: Name of the vDNS
58   vnf_id:
59     type: string
60     label: VNF ID
61     description: The VNF ID is provided by ECOMP
62   vf_module_id:
63     type: string
64     label: vFirewall module ID
65     description: The vLoadBalancer Module ID is provided by ECOMP
66   webserver_ip:
67     type: string
68     label: Webserver IP address
69     description: IP address of the webserver that hosts the source code and binaries
70   dcae_collector_ip:
71     type: string
72     label: DCAE collector IP address
73     description: IP address of the DCAE collector
74   key_name:
75     type: string
76     label: Key pair name
77     description: Public/Private key pair name
78   pub_key:
79     type: string
80     label: Public key
81     description: Public key to be installed on the compute instance
82
83 resources:
84   my_keypair:
85     type: OS::Nova::KeyPair
86     properties:
87       name: { get_param: key_name }
88       public_key: { get_param: pub_key }
89       save_private_key: false
90
91   vlb_private_network:
92     type: OS::Neutron::Net
93     properties:
94       name: { get_param: vlb_private_net_id }
95
96   vlb_private_subnet:
97     type: OS::Neutron::Subnet
98     properties:
99       network_id: { get_resource: vlb_private_network }
100       cidr: { get_param: vlb_private_net_cidr }
101
102   vlb_0:
103     type: OS::Nova::Server
104     properties:
105       image: { get_param: vlb_image_name }
106       flavor: { get_param: vlb_flavor_name }
107       name: { get_param: vlb_name_0 }
108       key_name: { get_resource: my_keypair }
109       networks:
110         - network: { get_param: public_net_id }
111         - port: { get_resource: vlb_private_0_port }
112         - port: { get_resource: vlb_private_1_port }
113       metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }}
114       user_data_format: RAW
115       user_data:
116         str_replace:
117           params:
118             __webserver__: { get_param: webserver_ip }
119             __dcae_collector_ip__ : { get_param: dcae_collector_ip }
120           template: |
121             #!/bin/bash
122
123             WEBSERVER_IP=__webserver__
124             DCAE_COLLECTOR_IP=__dcae_collector_ip__
125
126             mkdir /opt/config
127             cd /opt
128             wget http://$WEBSERVER_IP/demo_repo/v_lb_init.sh
129             chmod +x v_lb_init.sh
130             echo $WEBSERVER_IP > config/webserver_ip.txt
131             echo $DCAE_COLLECTOR_IP > config/dcae_collector_ip.txt
132             ./v_lb_init.sh
133
134   vlb_private_0_port:
135     type: OS::Neutron::Port
136     properties:
137       network: { get_resource: vlb_private_network }
138       fixed_ips: [{"subnet": { get_resource: vlb_private_subnet }, "ip_address": { get_param: vlb_private_ip_0 }}]
139
140   vlb_private_1_port:
141     type: OS::Neutron::Port
142     properties:
143       network: { get_param: ecomp_private_net_id }
144       fixed_ips: [{"subnet": { get_param: ecomp_private_net_id }, "ip_address": { get_param: vlb_private_ip_1 }}]
145
146   vdns_0:
147     type: OS::Nova::Server
148     properties:
149       image: { get_param: vlb_image_name }
150       flavor: { get_param: vlb_flavor_name }
151       name: { get_param: vdsn_name_0 }
152       key_name: { get_resource: my_keypair }
153       networks:
154         - network: { get_param: public_net_id }
155         - port: { get_resource: vdns_private_0_port }
156         - port: { get_resource: vdns_private_1_port }
157       metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }}
158       user_data_format: RAW
159       user_data:
160         str_replace:
161           params:
162             __webserver__: { get_param: webserver_ip }
163             __fw_ipaddr__: { get_param: vlb_private_ip_0 }
164           template: |
165             #!/bin/bash
166
167             WEBSERVER_IP=__webserver__
168             LB_IPADDR=__lb_ipaddr__
169
170             mkdir /opt/config
171             cd /opt
172             wget http://$WEBSERVER_IP/demo_repo/v_dns_init.sh
173             chmod +x v_dns_init.sh
174             echo $WEBSERVER_IP > config/webserver_ip.txt
175             echo $LB_IPADDR > config/lb_ipaddr.txt
176             ./v_dns_init.sh
177
178   vdns_private_0_port:
179     type: OS::Neutron::Port
180     properties:
181       network: { get_resource: vlb_private_network }
182       fixed_ips: [{"subnet": { get_resource: vlb_private_subnet }, "ip_address": { get_param: vdns_private_ip_0 }}]
183
184   vdns_private_1_port:
185     type: OS::Neutron::Port
186     properties:
187       network: { get_param: ecomp_private_net_id }
188       fixed_ips: [{"subnet": { get_param: ecomp_private_net_id }, "ip_address": { get_param: vdns_private_ip_1 }}]