f56e60221275975267ca69dd317e3ff7c5cb3434
[bottlenecks.git] / testsuites / rubbos / testcase_cfg / rubbos_1-1-0-1.yaml
1 heat_template_version: 2013-05-23
2
3 description: >
4   HOT template to create a new neutron network plus a router to the public
5   network, and for deploying nine servers into the new network. The template also
6   assigns floating IP addresses to rubbos_control server so it is routable from the
7   public network.
8 parameters:
9   key_name:
10     type: string
11     description: Name of keypair to assign to servers
12     default: bottlenecks_rubbos_keypair
13   image:
14     type: string
15     description: Name of image to use for servers
16     default: bottlenecks-trusty-server
17   flavor:
18     type: string
19     description: Flavor to use for servers
20     default: bottlenecks_rubbos_flavor
21   public_net:
22     type: string
23     description: >
24       ID or name of public network for which floating IP addresses will be allocated
25     default: net04_ext
26   private_net_name:
27     type: string
28     description: Name of private network to be created
29     default: bottlenecks-private
30   private_net_cidr:
31     type: string
32     description: Private network address (CIDR notation)
33     default: "10.0.10.0/24"
34   private_net_gateway:
35     type: string
36     description: Private network gateway address
37     default: "10.0.10.1"
38   private_net_pool_start:
39     type: string
40     description: Start of private network IP address allocation pool
41     default: "10.0.10.2"
42   private_net_pool_end:
43     type: string
44     description: End of private network IP address allocation pool
45     default: "10.0.10.199"
46   master_user_data:
47     type: string
48     description: User data for the server with master role
49     default: ""
50   agent_user_data:
51     type: string
52     description: User data for the server with agent role
53     default: ""
54
55 resources:
56   private_net:
57     type: OS::Neutron::Net
58     properties:
59       name: { get_param: private_net_name }
60
61   private_subnet:
62     type: OS::Neutron::Subnet
63     properties:
64       network_id: { get_resource: private_net }
65       cidr: { get_param: private_net_cidr }
66       gateway_ip: { get_param: private_net_gateway }
67       allocation_pools:
68         - start: { get_param: private_net_pool_start }
69           end: { get_param: private_net_pool_end }
70       dns_nameservers: [ "8.8.8.8" ]
71
72   router:
73     type: OS::Neutron::Router
74     properties:
75       external_gateway_info:
76         network: { get_param: public_net }
77
78   router_interface:
79     type: OS::Neutron::RouterInterface
80     properties:
81       router_id: { get_resource: router }
82       subnet_id: { get_resource: private_subnet }
83
84   rubbos_control:
85     type: OS::Nova::Server
86     properties:
87       name: rubbos_control
88       image: { get_param: image }
89       flavor: { get_param: flavor }
90       key_name: { get_param: key_name }
91       networks:
92         - port: { get_resource: rubbos_control_port }
93       admin_user: ubuntu
94       user_data: { get_param: master_user_data }
95       user_data_format: RAW
96
97   rubbos_control_port:
98     type: OS::Neutron::Port
99     properties:
100       network_id: { get_resource: private_net }
101       fixed_ips:
102         - subnet_id: { get_resource: private_subnet }
103       security_groups: [{ get_resource: server_security_group }]
104
105   rubbos_control_floating_ip:
106     type: OS::Neutron::FloatingIP
107     properties:
108       floating_network: { get_param: public_net }
109       port_id: { get_resource: rubbos_control_port }
110
111   rubbos_httpd:
112     type: OS::Nova::Server
113     properties:
114       name: rubbos-httpd
115       image: { get_param: image }
116       flavor: { get_param: flavor }
117       key_name: { get_param: key_name }
118       networks:
119         - port: { get_resource: rubbos_httpd_port }
120       admin_user: ubuntu
121       user_data: { get_param: agent_user_data }
122       user_data_format: RAW
123
124   rubbos_httpd_port:
125     type: OS::Neutron::Port
126     properties:
127       network_id: { get_resource: private_net }
128       fixed_ips:
129         - subnet_id: { get_resource: private_subnet }
130       security_groups: [{ get_resource: server_security_group }]
131
132   rubbos_mysql1:
133     type: OS::Nova::Server
134     properties:
135       name: rubbos-mysql1
136       image: { get_param: image }
137       flavor: { get_param: flavor }
138       key_name: { get_param: key_name }
139       networks:
140         - port: { get_resource: rubbos_mysql1_port }
141       admin_user: ubuntu
142       user_data: { get_param: agent_user_data }
143       user_data_format: RAW
144
145   rubbos_mysql1_port:
146     type: OS::Neutron::Port
147     properties:
148       network_id: { get_resource: private_net }
149       fixed_ips:
150         - subnet_id: { get_resource: private_subnet }
151       security_groups: [{ get_resource: server_security_group }]
152
153   rubbos_tomcat1:
154     type: OS::Nova::Server
155     properties:
156       name: rubbos-tomcat1
157       image: { get_param: image }
158       flavor: { get_param: flavor }
159       key_name: { get_param: key_name }
160       networks:
161         - port: { get_resource: rubbos_tomcat1_port }
162       admin_user: ubuntu
163       user_data: { get_param: agent_user_data }
164       user_data_format: RAW
165
166   rubbos_tomcat1_port:
167     type: OS::Neutron::Port
168     properties:
169       network_id: { get_resource: private_net }
170       fixed_ips:
171         - subnet_id: { get_resource: private_subnet }
172       security_groups: [{ get_resource: server_security_group }]
173
174   rubbos_client1:
175     type: OS::Nova::Server
176     properties:
177       name: rubbos-client1
178       image: { get_param: image }
179       flavor: { get_param: flavor }
180       key_name: { get_param: key_name }
181       networks:
182         - port: { get_resource: rubbos_client1_port }
183       admin_user: ubuntu
184       user_data: { get_param: agent_user_data }
185       user_data_format: RAW
186
187   rubbos_client1_port:
188     type: OS::Neutron::Port
189     properties:
190       network_id: { get_resource: private_net }
191       fixed_ips:
192         - subnet_id: { get_resource: private_subnet }
193       security_groups: [{ get_resource: server_security_group }]
194
195   rubbos_client2:
196     type: OS::Nova::Server
197     properties:
198       name: rubbos-client2
199       image: { get_param: image }
200       flavor: { get_param: flavor }
201       key_name: { get_param: key_name }
202       networks:
203         - port: { get_resource: rubbos_client2_port }
204       admin_user: ubuntu
205       user_data: { get_param: agent_user_data }
206       user_data_format: RAW
207
208   rubbos_client2_port:
209     type: OS::Neutron::Port
210     properties:
211       network_id: { get_resource: private_net }
212       fixed_ips:
213         - subnet_id: { get_resource: private_subnet }
214       security_groups: [{ get_resource: server_security_group }]
215
216   rubbos_client3:
217     type: OS::Nova::Server
218     properties:
219       name: rubbos-client3
220       image: { get_param: image }
221       flavor: { get_param: flavor }
222       key_name: { get_param: key_name }
223       networks:
224         - port: { get_resource: rubbos_client3_port }
225       admin_user: ubuntu
226       user_data: { get_param: agent_user_data }
227       user_data_format: RAW
228
229   rubbos_client3_port:
230     type: OS::Neutron::Port
231     properties:
232       network_id: { get_resource: private_net }
233       fixed_ips:
234         - subnet_id: { get_resource: private_subnet }
235       security_groups: [{ get_resource: server_security_group }]
236
237   rubbos_client4:
238     type: OS::Nova::Server
239     properties:
240       name: rubbos-client4
241       image: { get_param: image }
242       flavor: { get_param: flavor }
243       key_name: { get_param: key_name }
244       networks:
245         - port: { get_resource: rubbos_client4_port }
246       admin_user: ubuntu
247       user_data: { get_param: agent_user_data }
248       user_data_format: RAW
249
250   rubbos_client4_port:
251     type: OS::Neutron::Port
252     properties:
253       network_id: { get_resource: private_net }
254       fixed_ips:
255         - subnet_id: { get_resource: private_subnet }
256       security_groups: [{ get_resource: server_security_group }]
257
258   rubbos_client5:
259     type: OS::Nova::Server
260     properties:
261       name: rubbos-client5
262       image: { get_param: image }
263       flavor: { get_param: flavor }
264       key_name: { get_param: key_name }
265       networks:
266         - port: { get_resource: rubbos_client5_port }
267       admin_user: ubuntu
268       user_data: { get_param: agent_user_data }
269       user_data_format: RAW
270
271   rubbos_client5_port:
272     type: OS::Neutron::Port
273     properties:
274       network_id: { get_resource: private_net }
275       fixed_ips:
276         - subnet_id: { get_resource: private_subnet }
277       security_groups: [{ get_resource: server_security_group }]
278
279   server_security_group:
280     type: OS::Neutron::SecurityGroup
281     properties:
282       description: Rubbos group for servers access.
283       name: rubbos-security-group
284       rules: [
285         {remote_ip_prefix: 0.0.0.0/0,
286         protocol: tcp,
287         port_range_min: 1,
288         port_range_max: 65535},
289         {remote_ip_prefix: 0.0.0.0/0,
290         protocol: udp,
291         port_range_min: 1,
292         port_range_max: 65535},
293         {remote_ip_prefix: 0.0.0.0/0,
294         protocol: icmp}]
295
296 outputs:
297   rubbos_control_private_ip:
298     description: IP address of rubbos_control in private network
299     value: { get_attr: [ rubbos_control, first_address ] }
300   rubbos_control_public_ip:
301     description: Floating IP address of rubbos_control in public network
302     value: { get_attr: [ rubbos_control_floating_ip, floating_ip_address ] }
303   rubbos_httpd_private_ip:
304     description: IP address of rubbos_httpd in private network
305     value: { get_attr: [ rubbos_httpd, first_address ] }
306   rubbos_mysql1_private_ip:
307     description: IP address of rubbos_mysql1 in private network
308     value: { get_attr: [ rubbos_mysql1, first_address ] }
309   rubbos_tomcat1_private_ip:
310     description: IP address of rubbos_tomcat1 in private network
311     value: { get_attr: [ rubbos_tomcat1, first_address ] }
312   rubbos_client1_private_ip:
313     description: IP address of rubbos_client1 in private network
314     value: { get_attr: [ rubbos_client1, first_address ] }
315   rubbos_client2_private_ip:
316     description: IP address of rubbos_client2 in private network
317     value: { get_attr: [ rubbos_client2, first_address ] }
318   rubbos_client3_private_ip:
319     description: IP address of rubbos_client3 in private network
320     value: { get_attr: [ rubbos_client3, first_address ] }
321   rubbos_client4_private_ip:
322     description: IP address of rubbos_client4 in private network
323     value: { get_attr: [ rubbos_client4, first_address ] }
324   rubbos_client5_private_ip:
325     description: IP address of rubbos_client5 in private network
326     value: { get_attr: [ rubbos_client5, first_address ] }
327