blob: 55b0bf76323ce5ac20b1ddd9548d179d72258fd7 [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:
Mohammed Naser336caf42022-03-11 17:56:45 -050049 router:
50 type: OS::Neutron::Router
51 properties:
52 external_gateway_info:
53 network: { get_param: public_network }
54
55 internal_network:
56 type: OS::Neutron::Net
57
58 internal_subnet:
59 type: OS::Neutron::Subnet
60 properties:
61 network: { get_resource: internal_network }
62 cidr: { get_param: internal_cidr }
Michiel Piscaer97b7fd32022-03-17 12:15:21 +010063 dns_nameservers: { get_param: nameservers }
Mohammed Naser336caf42022-03-11 17:56:45 -050064
65 internal_network_router_interface:
66 type: OS::Neutron::RouterInterface
67 properties:
68 router: { get_resource: router }
69 subnet: { get_resource: internal_subnet }
70
71 internal_network_vip:
72 type: OS::Neutron::Port
73 properties:
74 network: { get_resource: internal_network }
75
76 internal_network_vip_floating_ip:
77 type: OS::Neutron::FloatingIP
78 depends_on:
79 - internal_network_router_interface
80 properties:
81 floating_network: { get_param: public_network }
82 port_id: { get_resource: internal_network_vip }
83
84 external_network:
85 type: OS::Neutron::Net
86
87 external_subnet:
88 type: OS::Neutron::Subnet
89 properties:
90 network: { get_resource: external_network }
91 cidr: { get_param: external_cidr }
Michiel Piscaer97b7fd32022-03-17 12:15:21 +010092 dns_nameservers: { get_param: nameservers }
Mohammed Naser336caf42022-03-11 17:56:45 -050093 gateway_ip: null
okozachenko45fd72c2022-04-15 14:36:46 +100094 allocation_pools:
95 - start: 10.96.250.100
96 end: 10.96.250.150
Mohammed Naser336caf42022-03-11 17:56:45 -050097
98 external_network_vip:
99 type: OS::Neutron::Port
100 properties:
101 network: { get_resource: external_network }
102
103 key_pair:
104 type: OS::Nova::KeyPair
105 properties:
106 name: { get_param: OS::stack_id }
107 save_private_key: true
108
109 controller:
110 type: OS::Heat::ResourceGroup
111 depends_on:
112 - internal_network_router_interface
113 properties:
114 count: 3
115 resource_def:
116 type: server.yaml
117 properties:
118 name: ctl
119 index: "%index%"
120 image: { get_param: image }
121 instance_type: { get_param: instance_type }
122 key_name: { get_resource: key_pair }
Mohammed Naser336caf42022-03-11 17:56:45 -0500123 internal_network: { get_resource: internal_network }
124 public_network: { get_param: public_network }
125 external_network: { get_resource: external_network }
126
127 storage:
128 type: OS::Heat::ResourceGroup
129 depends_on:
130 - internal_network_router_interface
131 properties:
132 count: 3
133 resource_def:
134 type: server.yaml
135 properties:
136 name: nvme
137 index: "%index%"
138 image: { get_param: image }
139 instance_type: { get_param: instance_type }
140 key_name: { get_resource: key_pair }
Mohammed Naser336caf42022-03-11 17:56:45 -0500141 internal_network: { get_resource: internal_network }
142 public_network: { get_param: public_network }
143 external_network: { get_resource: external_network }
144 extra_volumes_count: 3
145 extra_volumes_size: 40
146
147 compute:
148 type: OS::Heat::ResourceGroup
149 depends_on:
150 - internal_network_router_interface
151 properties:
152 count: 2
153 resource_def:
154 type: server.yaml
155 properties:
156 name: kvm
157 index: "%index%"
158 image: { get_param: image }
159 instance_type: { get_param: instance_type }
160 key_name: { get_resource: key_pair }
Mohammed Naser336caf42022-03-11 17:56:45 -0500161 internal_network: { get_resource: internal_network }
162 public_network: { get_param: public_network }
163 external_network: { get_resource: external_network }
164
165outputs:
166 controller_floating_ip_addresses:
167 value: { get_attr: [controller, floating_ip_address] }
168 storage_floating_ip_addresses:
169 value: { get_attr: [storage, floating_ip_address] }
170 compute_floating_ip_addresses:
171 value: { get_attr: [compute, floating_ip_address] }
172 key_pair:
173 value: { get_attr: [key_pair, private_key] }