blob: c5b171f2ae62220d1626959e5f12ef58f99faaa9 [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:
Oleksandr Kozachenkoc01ee522023-05-30 21:22:07 +020052 type: string
53 constraints:
54 - custom_constraint: nova.flavor
55
56 controller_instance_type:
57 type: string
58 constraints:
59 - custom_constraint: nova.flavor
60
61 compute_instance_type:
62 type: string
63 constraints:
64 - custom_constraint: nova.flavor
65
66 storage_instance_type:
Mohammed Naser336caf42022-03-11 17:56:45 -050067 type: string
Mohammed Naser336caf42022-03-11 17:56:45 -050068 constraints:
69 - custom_constraint: nova.flavor
70
ricolin1139bb02023-03-21 23:45:40 +080071conditions:
72 create_bastion_host:
73 equals:
74 - get_param: create_bastion_host
75 - true
76
Mohammed Naser336caf42022-03-11 17:56:45 -050077resources:
Mohammed Naser336caf42022-03-11 17:56:45 -050078 router:
79 type: OS::Neutron::Router
80 properties:
81 external_gateway_info:
82 network: { get_param: public_network }
83
84 internal_network:
85 type: OS::Neutron::Net
86
87 internal_subnet:
88 type: OS::Neutron::Subnet
89 properties:
90 network: { get_resource: internal_network }
91 cidr: { get_param: internal_cidr }
Michiel Piscaer97b7fd32022-03-17 12:15:21 +010092 dns_nameservers: { get_param: nameservers }
Mohammed Naser336caf42022-03-11 17:56:45 -050093
94 internal_network_router_interface:
95 type: OS::Neutron::RouterInterface
96 properties:
97 router: { get_resource: router }
98 subnet: { get_resource: internal_subnet }
99
100 internal_network_vip:
101 type: OS::Neutron::Port
102 properties:
103 network: { get_resource: internal_network }
104
105 internal_network_vip_floating_ip:
106 type: OS::Neutron::FloatingIP
107 depends_on:
108 - internal_network_router_interface
109 properties:
110 floating_network: { get_param: public_network }
111 port_id: { get_resource: internal_network_vip }
112
113 external_network:
114 type: OS::Neutron::Net
115
116 external_subnet:
117 type: OS::Neutron::Subnet
118 properties:
119 network: { get_resource: external_network }
120 cidr: { get_param: external_cidr }
Michiel Piscaer97b7fd32022-03-17 12:15:21 +0100121 dns_nameservers: { get_param: nameservers }
Mohammed Naser336caf42022-03-11 17:56:45 -0500122 gateway_ip: null
okozachenko45fd72c2022-04-15 14:36:46 +1000123 allocation_pools:
124 - start: 10.96.250.100
125 end: 10.96.250.150
Mohammed Naser336caf42022-03-11 17:56:45 -0500126
127 external_network_vip:
128 type: OS::Neutron::Port
129 properties:
130 network: { get_resource: external_network }
131
132 key_pair:
133 type: OS::Nova::KeyPair
134 properties:
135 name: { get_param: OS::stack_id }
136 save_private_key: true
137
ricolin1139bb02023-03-21 23:45:40 +0800138 bastion_host:
139 type: server.yaml
140 condition: create_bastion_host
Mohammed Nasera01f9632023-05-04 13:32:59 +0000141 depends_on:
142 - internal_network_router_interface
ricolin1139bb02023-03-21 23:45:40 +0800143 properties:
144 name: bastion
145 index: -1
146 image: { get_param: image }
Oleksandr Kozachenkoc01ee522023-05-30 21:22:07 +0200147 instance_type: { get_param: bastion_instance_type }
ricolin1139bb02023-03-21 23:45:40 +0800148 key_name: { get_resource: key_pair }
149 internal_network: { get_resource: internal_network }
150 public_network: { get_param: public_network }
151 external_network: { get_resource: external_network }
152 boot_volumes_size: 40
153 boot_from_volume: { get_param: boot_from_volume }
154
Mohammed Naser336caf42022-03-11 17:56:45 -0500155 controller:
156 type: OS::Heat::ResourceGroup
157 depends_on:
158 - internal_network_router_interface
159 properties:
160 count: 3
161 resource_def:
162 type: server.yaml
163 properties:
164 name: ctl
165 index: "%index%"
166 image: { get_param: image }
Oleksandr Kozachenkoc01ee522023-05-30 21:22:07 +0200167 instance_type: { get_param: controller_instance_type }
Mohammed Naser336caf42022-03-11 17:56:45 -0500168 key_name: { get_resource: key_pair }
Mohammed Naser336caf42022-03-11 17:56:45 -0500169 internal_network: { get_resource: internal_network }
170 public_network: { get_param: public_network }
171 external_network: { get_resource: external_network }
ricolin703b2802022-05-16 02:29:26 +0800172 boot_volumes_size: 40
173 boot_from_volume: { get_param: boot_from_volume }
Mohammed Naser336caf42022-03-11 17:56:45 -0500174
175 storage:
176 type: OS::Heat::ResourceGroup
177 depends_on:
178 - internal_network_router_interface
179 properties:
180 count: 3
181 resource_def:
182 type: server.yaml
183 properties:
184 name: nvme
185 index: "%index%"
186 image: { get_param: image }
Oleksandr Kozachenkoc01ee522023-05-30 21:22:07 +0200187 instance_type: { get_param: storage_instance_type }
Mohammed Naser336caf42022-03-11 17:56:45 -0500188 key_name: { get_resource: key_pair }
Mohammed Naser336caf42022-03-11 17:56:45 -0500189 internal_network: { get_resource: internal_network }
190 public_network: { get_param: public_network }
191 external_network: { get_resource: external_network }
192 extra_volumes_count: 3
193 extra_volumes_size: 40
ricolin703b2802022-05-16 02:29:26 +0800194 boot_volumes_size: 40
195 boot_from_volume: { get_param: boot_from_volume }
Mohammed Naser336caf42022-03-11 17:56:45 -0500196
197 compute:
198 type: OS::Heat::ResourceGroup
199 depends_on:
200 - internal_network_router_interface
201 properties:
202 count: 2
203 resource_def:
204 type: server.yaml
205 properties:
206 name: kvm
207 index: "%index%"
208 image: { get_param: image }
Oleksandr Kozachenkoc01ee522023-05-30 21:22:07 +0200209 instance_type: { get_param: compute_instance_type }
Mohammed Naser336caf42022-03-11 17:56:45 -0500210 key_name: { get_resource: key_pair }
Mohammed Naser336caf42022-03-11 17:56:45 -0500211 internal_network: { get_resource: internal_network }
212 public_network: { get_param: public_network }
213 external_network: { get_resource: external_network }
ricolin703b2802022-05-16 02:29:26 +0800214 boot_volumes_size: 40
215 boot_from_volume: { get_param: boot_from_volume }
Mohammed Naser336caf42022-03-11 17:56:45 -0500216
217outputs:
218 controller_floating_ip_addresses:
219 value: { get_attr: [controller, floating_ip_address] }
220 storage_floating_ip_addresses:
221 value: { get_attr: [storage, floating_ip_address] }
222 compute_floating_ip_addresses:
223 value: { get_attr: [compute, floating_ip_address] }
224 key_pair:
225 value: { get_attr: [key_pair, private_key] }