Mohammed Naser | 336caf4 | 2022-03-11 17:56:45 -0500 | [diff] [blame] | 1 | # 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 | |
| 15 | heat_template_version: 2016-10-14 |
| 16 | |
| 17 | parameters: |
| 18 | internal_cidr: |
| 19 | type: string |
| 20 | default: 10.96.240.0/24 |
| 21 | constraints: |
| 22 | - custom_constraint: net_cidr |
| 23 | |
Michiel Piscaer | 97b7fd3 | 2022-03-17 12:15:21 +0100 | [diff] [blame] | 24 | nameservers: |
| 25 | type: comma_delimited_list |
| 26 | |
Mohammed Naser | 336caf4 | 2022-03-11 17:56:45 -0500 | [diff] [blame] | 27 | 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 Naser | 336caf4 | 2022-03-11 17:56:45 -0500 | [diff] [blame] | 35 | constraints: |
| 36 | - custom_constraint: neutron.network |
| 37 | |
| 38 | image: |
| 39 | type: string |
Mohammed Naser | 336caf4 | 2022-03-11 17:56:45 -0500 | [diff] [blame] | 40 | constraints: |
| 41 | - custom_constraint: glance.image |
| 42 | |
ricolin | 703b280 | 2022-05-16 02:29:26 +0800 | [diff] [blame] | 43 | boot_from_volume: |
| 44 | type: boolean |
| 45 | default: false |
| 46 | |
Mohammed Naser | 336caf4 | 2022-03-11 17:56:45 -0500 | [diff] [blame] | 47 | instance_type: |
| 48 | type: string |
Mohammed Naser | 336caf4 | 2022-03-11 17:56:45 -0500 | [diff] [blame] | 49 | constraints: |
| 50 | - custom_constraint: nova.flavor |
| 51 | |
| 52 | resources: |
Mohammed Naser | 336caf4 | 2022-03-11 17:56:45 -0500 | [diff] [blame] | 53 | 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 Piscaer | 97b7fd3 | 2022-03-17 12:15:21 +0100 | [diff] [blame] | 67 | dns_nameservers: { get_param: nameservers } |
Mohammed Naser | 336caf4 | 2022-03-11 17:56:45 -0500 | [diff] [blame] | 68 | |
| 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 Piscaer | 97b7fd3 | 2022-03-17 12:15:21 +0100 | [diff] [blame] | 96 | dns_nameservers: { get_param: nameservers } |
Mohammed Naser | 336caf4 | 2022-03-11 17:56:45 -0500 | [diff] [blame] | 97 | gateway_ip: null |
okozachenko | 45fd72c | 2022-04-15 14:36:46 +1000 | [diff] [blame] | 98 | allocation_pools: |
| 99 | - start: 10.96.250.100 |
| 100 | end: 10.96.250.150 |
Mohammed Naser | 336caf4 | 2022-03-11 17:56:45 -0500 | [diff] [blame] | 101 | |
| 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 Naser | 336caf4 | 2022-03-11 17:56:45 -0500 | [diff] [blame] | 127 | internal_network: { get_resource: internal_network } |
| 128 | public_network: { get_param: public_network } |
| 129 | external_network: { get_resource: external_network } |
ricolin | 703b280 | 2022-05-16 02:29:26 +0800 | [diff] [blame] | 130 | boot_volumes_size: 40 |
| 131 | boot_from_volume: { get_param: boot_from_volume } |
Mohammed Naser | 336caf4 | 2022-03-11 17:56:45 -0500 | [diff] [blame] | 132 | |
| 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 Naser | 336caf4 | 2022-03-11 17:56:45 -0500 | [diff] [blame] | 147 | 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 |
ricolin | 703b280 | 2022-05-16 02:29:26 +0800 | [diff] [blame] | 152 | boot_volumes_size: 40 |
| 153 | boot_from_volume: { get_param: boot_from_volume } |
Mohammed Naser | 336caf4 | 2022-03-11 17:56:45 -0500 | [diff] [blame] | 154 | |
| 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 Naser | 336caf4 | 2022-03-11 17:56:45 -0500 | [diff] [blame] | 169 | internal_network: { get_resource: internal_network } |
| 170 | public_network: { get_param: public_network } |
| 171 | external_network: { get_resource: external_network } |
ricolin | 703b280 | 2022-05-16 02:29:26 +0800 | [diff] [blame] | 172 | boot_volumes_size: 40 |
| 173 | boot_from_volume: { get_param: boot_from_volume } |
Mohammed Naser | 336caf4 | 2022-03-11 17:56:45 -0500 | [diff] [blame] | 174 | |
| 175 | outputs: |
| 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] } |