blob: 01b57fd2cc78312190cad87cea4f952c517d116e [file] [log] [blame]
Mohammed Naser336caf42022-03-11 17:56:45 -05001# Copyright (c) 2022 VEXXHOST, Inc.
2#
3# Licensed under the Apache License, Version 2.0 (the "License"); you may
4# not use this file except in compliance with the License. You may obtain
5# a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations
13# under the License.
14
15heat_template_version: 2016-10-14
16
17parameters:
18 internal_cidr:
19 type: string
20 default: 10.96.240.0/24
21 constraints:
22 - custom_constraint: net_cidr
23
Michiel Piscaer97b7fd32022-03-17 12:15:21 +010024 nameservers:
25 type: comma_delimited_list
26
Mohammed Naser336caf42022-03-11 17:56:45 -050027 external_cidr:
28 type: string
29 default: 10.96.250.0/24
30 constraints:
31 - custom_constraint: net_cidr
32
33 public_network:
34 type: string
Mohammed Naser336caf42022-03-11 17:56:45 -050035 constraints:
36 - custom_constraint: neutron.network
37
38 image:
39 type: string
Mohammed Naser336caf42022-03-11 17:56:45 -050040 constraints:
41 - custom_constraint: glance.image
42
ricolin703b2802022-05-16 02:29:26 +080043 boot_from_volume:
44 type: boolean
45 default: false
46
ricolin1139bb02023-03-21 23:45:40 +080047 create_bastion_host:
48 type: boolean
49 default: false
50
Oleksandr Kozachenkoc01ee522023-05-30 21:22:07 +020051 bastion_instance_type:
52 default: v3-standard-4
53 type: string
54 constraints:
55 - custom_constraint: nova.flavor
56
57 controller_instance_type:
58 type: string
59 constraints:
60 - custom_constraint: nova.flavor
61
62 compute_instance_type:
63 type: string
64 constraints:
65 - custom_constraint: nova.flavor
66
67 storage_instance_type:
Mohammed Naser336caf42022-03-11 17:56:45 -050068 type: string
Mohammed Naser336caf42022-03-11 17:56:45 -050069 constraints:
70 - custom_constraint: nova.flavor
71
ricolin1139bb02023-03-21 23:45:40 +080072conditions:
73 create_bastion_host:
74 equals:
75 - get_param: create_bastion_host
76 - true
77
Mohammed Naser336caf42022-03-11 17:56:45 -050078resources:
Mohammed Naser336caf42022-03-11 17:56:45 -050079 router:
80 type: OS::Neutron::Router
81 properties:
82 external_gateway_info:
83 network: { get_param: public_network }
84
85 internal_network:
86 type: OS::Neutron::Net
87
88 internal_subnet:
89 type: OS::Neutron::Subnet
90 properties:
91 network: { get_resource: internal_network }
92 cidr: { get_param: internal_cidr }
Michiel Piscaer97b7fd32022-03-17 12:15:21 +010093 dns_nameservers: { get_param: nameservers }
Mohammed Naser336caf42022-03-11 17:56:45 -050094
95 internal_network_router_interface:
96 type: OS::Neutron::RouterInterface
97 properties:
98 router: { get_resource: router }
99 subnet: { get_resource: internal_subnet }
100
101 internal_network_vip:
102 type: OS::Neutron::Port
103 properties:
104 network: { get_resource: internal_network }
105
106 internal_network_vip_floating_ip:
107 type: OS::Neutron::FloatingIP
108 depends_on:
109 - internal_network_router_interface
110 properties:
111 floating_network: { get_param: public_network }
112 port_id: { get_resource: internal_network_vip }
113
114 external_network:
115 type: OS::Neutron::Net
116
117 external_subnet:
118 type: OS::Neutron::Subnet
119 properties:
120 network: { get_resource: external_network }
121 cidr: { get_param: external_cidr }
Michiel Piscaer97b7fd32022-03-17 12:15:21 +0100122 dns_nameservers: { get_param: nameservers }
Mohammed Naser336caf42022-03-11 17:56:45 -0500123 gateway_ip: null
okozachenko45fd72c2022-04-15 14:36:46 +1000124 allocation_pools:
125 - start: 10.96.250.100
126 end: 10.96.250.150
Mohammed Naser336caf42022-03-11 17:56:45 -0500127
128 external_network_vip:
129 type: OS::Neutron::Port
130 properties:
131 network: { get_resource: external_network }
132
133 key_pair:
134 type: OS::Nova::KeyPair
135 properties:
136 name: { get_param: OS::stack_id }
137 save_private_key: true
138
ricolin1139bb02023-03-21 23:45:40 +0800139 bastion_host:
140 type: server.yaml
141 condition: create_bastion_host
Mohammed Nasera01f9632023-05-04 13:32:59 +0000142 depends_on:
143 - internal_network_router_interface
ricolin1139bb02023-03-21 23:45:40 +0800144 properties:
145 name: bastion
146 index: -1
147 image: { get_param: image }
Oleksandr Kozachenkoc01ee522023-05-30 21:22:07 +0200148 instance_type: { get_param: bastion_instance_type }
ricolin1139bb02023-03-21 23:45:40 +0800149 key_name: { get_resource: key_pair }
150 internal_network: { get_resource: internal_network }
151 public_network: { get_param: public_network }
152 external_network: { get_resource: external_network }
153 boot_volumes_size: 40
154 boot_from_volume: { get_param: boot_from_volume }
155
Mohammed Naser336caf42022-03-11 17:56:45 -0500156 controller:
157 type: OS::Heat::ResourceGroup
158 depends_on:
159 - internal_network_router_interface
160 properties:
161 count: 3
162 resource_def:
163 type: server.yaml
164 properties:
165 name: ctl
166 index: "%index%"
167 image: { get_param: image }
Oleksandr Kozachenkoc01ee522023-05-30 21:22:07 +0200168 instance_type: { get_param: controller_instance_type }
Mohammed Naser336caf42022-03-11 17:56:45 -0500169 key_name: { get_resource: key_pair }
Mohammed Naser336caf42022-03-11 17:56:45 -0500170 internal_network: { get_resource: internal_network }
171 public_network: { get_param: public_network }
172 external_network: { get_resource: external_network }
ricolin703b2802022-05-16 02:29:26 +0800173 boot_volumes_size: 40
174 boot_from_volume: { get_param: boot_from_volume }
Mohammed Naser336caf42022-03-11 17:56:45 -0500175
176 storage:
177 type: OS::Heat::ResourceGroup
178 depends_on:
179 - internal_network_router_interface
180 properties:
181 count: 3
182 resource_def:
183 type: server.yaml
184 properties:
185 name: nvme
186 index: "%index%"
187 image: { get_param: image }
Oleksandr Kozachenkoc01ee522023-05-30 21:22:07 +0200188 instance_type: { get_param: storage_instance_type }
Mohammed Naser336caf42022-03-11 17:56:45 -0500189 key_name: { get_resource: key_pair }
Mohammed Naser336caf42022-03-11 17:56:45 -0500190 internal_network: { get_resource: internal_network }
191 public_network: { get_param: public_network }
192 external_network: { get_resource: external_network }
193 extra_volumes_count: 3
194 extra_volumes_size: 40
ricolin703b2802022-05-16 02:29:26 +0800195 boot_volumes_size: 40
196 boot_from_volume: { get_param: boot_from_volume }
Mohammed Naser336caf42022-03-11 17:56:45 -0500197
198 compute:
199 type: OS::Heat::ResourceGroup
200 depends_on:
201 - internal_network_router_interface
202 properties:
203 count: 2
204 resource_def:
205 type: server.yaml
206 properties:
207 name: kvm
208 index: "%index%"
209 image: { get_param: image }
Oleksandr Kozachenkoc01ee522023-05-30 21:22:07 +0200210 instance_type: { get_param: compute_instance_type }
Mohammed Naser336caf42022-03-11 17:56:45 -0500211 key_name: { get_resource: key_pair }
Mohammed Naser336caf42022-03-11 17:56:45 -0500212 internal_network: { get_resource: internal_network }
213 public_network: { get_param: public_network }
214 external_network: { get_resource: external_network }
ricolin703b2802022-05-16 02:29:26 +0800215 boot_volumes_size: 40
216 boot_from_volume: { get_param: boot_from_volume }
Mohammed Naser336caf42022-03-11 17:56:45 -0500217
218outputs:
219 controller_floating_ip_addresses:
220 value: { get_attr: [controller, floating_ip_address] }
221 storage_floating_ip_addresses:
222 value: { get_attr: [storage, floating_ip_address] }
223 compute_floating_ip_addresses:
224 value: { get_attr: [compute, floating_ip_address] }
225 key_pair:
226 value: { get_attr: [key_pair, private_key] }