blob: 113ddb8e2776887091f78fba7cb5c6f5ef0fd7ce [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
43 instance_type:
44 type: string
Mohammed Naser336caf42022-03-11 17:56:45 -050045 constraints:
46 - custom_constraint: nova.flavor
47
48resources:
49 security_group:
50 type: OS::Neutron::SecurityGroup
51 properties:
52 rules:
53 - protocol: tcp
54 remote_ip_prefix: 0.0.0.0/0
55 - protocol: udp
56 remote_ip_prefix: 0.0.0.0/0
57 - protocol: icmp
58 remote_ip_prefix: 0.0.0.0/0
59
60 router:
61 type: OS::Neutron::Router
62 properties:
63 external_gateway_info:
64 network: { get_param: public_network }
65
66 internal_network:
67 type: OS::Neutron::Net
68
69 internal_subnet:
70 type: OS::Neutron::Subnet
71 properties:
72 network: { get_resource: internal_network }
73 cidr: { get_param: internal_cidr }
Michiel Piscaer97b7fd32022-03-17 12:15:21 +010074 dns_nameservers: { get_param: nameservers }
Mohammed Naser336caf42022-03-11 17:56:45 -050075
76 internal_network_router_interface:
77 type: OS::Neutron::RouterInterface
78 properties:
79 router: { get_resource: router }
80 subnet: { get_resource: internal_subnet }
81
82 internal_network_vip:
83 type: OS::Neutron::Port
84 properties:
85 network: { get_resource: internal_network }
86
87 internal_network_vip_floating_ip:
88 type: OS::Neutron::FloatingIP
89 depends_on:
90 - internal_network_router_interface
91 properties:
92 floating_network: { get_param: public_network }
93 port_id: { get_resource: internal_network_vip }
94
95 external_network:
96 type: OS::Neutron::Net
97
98 external_subnet:
99 type: OS::Neutron::Subnet
100 properties:
101 network: { get_resource: external_network }
102 cidr: { get_param: external_cidr }
Michiel Piscaer97b7fd32022-03-17 12:15:21 +0100103 dns_nameservers: { get_param: nameservers }
Mohammed Naser336caf42022-03-11 17:56:45 -0500104 gateway_ip: null
105
106 external_network_vip:
107 type: OS::Neutron::Port
108 properties:
109 network: { get_resource: external_network }
110
111 key_pair:
112 type: OS::Nova::KeyPair
113 properties:
114 name: { get_param: OS::stack_id }
115 save_private_key: true
116
117 controller:
118 type: OS::Heat::ResourceGroup
119 depends_on:
120 - internal_network_router_interface
121 properties:
122 count: 3
123 resource_def:
124 type: server.yaml
125 properties:
126 name: ctl
127 index: "%index%"
128 image: { get_param: image }
129 instance_type: { get_param: instance_type }
130 key_name: { get_resource: key_pair }
131 security_group: { get_resource: security_group }
132 internal_network: { get_resource: internal_network }
133 public_network: { get_param: public_network }
134 external_network: { get_resource: external_network }
135
136 storage:
137 type: OS::Heat::ResourceGroup
138 depends_on:
139 - internal_network_router_interface
140 properties:
141 count: 3
142 resource_def:
143 type: server.yaml
144 properties:
145 name: nvme
146 index: "%index%"
147 image: { get_param: image }
148 instance_type: { get_param: instance_type }
149 key_name: { get_resource: key_pair }
150 security_group: { get_resource: security_group }
151 internal_network: { get_resource: internal_network }
152 public_network: { get_param: public_network }
153 external_network: { get_resource: external_network }
154 extra_volumes_count: 3
155 extra_volumes_size: 40
156
157 compute:
158 type: OS::Heat::ResourceGroup
159 depends_on:
160 - internal_network_router_interface
161 properties:
162 count: 2
163 resource_def:
164 type: server.yaml
165 properties:
166 name: kvm
167 index: "%index%"
168 image: { get_param: image }
169 instance_type: { get_param: instance_type }
170 key_name: { get_resource: key_pair }
171 security_group: { get_resource: security_group }
172 internal_network: { get_resource: internal_network }
173 public_network: { get_param: public_network }
174 external_network: { get_resource: external_network }
175
176outputs:
177 controller_floating_ip_addresses:
178 value: { get_attr: [controller, floating_ip_address] }
179 storage_floating_ip_addresses:
180 value: { get_attr: [storage, floating_ip_address] }
181 compute_floating_ip_addresses:
182 value: { get_attr: [compute, floating_ip_address] }
183 key_pair:
184 value: { get_attr: [key_pair, private_key] }