blob: 5bd59dd819d431b3419c7efd30ad1178769c4000 [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
okozachenko45fd72c2022-04-15 14:36:46 +1000105 allocation_pools:
106 - start: 10.96.250.100
107 end: 10.96.250.150
Mohammed Naser336caf42022-03-11 17:56:45 -0500108
109 external_network_vip:
110 type: OS::Neutron::Port
111 properties:
112 network: { get_resource: external_network }
113
114 key_pair:
115 type: OS::Nova::KeyPair
116 properties:
117 name: { get_param: OS::stack_id }
118 save_private_key: true
119
120 controller:
121 type: OS::Heat::ResourceGroup
122 depends_on:
123 - internal_network_router_interface
124 properties:
125 count: 3
126 resource_def:
127 type: server.yaml
128 properties:
129 name: ctl
130 index: "%index%"
131 image: { get_param: image }
132 instance_type: { get_param: instance_type }
133 key_name: { get_resource: key_pair }
134 security_group: { get_resource: security_group }
135 internal_network: { get_resource: internal_network }
136 public_network: { get_param: public_network }
137 external_network: { get_resource: external_network }
138
139 storage:
140 type: OS::Heat::ResourceGroup
141 depends_on:
142 - internal_network_router_interface
143 properties:
144 count: 3
145 resource_def:
146 type: server.yaml
147 properties:
148 name: nvme
149 index: "%index%"
150 image: { get_param: image }
151 instance_type: { get_param: instance_type }
152 key_name: { get_resource: key_pair }
153 security_group: { get_resource: security_group }
154 internal_network: { get_resource: internal_network }
155 public_network: { get_param: public_network }
156 external_network: { get_resource: external_network }
157 extra_volumes_count: 3
158 extra_volumes_size: 40
159
160 compute:
161 type: OS::Heat::ResourceGroup
162 depends_on:
163 - internal_network_router_interface
164 properties:
165 count: 2
166 resource_def:
167 type: server.yaml
168 properties:
169 name: kvm
170 index: "%index%"
171 image: { get_param: image }
172 instance_type: { get_param: instance_type }
173 key_name: { get_resource: key_pair }
174 security_group: { get_resource: security_group }
175 internal_network: { get_resource: internal_network }
176 public_network: { get_param: public_network }
177 external_network: { get_resource: external_network }
178
179outputs:
180 controller_floating_ip_addresses:
181 value: { get_attr: [controller, floating_ip_address] }
182 storage_floating_ip_addresses:
183 value: { get_attr: [storage, floating_ip_address] }
184 compute_floating_ip_addresses:
185 value: { get_attr: [compute, floating_ip_address] }
186 key_pair:
187 value: { get_attr: [key_pair, private_key] }