blob: baad7da8e7a1ef0af1fd4943f63e664342797ac2 [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
Mohammed Naser336caf42022-03-11 17:56:45 -050051 instance_type:
52 type: string
Mohammed Naser336caf42022-03-11 17:56:45 -050053 constraints:
54 - custom_constraint: nova.flavor
55
ricolin1139bb02023-03-21 23:45:40 +080056conditions:
57 create_bastion_host:
58 equals:
59 - get_param: create_bastion_host
60 - true
61
Mohammed Naser336caf42022-03-11 17:56:45 -050062resources:
Mohammed Naser336caf42022-03-11 17:56:45 -050063 router:
64 type: OS::Neutron::Router
65 properties:
66 external_gateway_info:
67 network: { get_param: public_network }
68
69 internal_network:
70 type: OS::Neutron::Net
71
72 internal_subnet:
73 type: OS::Neutron::Subnet
74 properties:
75 network: { get_resource: internal_network }
76 cidr: { get_param: internal_cidr }
Michiel Piscaer97b7fd32022-03-17 12:15:21 +010077 dns_nameservers: { get_param: nameservers }
Mohammed Naser336caf42022-03-11 17:56:45 -050078
79 internal_network_router_interface:
80 type: OS::Neutron::RouterInterface
81 properties:
82 router: { get_resource: router }
83 subnet: { get_resource: internal_subnet }
84
85 internal_network_vip:
86 type: OS::Neutron::Port
87 properties:
88 network: { get_resource: internal_network }
89
90 internal_network_vip_floating_ip:
91 type: OS::Neutron::FloatingIP
92 depends_on:
93 - internal_network_router_interface
94 properties:
95 floating_network: { get_param: public_network }
96 port_id: { get_resource: internal_network_vip }
97
98 external_network:
99 type: OS::Neutron::Net
100
101 external_subnet:
102 type: OS::Neutron::Subnet
103 properties:
104 network: { get_resource: external_network }
105 cidr: { get_param: external_cidr }
Michiel Piscaer97b7fd32022-03-17 12:15:21 +0100106 dns_nameservers: { get_param: nameservers }
Mohammed Naser336caf42022-03-11 17:56:45 -0500107 gateway_ip: null
okozachenko45fd72c2022-04-15 14:36:46 +1000108 allocation_pools:
109 - start: 10.96.250.100
110 end: 10.96.250.150
Mohammed Naser336caf42022-03-11 17:56:45 -0500111
112 external_network_vip:
113 type: OS::Neutron::Port
114 properties:
115 network: { get_resource: external_network }
116
117 key_pair:
118 type: OS::Nova::KeyPair
119 properties:
120 name: { get_param: OS::stack_id }
121 save_private_key: true
122
ricolin1139bb02023-03-21 23:45:40 +0800123 bastion_host:
124 type: server.yaml
125 condition: create_bastion_host
126 properties:
127 name: bastion
128 index: -1
129 image: { get_param: image }
130 instance_type: { get_param: instance_type }
131 key_name: { get_resource: key_pair }
132 internal_network: { get_resource: internal_network }
133 public_network: { get_param: public_network }
134 external_network: { get_resource: external_network }
135 boot_volumes_size: 40
136 boot_from_volume: { get_param: boot_from_volume }
137
Mohammed Naser336caf42022-03-11 17:56:45 -0500138 controller:
139 type: OS::Heat::ResourceGroup
140 depends_on:
141 - internal_network_router_interface
142 properties:
143 count: 3
144 resource_def:
145 type: server.yaml
146 properties:
147 name: ctl
148 index: "%index%"
149 image: { get_param: image }
150 instance_type: { get_param: instance_type }
151 key_name: { get_resource: key_pair }
Mohammed Naser336caf42022-03-11 17:56:45 -0500152 internal_network: { get_resource: internal_network }
153 public_network: { get_param: public_network }
154 external_network: { get_resource: external_network }
ricolin703b2802022-05-16 02:29:26 +0800155 boot_volumes_size: 40
156 boot_from_volume: { get_param: boot_from_volume }
Mohammed Naser336caf42022-03-11 17:56:45 -0500157
158 storage:
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: nvme
168 index: "%index%"
169 image: { get_param: image }
170 instance_type: { get_param: instance_type }
171 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 }
175 extra_volumes_count: 3
176 extra_volumes_size: 40
ricolin703b2802022-05-16 02:29:26 +0800177 boot_volumes_size: 40
178 boot_from_volume: { get_param: boot_from_volume }
Mohammed Naser336caf42022-03-11 17:56:45 -0500179
180 compute:
181 type: OS::Heat::ResourceGroup
182 depends_on:
183 - internal_network_router_interface
184 properties:
185 count: 2
186 resource_def:
187 type: server.yaml
188 properties:
189 name: kvm
190 index: "%index%"
191 image: { get_param: image }
192 instance_type: { get_param: instance_type }
193 key_name: { get_resource: key_pair }
Mohammed Naser336caf42022-03-11 17:56:45 -0500194 internal_network: { get_resource: internal_network }
195 public_network: { get_param: public_network }
196 external_network: { get_resource: external_network }
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
200outputs:
201 controller_floating_ip_addresses:
202 value: { get_attr: [controller, floating_ip_address] }
203 storage_floating_ip_addresses:
204 value: { get_attr: [storage, floating_ip_address] }
205 compute_floating_ip_addresses:
206 value: { get_attr: [compute, floating_ip_address] }
207 key_pair:
208 value: { get_attr: [key_pair, private_key] }