push addional code
[sdc.git] / openecomp-be / lib / openecomp-sdc-translator-lib / openecomp-sdc-translator-core / src / test / resources / mock / services / heattotosca / hot-nimbus-oam-volumes_v1.0 / inputfiles / nested-pcm_v1.0.yaml
1 heat_template_version: 2013-05-23
2
3 description: heat template that creates PCRF Cluman stack
4
5 parameters:
6   pcrf_pcm_server_name:
7     type: string
8     label: PCRF CM server name
9     description: PCRF CM server name
10   pcrf_pcm_image_name:
11     type: string
12     label: image name
13     description: PCRF CM image name
14   pcrf_pcm_flavor_name:
15     type: string
16     label: PCRF CM flavor name
17     description: flavor name of PCRF CM 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_oam_net_name:
35     type: string
36     label: OAM network name
37     description: OAM network name
38   pcrf_oam_net_ip:
39     type: string
40     label: OAM network ip
41     description: OAM network ip
42   pcrf_oam_net_gw:
43     type: string
44     label: CPS network gateway
45     description: CPS network gateway
46   pcrf_oam_net_mask:
47     type: string
48     label: CPS network mask
49     description: CPS network mask
50   pcrf_pcm_volume_id:
51     type: string
52     label: CPS Cluman Cinder Volume
53     description: CPS Cluman Cinder Volume
54   pcrf_security_group_name:
55     type: string
56     label: security group name
57     description: the name of security group
58   pcrf_vnf_id:
59     type: string
60     label: PCRF VNF Id
61     description: PCRF VNF Id
62
63 resources:
64   network:
65     type: OS::Heat::CloudConfig
66     properties:
67       cloud_config:
68         write_files:
69           - path: /etc/sysconfig/network-scripts/ifcfg-eth0
70             permissions: "0644"
71             content:
72               str_replace:
73                 template: { get_file: nimbus-ethernet }
74                 params:
75                   $dev: eth0
76                   $ip: { get_param: pcrf_cps_net_ip }
77                   $netmask: { get_param: pcrf_cps_net_mask }
78           - path: /etc/sysconfig/network-scripts/ifcfg-eth1
79             permissions: "0644"
80             content:
81               str_replace:
82                 template: { get_file: nimbus-ethernet-gw }
83                 params:
84                   $dev: eth1
85                   $ip: { get_param: pcrf_oam_net_ip }
86                   $netmask: { get_param: pcrf_oam_net_mask }
87                   $gateway: { get_param: pcrf_oam_net_gw }
88         runcmd:
89           - ifdown eth0 && ifup eth0
90           - ifdown eth1 && ifup eth1
91   script_init:
92     type: OS::Heat::SoftwareConfig
93     properties:
94       group: ungrouped
95       config:
96         str_replace:
97           template: { get_file: cloud-nimbus.sh }
98           params:
99             $vm_name: { get_param: pcrf_pcm_server_name }
100   pcrf_server_init:
101     type: OS::Heat::MultipartMime
102     properties:
103       parts:
104       - config: { get_resource: network}
105       - config: { get_resource: script_init}
106
107   pcrf_server_pcm:
108     type: OS::Nova::Server
109     properties:
110       config_drive: "True"
111       name: { get_param: pcrf_pcm_server_name }
112       image: { get_param: pcrf_pcm_image_name }
113       flavor: { get_param: pcrf_pcm_flavor_name }
114       availability_zone: { get_param: availabilityzone_name }
115       networks:
116         - port: { get_resource: pcrf_pcm_port_0}
117         - port: { get_resource: pcrf_pcm_port_1}
118       user_data_format: RAW
119       user_data:
120         get_resource: pcrf_server_init
121       metadata:
122         vnf_id: {get_param: pcrf_vnf_id}
123
124   pcrf_pcm_port_0:
125     type: OS::Neutron::Port
126     properties:
127       network: { get_param: pcrf_cps_net_name }
128       fixed_ips:
129         - ip_address: { get_param: pcrf_cps_net_ip }
130       security_groups: [{ get_param: pcrf_security_group_name }]
131
132   pcrf_pcm_port_1:
133     type: OS::Neutron::Port
134     properties:
135       network: { get_param: pcrf_oam_net_name }
136       fixed_ips:
137         - ip_address: { get_param: pcrf_oam_net_ip }
138       security_groups: [{ get_param: pcrf_security_group_name }]
139
140   volume_attachment:
141     type: OS::Cinder::VolumeAttachment
142     properties:
143       volume_id: { get_param: pcrf_pcm_volume_id }
144       mountpoint: /dev/vdd
145       instance_uuid: { get_resource: pcrf_server_pcm }
146
147 outputs:
148   pcrf_server_pcm_id:
149     description: the pcm server id
150     value: { get_resource: pcrf_server_pcm }