Add a fundamental rubbos test case with minimum resources
[bottlenecks.git] / testsuites / rubbos / testcase_cfg / rubbos_basic.yaml
1 heat_template_version: 2013-05-23
2
3 description: >
4   HOT template to create a stack with  minimum number of resources for rubbos.
5 parameters:
6   key_name:
7     type: string
8     description: Name of keypair to assign to servers
9     default: bottlenecks_rubbos_keypair
10   image:
11     type: string
12     description: Name of image to use for servers
13     default: bottlenecks-trusty-server
14   flavor:
15     type: string
16     description: Flavor to use for servers
17     default: bottlenecks_rubbos_flavor
18   public_net:
19     type: string
20     description: >
21       ID or name of public network for which floating IP addresses will be allocated
22     default: net04_ext
23   private_net_name:
24     type: string
25     description: Name of private network to be created
26     default: bottlenecks-private
27   private_net_cidr:
28     type: string
29     description: Private network address (CIDR notation)
30     default: "10.0.10.0/24"
31   private_net_gateway:
32     type: string
33     description: Private network gateway address
34     default: "10.0.10.1"
35   private_net_pool_start:
36     type: string
37     description: Start of private network IP address allocation pool
38     default: "10.0.10.2"
39   private_net_pool_end:
40     type: string
41     description: End of private network IP address allocation pool
42     default: "10.0.10.199"
43   master_user_data:
44     type: string
45     description: User data for the server with master role
46     default: ""
47   agent_user_data:
48     type: string
49     description: User data for the server with agent role
50     default: ""
51
52 resources:
53   private_net:
54     type: OS::Neutron::Net
55     properties:
56       name: { get_param: private_net_name }
57
58   private_subnet:
59     type: OS::Neutron::Subnet
60     properties:
61       network_id: { get_resource: private_net }
62       cidr: { get_param: private_net_cidr }
63       gateway_ip: { get_param: private_net_gateway }
64       allocation_pools:
65         - start: { get_param: private_net_pool_start }
66           end: { get_param: private_net_pool_end }
67       dns_nameservers: [ "8.8.8.8" ]
68
69   router:
70     type: OS::Neutron::Router
71     properties:
72       external_gateway_info:
73         network: { get_param: public_net }
74
75   router_interface:
76     type: OS::Neutron::RouterInterface
77     properties:
78       router_id: { get_resource: router }
79       subnet_id: { get_resource: private_subnet }
80
81   rubbos_control:
82     type: OS::Nova::Server
83     properties:
84       name: rubbos-control
85       image: { get_param: image }
86       flavor: { get_param: flavor }
87       key_name: { get_param: key_name }
88       networks:
89         - port: { get_resource: rubbos_control_port }
90       admin_user: ubuntu
91       user_data: { get_param: master_user_data }
92       user_data_format: RAW
93
94   rubbos_control_port:
95     type: OS::Neutron::Port
96     properties:
97       network_id: { get_resource: private_net }
98       fixed_ips:
99         - subnet_id: { get_resource: private_subnet }
100       security_groups: [{ get_resource: server_security_group }]
101
102   rubbos_control_floating_ip:
103     type: OS::Neutron::FloatingIP
104     properties:
105       floating_network: { get_param: public_net }
106       port_id: { get_resource: rubbos_control_port }
107
108   rubbos_httpd:
109     type: OS::Nova::Server
110     properties:
111       name: rubbos-httpd
112       image: { get_param: image }
113       flavor: { get_param: flavor }
114       key_name: { get_param: key_name }
115       networks:
116         - port: { get_resource: rubbos_httpd_port }
117       admin_user: ubuntu
118       user_data: { get_param: agent_user_data }
119       user_data_format: RAW
120
121   rubbos_httpd_port:
122     type: OS::Neutron::Port
123     properties:
124       network_id: { get_resource: private_net }
125       fixed_ips:
126         - subnet_id: { get_resource: private_subnet }
127       security_groups: [{ get_resource: server_security_group }]
128
129   rubbos_mysql1:
130     type: OS::Nova::Server
131     properties:
132       name: rubbos-mysql1
133       image: { get_param: image }
134       flavor: { get_param: flavor }
135       key_name: { get_param: key_name }
136       networks:
137         - port: { get_resource: rubbos_mysql1_port }
138       admin_user: ubuntu
139       user_data: { get_param: agent_user_data }
140       user_data_format: RAW
141
142   rubbos_mysql1_port:
143     type: OS::Neutron::Port
144     properties:
145       network_id: { get_resource: private_net }
146       fixed_ips:
147         - subnet_id: { get_resource: private_subnet }
148       security_groups: [{ get_resource: server_security_group }]
149
150   rubbos_tomcat1:
151     type: OS::Nova::Server
152     properties:
153       name: rubbos-tomcat1
154       image: { get_param: image }
155       flavor: { get_param: flavor }
156       key_name: { get_param: key_name }
157       networks:
158         - port: { get_resource: rubbos_tomcat1_port }
159       admin_user: ubuntu
160       user_data: { get_param: agent_user_data }
161       user_data_format: RAW
162
163   rubbos_tomcat1_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_client1:
172     type: OS::Nova::Server
173     properties:
174       name: rubbos-client1
175       image: { get_param: image }
176       flavor: { get_param: flavor }
177       key_name: { get_param: key_name }
178       networks:
179         - port: { get_resource: rubbos_client1_port }
180       admin_user: ubuntu
181       user_data: { get_param: agent_user_data }
182       user_data_format: RAW
183
184   rubbos_client1_port:
185     type: OS::Neutron::Port
186     properties:
187       network_id: { get_resource: private_net }
188       fixed_ips:
189         - subnet_id: { get_resource: private_subnet }
190       security_groups: [{ get_resource: server_security_group }]
191
192   server_security_group:
193     type: OS::Neutron::SecurityGroup
194     properties:
195       description: Rubbos group for servers access.
196       name: rubbos-security-group
197       rules: [
198         {remote_ip_prefix: 0.0.0.0/0,
199         protocol: tcp,
200         port_range_min: 1,
201         port_range_max: 65535},
202         {remote_ip_prefix: 0.0.0.0/0,
203         protocol: udp,
204         port_range_min: 1,
205         port_range_max: 65535},
206         {remote_ip_prefix: 0.0.0.0/0,
207         protocol: icmp}]
208
209 outputs:
210   rubbos_control_private_ip:
211     description: IP address of rubbos_control in private network
212     value: { get_attr: [ rubbos_control, first_address ] }
213   rubbos_control_public_ip:
214     description: Floating IP address of rubbos_control in public network
215     value: { get_attr: [ rubbos_control_floating_ip, floating_ip_address ] }
216   rubbos_httpd_private_ip:
217     description: IP address of rubbos_httpd in private network
218     value: { get_attr: [ rubbos_httpd, first_address ] }
219   rubbos_mysql1_private_ip:
220     description: IP address of rubbos_mysql1 in private network
221     value: { get_attr: [ rubbos_mysql1, first_address ] }
222   rubbos_tomcat1_private_ip:
223     description: IP address of rubbos_tomcat1 in private network
224     value: { get_attr: [ rubbos_tomcat1, first_address ] }
225   rubbos_client1_private_ip:
226     description: IP address of rubbos_client1 in private network
227     value: { get_attr: [ rubbos_client1, first_address ] }