push addional code
[sdc.git] / openecomp-be / backend / openecomp-sdc-vendor-software-product-manager / src / test / resources / nimbus / nested-ppd_v1.0.yaml
1 heat_template_version: 2013-05-23
2
3 description: heat template that creates PCRF Policy Director stack
4
5 parameters:
6   pcrf_ppd_server_name:
7     type: string
8     label: PCRF PD server name
9     description: PCRF PD server name
10   pcrf_ppd_image_name:
11     type: string
12     label: image name
13     description: PCRF PD image name
14   pcrf_ppd_flavor_name:
15     type: string
16     label: PCRF PD flavor name
17     description: flavor name of PCRF PD instance
18   availabilityzone_name:
19     type: string
20     label: availabilityzone name
21     description: availabilityzone name
22   pcrf_cps_net_name:
23     type: string
24     label: CPS network name
25     description: CPS network name
26   pcrf_cps_net_ip:
27     type: string
28     label: CPS network ip
29     description: CPS network ip
30   pcrf_cps_net_mask:
31     type: string
32     label: CPS network mask
33     description: CPS network mask
34   pcrf_lb_internal_vip:
35     type: string
36     label: CPS Internal LB VIP
37     description: CPS Internal LB VIP
38   pcrf_oam_net_name:
39     type: string
40     label: OAM network name
41     description: OAM network name
42   pcrf_oam_net_ip:
43     type: string
44     label: OAM network ip
45     description: OAM network ip
46   pcrf_oam_net_gw:
47     type: string
48     label: CPS network gateway
49     description: CPS network gateway
50   pcrf_oam_net_mask:
51     type: string
52     label: CPS network mask
53     description: CPS network mask
54   pcrf_lb_management_vip:
55     type: string
56     label: CPS OAM LB VIP
57     description: CPS OAM LB VIP
58   pcrf_gx_net_name:
59     type: string
60     label: Gx network name
61     description: Gx network name
62   pcrf_gx_net_ip:
63     type: string
64     label: Gx network ip
65     description: Gx network ip
66   pcrf_gx_net_mask:
67     type: string
68     label: Gx network mask
69     description: Gx network mask
70   pcrf_sp_net_name:
71     type: string
72     label: Sp network name
73     description: Sp network name
74   pcrf_sp_net_ip:
75     type: string
76     label: Sp network ip
77     description: Sp network ip
78   pcrf_sp_net_mask:
79     type: string
80     label: Sp network mask
81     description: Sp network mask
82   pcrf_sy_net_name:
83     type: string
84     label: Sy network name
85     description: Sy network name
86   pcrf_sy_net_ip:
87     type: string
88     label: Sy network ip
89     description: Sy network ip
90   pcrf_sy_net_mask:
91     type: string
92     label: Sy network mask
93     description: Sy network mask
94   pcrf_rx_net_name:
95     type: string
96     label: Rx network name
97     description: Rx network name
98   pcrf_rx_net_ip:
99     type: string
100     label: Rx network ip
101     description: Rx network ip
102   pcrf_rx_net_mask:
103     type: string
104     label: Rx network mask
105     description: Rx network mask
106   pcrf_sd_net_name:
107     type: string
108     label: Sd network name
109     description: Sd network name
110   pcrf_sd_net_ip:
111     type: string
112     label: Sd network ip
113     description: Sd network ip
114   pcrf_sd_net_mask:
115     type: string
116     label: Sd network mask
117     description: Sd network mask
118   pcrf_sgi_sy_net_name:
119     type: string
120     label: Sgi Sy network name
121     description: Sgi Sy network name
122   pcrf_sgi_sy_net_ip:
123     type: string
124     label: Sgi Sy network ip
125     description: Sgi Sy network ip
126   pcrf_sgi_sy_net_mask:
127     type: string
128     label: Sgi Sy network mask
129     description: Sgi Sy network mask
130   pcrf_security_group_name:
131     type: string
132     label: security group name
133     description: the name of security group
134   pcrf_vnf_id:
135     type: string
136     label: PCRF VNF Id
137     description: PCRF VNF Id
138
139 resources:
140   network:
141     type: OS::Heat::CloudConfig
142     properties:
143       cloud_config:
144         write_files:
145           - path: /etc/sysconfig/network-scripts/ifcfg-eth0
146             permissions: "0644"
147             content:
148               str_replace:
149                 template: { get_file: nimbus-ethernet }
150                 params:
151                   $dev: eth0
152                   $ip: { get_param: pcrf_cps_net_ip }
153                   $netmask: { get_param: pcrf_cps_net_mask }
154           - path: /etc/sysconfig/network-scripts/ifcfg-eth1
155             permissions: "0644"
156             content:
157               str_replace:
158                 template: { get_file: nimbus-ethernet-gw }
159                 params:
160                   $dev: eth1
161                   $ip: { get_param: pcrf_oam_net_ip }
162                   $netmask: { get_param: pcrf_oam_net_mask }
163                   $gateway: { get_param: pcrf_oam_net_gw }
164           - path: /etc/sysconfig/network-scripts/ifcfg-eth2
165             permissions: "0644"
166             content:
167               str_replace:
168                 template: { get_file: nimbus-ethernet }
169                 params:
170                   $dev: eth2
171                   $ip: { get_param: pcrf_gx_net_ip }
172                   $netmask: { get_param: pcrf_gx_net_mask }
173           - path: /etc/sysconfig/network-scripts/ifcfg-eth3
174             permissions: "0644"
175             content:
176               str_replace:
177                 template: { get_file: nimbus-ethernet }
178                 params:
179                   $dev: eth3
180                   $ip: { get_param: pcrf_sp_net_ip }
181                   $netmask: { get_param: pcrf_sp_net_mask }
182           - path: /etc/sysconfig/network-scripts/ifcfg-eth4
183             permissions: "0644"
184             content:
185               str_replace:
186                 template: { get_file: nimbus-ethernet }
187                 params:
188                   $dev: eth4
189                   $ip: { get_param: pcrf_sy_net_ip }
190                   $netmask: { get_param: pcrf_sy_net_mask }
191           - path: /etc/sysconfig/network-scripts/ifcfg-eth5
192             permissions: "0644"
193             content:
194               str_replace:
195                 template: { get_file: nimbus-ethernet }
196                 params:
197                   $dev: eth5
198                   $ip: { get_param: pcrf_rx_net_ip }
199                   $netmask: { get_param: pcrf_rx_net_mask }
200           - path: /etc/sysconfig/network-scripts/ifcfg-eth6
201             permissions: "0644"
202             content:
203               str_replace:
204                 template: { get_file: nimbus-ethernet }
205                 params:
206                   $dev: eth6
207                   $ip: { get_param: pcrf_sd_net_ip }
208                   $netmask: { get_param: pcrf_sd_net_mask }
209           - path: /etc/sysconfig/network-scripts/ifcfg-eth7
210             permissions: "0644"
211             content:
212               str_replace:
213                 template: { get_file: nimbus-ethernet }
214                 params:
215                   $dev: eth7
216                   $ip: { get_param: pcrf_sgi_sy_net_ip }
217                   $netmask: { get_param: pcrf_sgi_sy_net_mask }
218         runcmd:
219           - ifdown eth0 && ifup eth0
220           - ifdown eth1 && ifup eth1
221           - ifdown eth2 && ifup eth2
222           - ifdown eth3 && ifup eth3
223           - ifdown eth4 && ifup eth4
224           - ifdown eth5 && ifup eth5
225           - ifdown eth6 && ifup eth6
226           - ifdown eth7 && ifup eth7
227   script_init:
228     type: OS::Heat::SoftwareConfig
229     properties:
230       group: ungrouped
231       config:
232         str_replace:
233           template: { get_file: cloud-nimbus.sh }
234           params:
235             $vm_name: { get_param: pcrf_ppd_server_name }
236   pcrf_server_init:
237     type: OS::Heat::MultipartMime
238     properties:
239       parts:
240       - config: { get_resource: network}
241       - config: { get_resource: script_init}
242
243   pcrf_server_ppd: 
244     type: OS::Nova::Server
245     properties:
246       config_drive: "True"
247       name: { get_param: pcrf_ppd_server_name }
248       image: { get_param: pcrf_ppd_image_name }
249       flavor: { get_param: pcrf_ppd_flavor_name }
250       availability_zone: { get_param: availabilityzone_name }
251       networks:
252         - port: { get_resource: pcrf_ppd_port_0}
253         - port: { get_resource: pcrf_ppd_port_1}
254         - port: { get_resource: pcrf_ppd_port_2}
255         - port: { get_resource: pcrf_ppd_port_3}
256         - port: { get_resource: pcrf_ppd_port_4}
257         - port: { get_resource: pcrf_ppd_port_5}
258         - port: { get_resource: pcrf_ppd_port_6}
259         - port: { get_resource: pcrf_ppd_port_7}
260       user_data_format: RAW
261       user_data:
262         get_resource: pcrf_server_init
263       metadata:
264         vnf_id: {get_param: pcrf_vnf_id}
265
266   pcrf_ppd_port_0:
267     type: OS::Neutron::Port
268     properties:
269       network: { get_param: pcrf_cps_net_name }
270       fixed_ips:
271         - ip_address: { get_param: pcrf_cps_net_ip }
272       security_groups: [{ get_param: pcrf_security_group_name }]
273       allowed_address_pairs:
274         - ip_address: { get_param: pcrf_lb_internal_vip }
275
276   pcrf_ppd_port_1:
277     type: OS::Neutron::Port
278     properties:
279       network: { get_param: pcrf_oam_net_name }
280       fixed_ips:
281         - ip_address: { get_param: pcrf_oam_net_ip }
282       security_groups: [{ get_param: pcrf_security_group_name }]
283       allowed_address_pairs:
284         - ip_address: { get_param: pcrf_lb_management_vip } 
285  
286   pcrf_ppd_port_2:
287     type: OS::Neutron::Port
288     properties:
289       network: { get_param: pcrf_gx_net_name }
290       fixed_ips:
291         - ip_address: { get_param: pcrf_gx_net_ip }
292       security_groups: [{ get_param: pcrf_security_group_name }]
293
294   pcrf_ppd_port_3:
295     type: OS::Neutron::Port
296     properties:
297       network: { get_param: pcrf_sp_net_name }
298       fixed_ips:
299         - ip_address: { get_param: pcrf_sp_net_ip }
300       security_groups: [{ get_param: pcrf_security_group_name }]
301
302   pcrf_ppd_port_4:
303     type: OS::Neutron::Port
304     properties:
305       network: { get_param: pcrf_sy_net_name }
306       fixed_ips:
307         - ip_address: { get_param: pcrf_sy_net_ip }
308       security_groups: [{ get_param: pcrf_security_group_name }]
309
310   pcrf_ppd_port_5:
311     type: OS::Neutron::Port
312     properties:
313       network: { get_param: pcrf_rx_net_name }
314       fixed_ips:
315         - ip_address: { get_param: pcrf_rx_net_ip }
316       security_groups: [{ get_param: pcrf_security_group_name }]
317   
318   pcrf_ppd_port_6:
319     type: OS::Neutron::Port
320     properties:
321       network: { get_param: pcrf_sd_net_name }
322       fixed_ips:
323         - ip_address: { get_param: pcrf_sd_net_ip }
324       security_groups: [{ get_param: pcrf_security_group_name }]
325
326   pcrf_ppd_port_7:
327     type: OS::Neutron::Port
328     properties:
329       network: { get_param: pcrf_sgi_sy_net_name }
330       fixed_ips:
331         - ip_address: { get_param: pcrf_sgi_sy_net_ip }
332       security_groups: [{ get_param: pcrf_security_group_name }]
333