Rubbos heat template add security_groups
[bottlenecks.git] / utils / infra_setup / heat_template / bottlenecks_rubbos_hot.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-key
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-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
47 resources:
48   private_net:
49     type: OS::Neutron::Net
50     properties:
51       name: { get_param: private_net_name }
52
53   private_subnet:
54     type: OS::Neutron::Subnet
55     properties:
56       network_id: { get_resource: private_net }
57       cidr: { get_param: private_net_cidr }
58       gateway_ip: { get_param: private_net_gateway }
59       allocation_pools:
60         - start: { get_param: private_net_pool_start }
61           end: { get_param: private_net_pool_end }
62
63   router:
64     type: OS::Neutron::Router
65     properties:
66       external_gateway_info:
67         network: { get_param: public_net }
68
69   router_interface:
70     type: OS::Neutron::RouterInterface
71     properties:
72       router_id: { get_resource: router }
73       subnet_id: { get_resource: private_subnet }
74
75   rubbos_control:
76     type: OS::Nova::Server
77     properties:
78       name: rubbos_control
79       image: { get_param: image }
80       flavor: { get_param: flavor }
81       key_name: { get_param: key_name }
82       networks:
83         - port: { get_resource: rubbos_control_port }
84
85   rubbos_control_port:
86     type: OS::Neutron::Port
87     properties:
88       network_id: { get_resource: private_net }
89       fixed_ips:
90         - subnet_id: { get_resource: private_subnet }
91       security_groups: [{ get_resource: server_security_group }]
92
93   rubbos_control_floating_ip:
94     type: OS::Neutron::FloatingIP
95     properties:
96       floating_network: { get_param: public_net }
97       port_id: { get_resource: rubbos_control_port }
98
99   rubbos_httpd:
100     type: OS::Nova::Server
101     properties:
102       name: rubbos_httpd
103       image: { get_param: image }
104       flavor: { get_param: flavor }
105       key_name: { get_param: key_name }
106       networks:
107         - port: { get_resource: rubbos_httpd_port }
108
109   rubbos_httpd_port:
110     type: OS::Neutron::Port
111     properties:
112       network_id: { get_resource: private_net }
113       fixed_ips:
114         - subnet_id: { get_resource: private_subnet }
115       security_groups: [{ get_resource: server_security_group }]
116
117   rubbos_mysql1:
118     type: OS::Nova::Server
119     properties:
120       name: rubbos_mysql1
121       image: { get_param: image }
122       flavor: { get_param: flavor }
123       key_name: { get_param: key_name }
124       networks:
125         - port: { get_resource: rubbos_mysql1_port }
126
127   rubbos_mysql1_port:
128     type: OS::Neutron::Port
129     properties:
130       network_id: { get_resource: private_net }
131       fixed_ips:
132         - subnet_id: { get_resource: private_subnet }
133       security_groups: [{ get_resource: server_security_group }]
134
135   rubbos_tomcat1:
136     type: OS::Nova::Server
137     properties:
138       name: rubbos_tomcat1
139       image: { get_param: image }
140       flavor: { get_param: flavor }
141       key_name: { get_param: key_name }
142       networks:
143         - port: { get_resource: rubbos_tomcat1_port }
144
145   rubbos_tomcat1_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_client1:
154     type: OS::Nova::Server
155     properties:
156       name: rubbos_client1
157       image: { get_param: image }
158       flavor: { get_param: flavor }
159       key_name: { get_param: key_name }
160       networks:
161         - port: { get_resource: rubbos_client1_port }
162
163   rubbos_client1_port:
164     type: OS::Neutron::Port
165     properties:
166       network_id: { get_resource: private_net }
167       fixed_ips:
168         - subnet_id: { get_resource: private_subnet }
169       security_groups: [{ get_resource: server_security_group }]
170
171   rubbos_client2:
172     type: OS::Nova::Server
173     properties:
174       name: rubbos_client2
175       image: { get_param: image }
176       flavor: { get_param: flavor }
177       key_name: { get_param: key_name }
178       networks:
179         - port: { get_resource: rubbos_client2_port }
180
181   rubbos_client2_port:
182     type: OS::Neutron::Port
183     properties:
184       network_id: { get_resource: private_net }
185       fixed_ips:
186         - subnet_id: { get_resource: private_subnet }
187       security_groups: [{ get_resource: server_security_group }]
188
189   rubbos_client3:
190     type: OS::Nova::Server
191     properties:
192       name: rubbos_client3
193       image: { get_param: image }
194       flavor: { get_param: flavor }
195       key_name: { get_param: key_name }
196       networks:
197         - port: { get_resource: rubbos_client3_port }
198
199   rubbos_client3_port:
200     type: OS::Neutron::Port
201     properties:
202       network_id: { get_resource: private_net }
203       fixed_ips:
204         - subnet_id: { get_resource: private_subnet }
205       security_groups: [{ get_resource: server_security_group }]
206
207   rubbos_client4:
208     type: OS::Nova::Server
209     properties:
210       name: rubbos_client4
211       image: { get_param: image }
212       flavor: { get_param: flavor }
213       key_name: { get_param: key_name }
214       networks:
215         - port: { get_resource: rubbos_client4_port }
216
217   rubbos_client4_port:
218     type: OS::Neutron::Port
219     properties:
220       network_id: { get_resource: private_net }
221       fixed_ips:
222         - subnet_id: { get_resource: private_subnet }
223       security_groups: [{ get_resource: server_security_group }]
224
225   rubbos_benchmark:
226     type: OS::Nova::Server
227     properties:
228       name: rubbos_benchmark
229       image: { get_param: image }
230       flavor: { get_param: flavor }
231       key_name: { get_param: key_name }
232       networks:
233         - port: { get_resource: rubbos_benchmark_port }
234
235   rubbos_benchmark_port:
236     type: OS::Neutron::Port
237     properties:
238       network_id: { get_resource: private_net }
239       fixed_ips:
240         - subnet_id: { get_resource: private_subnet }
241       security_groups: [{ get_resource: server_security_group }]
242
243   server_security_group:
244     type: OS::Neutron::SecurityGroup
245     properties:
246       description: Rubbos group for servers access.
247       name: rubbos-security-group
248       rules: [
249         {remote_ip_prefix: 0.0.0.0/0,
250         protocol: tcp,
251         port_range_min: 1,
252         port_range_max: 65535},
253         {remote_ip_prefix: 0.0.0.0/0,
254         protocol: udp,
255         port_range_min: 1,
256         port_range_max: 65535},
257         {remote_ip_prefix: 0.0.0.0/0,
258         protocol: icmp}]
259
260 outputs:
261   rubbos_control_private_ip:
262     description: IP address of rubbos_control in private network
263     value: { get_attr: [ rubbos_control, first_address ] }
264   rubbos_control_public_ip:
265     description: Floating IP address of rubbos_control in public network
266     value: { get_attr: [ rubbos_control_floating_ip, floating_ip_address ] }
267   rubbos_httpd_private_ip:
268     description: IP address of rubbos_httpd in private network
269     value: { get_attr: [ rubbos_httpd, first_address ] }
270   rubbos_mysql1_private_ip:
271     description: IP address of rubbos_mysql1 in private network
272     value: { get_attr: [ rubbos_mysql1, first_address ] }
273   rubbos_tomcat1_private_ip:
274     description: IP address of rubbos_tomcat1 in private network
275     value: { get_attr: [ rubbos_tomcat1, first_address ] }
276   rubbos_client1_private_ip:
277     description: IP address of rubbos_client1 in private network
278     value: { get_attr: [ rubbos_client1, first_address ] }
279   rubbos_client2_private_ip:
280     description: IP address of rubbos_client2 in private network
281     value: { get_attr: [ rubbos_client2, first_address ] }
282   rubbos_client3_private_ip:
283     description: IP address of rubbos_client3 in private network
284     value: { get_attr: [ rubbos_client3, first_address ] }
285   rubbos_client4_private_ip:
286     description: IP address of rubbos_client4 in private network
287     value: { get_attr: [ rubbos_client4, first_address ] }
288   rubbos_benchmark_private_ip:
289     description: IP address of rubbos_benchmark in private network
290     value: { get_attr: [ rubbos_benchmark, first_address ] }
291