[SDC-29] Amdocs OnBoard 1707 initial commit.
[sdc.git] / openecomp-be / lib / openecomp-sdc-translator-lib / openecomp-sdc-translator-core / src / test / resources / mock / services / heattotosca / getAttr / getAttrUnsupportedResource / inputfiles / nested_db_server.yaml
1 heat_template_version: 2015-04-30
2
3 description: Pronghorn Openstack Heat Template for Mongo DB
4
5 parameters:
6   ###
7   # server group and index
8   ###
9   server_group_id:
10     label: Server Group ID
11     description: ID of the server group
12     type: string
13   deploy_timeout:
14     label: Deployment Timeout
15     description: Timeout before declaring the stack deployment as failed.
16     type: number
17     constraints:
18       - range: { min: 60, max: 3600 }
19
20   ###
21   # vnf info
22   ###
23   vnf_id:
24     label: VNF ID
25     description: Unique ID for this VF instance
26     type: string
27   vf_module_id:
28     label: VF Module ID
29     description: Unique ID for this VF Module instance
30     type: string
31   vm_role:
32     label: DB VM Role
33     description: VM Role for the db vms
34     type: string
35
36   ###
37   # availability zone
38   ###
39   availability_zone_0:
40     label: Availability Zone
41     description: Name of the availability zone for this server
42     type: string
43
44   ###
45   # database server networks, ips and hostnames
46   ###
47   db_name:
48     label: Database Hostname
49     description: Hostname of the database servers
50     type: string
51   oam_net_name:
52     label: OAM Network Name
53     description: Name of the oam network
54     type: string
55   db_oam_ip_0:
56     label: OAM IP Addresse
57     description: OAM IP Address of the database servers
58     type: string
59
60   ###
61   # database common server info (flavor, image, keypair)
62   ###
63   db_flavor_name:
64     label: Flavor
65     description: Flavor to be used for the server
66     type: string
67   db_image_name:
68     label: Image
69     description: Image to be used for the server
70     type: string
71   keypair_id:
72     label: Key Name
73     description: Name of the security key for the server
74     type: string
75
76   ###
77   # security groups
78   ###
79   security_group_ids:
80     label: Security Group IDs
81     description: IDs of the security groups for the server
82     type: comma_delimited_list
83   
84   ###
85   # database volume ids
86   ###
87   db_volume_id_0:
88     label: Data Volume IDs for disk 0
89     description: IDs to be used for the database volume
90     type: string
91   db_volume_id_1:
92     label: Data Volume IDs for disk 1
93     description: IDs to be used for the database volume
94     type: string
95   db_volume_id_2:
96     label: Data Volume IDs for disk 2
97     description: IDs to be used for the database volume
98     type: string
99   db_volume_id_3:
100     label: Data Volume IDs for disk 3
101     description: IDs to be used for the database volume
102     type: string
103
104
105 resources:
106   ###
107   # setup wait condition and handler for heat
108   ###
109   wait_condition:
110     type: OS::Heat::WaitCondition
111     properties:
112       handle: {get_resource: wait_handle}
113       timeout: {get_param: deploy_timeout }
114
115   wait_handle:
116     type: OS::Heat::WaitConditionHandle
117
118   ###
119   # software configuration
120   ###
121   db_config_complete:
122     type: OS::Heat::SoftwareConfig
123     properties:
124       group: ungrouped
125       config:
126         str_replace:
127           params:
128             wc_notify: { get_attr: ['wait_handle', 'curl_cli'] }
129           template: |
130             #!/bin/bash
131             echo "sending completion notification to heat"
132             wc_notify --data-binary '{"status":"SUCCESS"}'
133
134   db_config:
135     type: OS::Heat::MultipartMime
136     properties:
137       parts:
138         - config: { get_resource: db_config_complete }
139
140   ###
141   # create the database server
142   ###
143   db_server_0:
144     type: OS::Nova::Server
145     properties:
146       name: { get_param: db_name }
147       availability_zone: { get_param: availability_zone_0 }
148       scheduler_hints:
149         group: { get_param: server_group_id }
150       flavor: { get_param: db_flavor_name }
151       image: { get_param: db_image_name }
152       key_name: { get_param: keypair_id }
153       security_groups: { get_param: security_group_ids }
154       metadata:
155         vnf_id: { get_param: vnf_id }
156         vf_module_id: { get_param: vf_module_id }
157         vm_role: { get_param: vm_role }
158       networks:
159         - network: { get_param: oam_net_name }
160           fixed_ip: { get_param: db_oam_ip_0 }
161       user_data_format: RAW
162       #user_data: { get_resource: db_config }
163       user_data:
164         str_replace:
165           params:
166             wc_notify: { get_attr: ['wait_handle', 'curl_cli'] }
167           template: |
168             #!/bin/bash
169             ROOT_PW="dan1tom2"
170             (
171             echo "$ROOT_PW"
172             echo "$ROOT_PW"
173             ) | passwd --stdin root
174             wc_notify --data-binary '{"status":"SUCCESS"}'
175
176   ###
177   # attach the data volumes to the server
178   ###
179   db_volume_attachment_0:
180     type: OS::Cinder::VolumeAttachment
181     properties:
182       instance_uuid: { get_resource: db_server_0 }
183       volume_id:  { get_param: db_volume_id_0 }
184   db_volume_attachment_1:
185     type: OS::Cinder::VolumeAttachment
186     properties:
187       instance_uuid: { get_resource: db_server_0 }
188       volume_id:  { get_param: db_volume_id_1 }
189   db_volume_attachment_2:
190     type: OS::Cinder::VolumeAttachment
191     properties:
192       instance_uuid: { get_resource: db_server_0 }
193       volume_id:  { get_param: db_volume_id_2 }
194   db_volume_attachment_3:
195     type: OS::Cinder::VolumeAttachment
196     properties:
197       instance_uuid: { get_resource: db_server_0 }
198       volume_id:  { get_param: db_volume_id_3 }
199
200
201 outputs:
202   ###
203   # No outputs as the base_pronghorn is the only VNF component
204   ###