blob: 7232cc0331f4030eda896a4a6885e0de2e939fc9 [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
Mohammed Naser336caf42022-03-11 17:56:45 -050047 instance_type:
48 type: string
Mohammed Naser336caf42022-03-11 17:56:45 -050049 constraints:
50 - custom_constraint: nova.flavor
51
52resources:
Mohammed Naser336caf42022-03-11 17:56:45 -050053 router:
54 type: OS::Neutron::Router
55 properties:
56 external_gateway_info:
57 network: { get_param: public_network }
58
59 internal_network:
60 type: OS::Neutron::Net
61
62 internal_subnet:
63 type: OS::Neutron::Subnet
64 properties:
65 network: { get_resource: internal_network }
66 cidr: { get_param: internal_cidr }
Michiel Piscaer97b7fd32022-03-17 12:15:21 +010067 dns_nameservers: { get_param: nameservers }
Mohammed Naser336caf42022-03-11 17:56:45 -050068
69 internal_network_router_interface:
70 type: OS::Neutron::RouterInterface
71 properties:
72 router: { get_resource: router }
73 subnet: { get_resource: internal_subnet }
74
75 internal_network_vip:
76 type: OS::Neutron::Port
77 properties:
78 network: { get_resource: internal_network }
79
80 internal_network_vip_floating_ip:
81 type: OS::Neutron::FloatingIP
82 depends_on:
83 - internal_network_router_interface
84 properties:
85 floating_network: { get_param: public_network }
86 port_id: { get_resource: internal_network_vip }
87
88 external_network:
89 type: OS::Neutron::Net
90
91 external_subnet:
92 type: OS::Neutron::Subnet
93 properties:
94 network: { get_resource: external_network }
95 cidr: { get_param: external_cidr }
Michiel Piscaer97b7fd32022-03-17 12:15:21 +010096 dns_nameservers: { get_param: nameservers }
Mohammed Naser336caf42022-03-11 17:56:45 -050097 gateway_ip: null
okozachenko45fd72c2022-04-15 14:36:46 +100098 allocation_pools:
99 - start: 10.96.250.100
100 end: 10.96.250.150
Mohammed Naser336caf42022-03-11 17:56:45 -0500101
102 external_network_vip:
103 type: OS::Neutron::Port
104 properties:
105 network: { get_resource: external_network }
106
107 key_pair:
108 type: OS::Nova::KeyPair
109 properties:
110 name: { get_param: OS::stack_id }
111 save_private_key: true
112
113 controller:
114 type: OS::Heat::ResourceGroup
115 depends_on:
116 - internal_network_router_interface
117 properties:
118 count: 3
119 resource_def:
120 type: server.yaml
121 properties:
122 name: ctl
123 index: "%index%"
124 image: { get_param: image }
125 instance_type: { get_param: instance_type }
126 key_name: { get_resource: key_pair }
Mohammed Naser336caf42022-03-11 17:56:45 -0500127 internal_network: { get_resource: internal_network }
128 public_network: { get_param: public_network }
129 external_network: { get_resource: external_network }
ricolin703b2802022-05-16 02:29:26 +0800130 boot_volumes_size: 40
131 boot_from_volume: { get_param: boot_from_volume }
Mohammed Naser336caf42022-03-11 17:56:45 -0500132
133 storage:
134 type: OS::Heat::ResourceGroup
135 depends_on:
136 - internal_network_router_interface
137 properties:
138 count: 3
139 resource_def:
140 type: server.yaml
141 properties:
142 name: nvme
143 index: "%index%"
144 image: { get_param: image }
145 instance_type: { get_param: instance_type }
146 key_name: { get_resource: key_pair }
Mohammed Naser336caf42022-03-11 17:56:45 -0500147 internal_network: { get_resource: internal_network }
148 public_network: { get_param: public_network }
149 external_network: { get_resource: external_network }
150 extra_volumes_count: 3
151 extra_volumes_size: 40
ricolin703b2802022-05-16 02:29:26 +0800152 boot_volumes_size: 40
153 boot_from_volume: { get_param: boot_from_volume }
Mohammed Naser336caf42022-03-11 17:56:45 -0500154
155 compute:
156 type: OS::Heat::ResourceGroup
157 depends_on:
158 - internal_network_router_interface
159 properties:
160 count: 2
161 resource_def:
162 type: server.yaml
163 properties:
164 name: kvm
165 index: "%index%"
166 image: { get_param: image }
167 instance_type: { get_param: instance_type }
168 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
175outputs:
176 controller_floating_ip_addresses:
177 value: { get_attr: [controller, floating_ip_address] }
178 storage_floating_ip_addresses:
179 value: { get_attr: [storage, floating_ip_address] }
180 compute_floating_ip_addresses:
181 value: { get_attr: [compute, floating_ip_address] }
182 key_pair:
183 value: { get_attr: [key_pair, private_key] }