blob: e40d43bdb62d984a255fea84a0dc741b96338402 [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
Oleksandr Kdc273472023-12-20 14:09:12 +010038 public_key_pair:
39 type: string
40
Mohammed Naser336caf42022-03-11 17:56:45 -050041 image:
42 type: string
Mohammed Naser336caf42022-03-11 17:56:45 -050043 constraints:
44 - custom_constraint: glance.image
45
ricolin703b2802022-05-16 02:29:26 +080046 boot_from_volume:
47 type: boolean
48 default: false
49
ricolin1139bb02023-03-21 23:45:40 +080050 create_bastion_host:
51 type: boolean
52 default: false
53
Oleksandr Kozachenkoc01ee522023-05-30 21:22:07 +020054 bastion_instance_type:
Oleksandr Kozachenkoc01ee522023-05-30 21:22:07 +020055 type: string
56 constraints:
57 - custom_constraint: nova.flavor
58
59 controller_instance_type:
60 type: string
61 constraints:
62 - custom_constraint: nova.flavor
63
64 compute_instance_type:
65 type: string
66 constraints:
67 - custom_constraint: nova.flavor
68
69 storage_instance_type:
Mohammed Naser336caf42022-03-11 17:56:45 -050070 type: string
Mohammed Naser336caf42022-03-11 17:56:45 -050071 constraints:
72 - custom_constraint: nova.flavor
73
ricolin1139bb02023-03-21 23:45:40 +080074conditions:
75 create_bastion_host:
76 equals:
77 - get_param: create_bastion_host
78 - true
79
Mohammed Naser336caf42022-03-11 17:56:45 -050080resources:
Mohammed Naser336caf42022-03-11 17:56:45 -050081 router:
82 type: OS::Neutron::Router
83 properties:
84 external_gateway_info:
85 network: { get_param: public_network }
86
87 internal_network:
88 type: OS::Neutron::Net
89
90 internal_subnet:
91 type: OS::Neutron::Subnet
92 properties:
93 network: { get_resource: internal_network }
94 cidr: { get_param: internal_cidr }
Michiel Piscaer97b7fd32022-03-17 12:15:21 +010095 dns_nameservers: { get_param: nameservers }
Mohammed Naser336caf42022-03-11 17:56:45 -050096
97 internal_network_router_interface:
98 type: OS::Neutron::RouterInterface
99 properties:
100 router: { get_resource: router }
101 subnet: { get_resource: internal_subnet }
102
103 internal_network_vip:
104 type: OS::Neutron::Port
105 properties:
106 network: { get_resource: internal_network }
107
108 internal_network_vip_floating_ip:
109 type: OS::Neutron::FloatingIP
110 depends_on:
111 - internal_network_router_interface
112 properties:
113 floating_network: { get_param: public_network }
114 port_id: { get_resource: internal_network_vip }
115
116 external_network:
117 type: OS::Neutron::Net
118
119 external_subnet:
120 type: OS::Neutron::Subnet
121 properties:
122 network: { get_resource: external_network }
123 cidr: { get_param: external_cidr }
Michiel Piscaer97b7fd32022-03-17 12:15:21 +0100124 dns_nameservers: { get_param: nameservers }
Mohammed Naser336caf42022-03-11 17:56:45 -0500125 gateway_ip: null
okozachenko45fd72c2022-04-15 14:36:46 +1000126 allocation_pools:
127 - start: 10.96.250.100
128 end: 10.96.250.150
Mohammed Naser336caf42022-03-11 17:56:45 -0500129
130 external_network_vip:
131 type: OS::Neutron::Port
132 properties:
133 network: { get_resource: external_network }
134
135 key_pair:
136 type: OS::Nova::KeyPair
137 properties:
138 name: { get_param: OS::stack_id }
Oleksandr Kdc273472023-12-20 14:09:12 +0100139 public_key: { get_param: public_key_pair }
Mohammed Naser336caf42022-03-11 17:56:45 -0500140
ricolin1139bb02023-03-21 23:45:40 +0800141 bastion_host:
142 type: server.yaml
143 condition: create_bastion_host
Mohammed Nasera01f9632023-05-04 13:32:59 +0000144 depends_on:
145 - internal_network_router_interface
ricolin1139bb02023-03-21 23:45:40 +0800146 properties:
147 name: bastion
148 index: -1
149 image: { get_param: image }
Oleksandr Kozachenkoc01ee522023-05-30 21:22:07 +0200150 instance_type: { get_param: bastion_instance_type }
ricolin1139bb02023-03-21 23:45:40 +0800151 key_name: { get_resource: key_pair }
152 internal_network: { get_resource: internal_network }
153 public_network: { get_param: public_network }
154 external_network: { get_resource: external_network }
155 boot_volumes_size: 40
156 boot_from_volume: { get_param: boot_from_volume }
157
Mohammed Naser336caf42022-03-11 17:56:45 -0500158 controller:
159 type: OS::Heat::ResourceGroup
160 depends_on:
161 - internal_network_router_interface
162 properties:
163 count: 3
164 resource_def:
165 type: server.yaml
166 properties:
167 name: ctl
168 index: "%index%"
169 image: { get_param: image }
Oleksandr Kozachenkoc01ee522023-05-30 21:22:07 +0200170 instance_type: { get_param: controller_instance_type }
Mohammed Naser336caf42022-03-11 17:56:45 -0500171 key_name: { get_resource: key_pair }
Mohammed Naser336caf42022-03-11 17:56:45 -0500172 internal_network: { get_resource: internal_network }
173 public_network: { get_param: public_network }
174 external_network: { get_resource: external_network }
ricolin703b2802022-05-16 02:29:26 +0800175 boot_volumes_size: 40
176 boot_from_volume: { get_param: boot_from_volume }
Mohammed Naser336caf42022-03-11 17:56:45 -0500177
178 storage:
179 type: OS::Heat::ResourceGroup
180 depends_on:
181 - internal_network_router_interface
182 properties:
183 count: 3
184 resource_def:
185 type: server.yaml
186 properties:
187 name: nvme
188 index: "%index%"
189 image: { get_param: image }
Oleksandr Kozachenkoc01ee522023-05-30 21:22:07 +0200190 instance_type: { get_param: storage_instance_type }
Mohammed Naser336caf42022-03-11 17:56:45 -0500191 key_name: { get_resource: key_pair }
Mohammed Naser336caf42022-03-11 17:56:45 -0500192 internal_network: { get_resource: internal_network }
193 public_network: { get_param: public_network }
194 external_network: { get_resource: external_network }
195 extra_volumes_count: 3
196 extra_volumes_size: 40
ricolin703b2802022-05-16 02:29:26 +0800197 boot_volumes_size: 40
198 boot_from_volume: { get_param: boot_from_volume }
Mohammed Naser336caf42022-03-11 17:56:45 -0500199
200 compute:
201 type: OS::Heat::ResourceGroup
202 depends_on:
203 - internal_network_router_interface
204 properties:
205 count: 2
206 resource_def:
207 type: server.yaml
208 properties:
209 name: kvm
210 index: "%index%"
211 image: { get_param: image }
Oleksandr Kozachenkoc01ee522023-05-30 21:22:07 +0200212 instance_type: { get_param: compute_instance_type }
Mohammed Naser336caf42022-03-11 17:56:45 -0500213 key_name: { get_resource: key_pair }
Mohammed Naser336caf42022-03-11 17:56:45 -0500214 internal_network: { get_resource: internal_network }
215 public_network: { get_param: public_network }
216 external_network: { get_resource: external_network }
ricolin703b2802022-05-16 02:29:26 +0800217 boot_volumes_size: 40
218 boot_from_volume: { get_param: boot_from_volume }
Mohammed Naser336caf42022-03-11 17:56:45 -0500219
220outputs:
221 controller_floating_ip_addresses:
222 value: { get_attr: [controller, floating_ip_address] }
223 storage_floating_ip_addresses:
224 value: { get_attr: [storage, floating_ip_address] }
225 compute_floating_ip_addresses:
226 value: { get_attr: [compute, floating_ip_address] }