Oleh Hryhorov | dccb1cd | 2020-03-04 15:52:55 +0200 | [diff] [blame] | 1 | heat_template_version: queens |
| 2 | |
| 3 | parameters: |
| 4 | |
| 5 | metadata: |
| 6 | type: json |
| 7 | default: {} |
| 8 | node_type: |
| 9 | type: string |
| 10 | key_name: |
| 11 | type: string |
| 12 | description: Name of keypair to assign to servers |
| 13 | image: |
| 14 | type: string |
| 15 | description: Name of image to use for servers |
| 16 | flavor: |
| 17 | type: string |
| 18 | description: Flavor to use for servers |
| 19 | accessible_network: |
| 20 | type: string |
| 21 | accessible_subnet_id: |
| 22 | type: string |
| 23 | private_floating_network: |
| 24 | type: string |
| 25 | private_floating_network_cidr: |
| 26 | type: string |
| 27 | private_floating_subnet_id: |
| 28 | type: string |
| 29 | private_floating_interface: |
| 30 | type: string |
| 31 | storage_backend_network_cidr: |
| 32 | type: string |
| 33 | storage_backend_network: |
| 34 | type: string |
| 35 | storage_backend_subnet_id: |
| 36 | type: string |
| 37 | storage_backend_interface: |
| 38 | type: string |
| 39 | storage_frontend_network: |
| 40 | type: string |
| 41 | storage_frontend_network_cidr: |
| 42 | type: string |
| 43 | storage_frontend_subnet_id: |
| 44 | type: string |
| 45 | storage_frontend_interface: |
| 46 | type: string |
Vasyl Saienko | 0fa6f19 | 2020-03-06 16:08:51 +0200 | [diff] [blame] | 47 | control_network_cidr: |
Oleh Hryhorov | dccb1cd | 2020-03-04 15:52:55 +0200 | [diff] [blame] | 48 | type: string |
Vasyl Saienko | 36f2edf | 2020-05-14 10:44:52 +0300 | [diff] [blame] | 49 | ironic_baremetal_network: |
| 50 | type: string |
| 51 | ironic_baremetal_subnet_id: |
| 52 | type: string |
Vasyl Saienko | 4c46819 | 2020-05-19 11:51:13 +0300 | [diff] [blame] | 53 | ironic_baremetal_network_cidr: |
Vasyl Saienko | 36f2edf | 2020-05-14 10:44:52 +0300 | [diff] [blame] | 54 | type: string |
Michael Polenchuk | 486cadf | 2020-08-24 16:25:51 +0400 | [diff] [blame] | 55 | ironic_baremetal_tunnel_cidr: |
| 56 | type: string |
| 57 | ironic_mt_enabled: |
| 58 | type: boolean |
Anton Samoylov | 13b055e | 2020-07-23 15:44:07 +0400 | [diff] [blame] | 59 | tungstenfabric_enabled: |
| 60 | type: boolean |
Oleh Hryhorov | e7feab4 | 2020-11-11 18:00:29 +0200 | [diff] [blame] | 61 | tun_network: |
Anton Samoylov | 13b055e | 2020-07-23 15:44:07 +0400 | [diff] [blame] | 62 | type: string |
Oleh Hryhorov | e7feab4 | 2020-11-11 18:00:29 +0200 | [diff] [blame] | 63 | tun_subnet_id: |
Anton Samoylov | 13b055e | 2020-07-23 15:44:07 +0400 | [diff] [blame] | 64 | type: string |
Oleh Hryhorov | dccb1cd | 2020-03-04 15:52:55 +0200 | [diff] [blame] | 65 | functions_override: |
| 66 | type: string |
| 67 | boot_timeout: |
| 68 | type: number |
| 69 | description: Boot timeout for instance |
Vasyl Saienko | f36f39c | 2020-03-10 00:21:42 +0200 | [diff] [blame] | 70 | default: 3600 |
Oleh Hryhorov | dccb1cd | 2020-03-04 15:52:55 +0200 | [diff] [blame] | 71 | ucp_master_host: |
| 72 | type: string |
| 73 | default: '' |
Vasyl Saienko | 84ee4fd | 2020-09-02 10:00:18 +0300 | [diff] [blame] | 74 | docker_ucp_image: |
| 75 | type: string |
Stepan Rogov | 60bc352 | 2020-12-16 17:43:25 +0300 | [diff] [blame] | 76 | docker_default_address_pool: |
| 77 | type: string |
Oleh Hryhorov | dccb1cd | 2020-03-04 15:52:55 +0200 | [diff] [blame] | 78 | public_net_id: |
| 79 | type: string |
| 80 | default: '' |
| 81 | docker_ee_release: |
| 82 | type: string |
| 83 | docker_ee_url: |
| 84 | type: string |
Vasyl Saienko | f9ee158 | 2020-03-02 16:53:41 +0200 | [diff] [blame] | 85 | hardware_metadata: |
| 86 | description: The content of lab metadata. |
| 87 | type: string |
Vasyl Saienko | 846c634 | 2021-02-24 17:01:36 +0200 | [diff] [blame^] | 88 | frr_bgp_neighbors: |
| 89 | description: Comma separated list of IP of BGP neighbors |
| 90 | default: '' |
| 91 | type: string |
Oleh Hryhorov | dccb1cd | 2020-03-04 15:52:55 +0200 | [diff] [blame] | 92 | |
| 93 | resources: |
| 94 | |
| 95 | software_config: |
| 96 | type: OS::Heat::SoftwareConfig |
| 97 | properties: |
| 98 | group: ungrouped |
| 99 | config: |
| 100 | str_replace: |
| 101 | template: { get_file: ../scripts/instance_boot.sh } |
| 102 | params: |
| 103 | $node_type: { get_param: node_type } |
| 104 | $wait_condition_notify: { get_attr: [ wait_handle, curl_cli ] } |
Oleh Hryhorov | dccb1cd | 2020-03-04 15:52:55 +0200 | [diff] [blame] | 105 | $docker_ee_url: { get_param: docker_ee_url } |
| 106 | $docker_ee_release: { get_param: docker_ee_release } |
| 107 | $ucp_master_host: { get_param: ucp_master_host } |
Vasyl Saienko | 84ee4fd | 2020-09-02 10:00:18 +0300 | [diff] [blame] | 108 | $docker_ucp_image: { get_param: docker_ucp_image } |
Stepan Rogov | 60bc352 | 2020-12-16 17:43:25 +0300 | [diff] [blame] | 109 | $docker_default_address_pool: { get_param: docker_default_address_pool } |
Oleh Hryhorov | dccb1cd | 2020-03-04 15:52:55 +0200 | [diff] [blame] | 110 | $node_metadata: { get_param: metadata } |
Vasyl Saienko | 0fa6f19 | 2020-03-06 16:08:51 +0200 | [diff] [blame] | 111 | $control_network_cidr: { get_param: control_network_cidr } |
Oleh Hryhorov | dccb1cd | 2020-03-04 15:52:55 +0200 | [diff] [blame] | 112 | $private_floating_interface: { get_param: private_floating_interface } |
| 113 | $private_floating_network_cidr: { get_param: private_floating_network_cidr } |
| 114 | $private_floating_interface_ip: { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] } |
| 115 | $functions_override: { get_param: functions_override } |
| 116 | $storage_frontend_interface: { get_param: storage_frontend_interface } |
| 117 | $storage_frontend_network_interface_ip: { get_attr: [storage_frontend_server_port, fixed_ips, 0, ip_address] } |
| 118 | $storage_frontend_network_cidr: { get_param: storage_frontend_network_cidr } |
| 119 | $storage_backend_interface: { get_param: storage_backend_interface } |
| 120 | $storage_backend_network_interface_ip: { get_attr: [storage_backend_server_port, fixed_ips, 0, ip_address] } |
| 121 | $storage_backend_network_cidr: { get_param: storage_backend_network_cidr } |
Vasyl Saienko | 36f2edf | 2020-05-14 10:44:52 +0300 | [diff] [blame] | 122 | $ironic_baremetal_interface_ip: { get_attr: [ironic_baremetal_server_port, fixed_ips, 0, ip_address] } |
Vasyl Saienko | 4c46819 | 2020-05-19 11:51:13 +0300 | [diff] [blame] | 123 | $ironic_baremetal_network_cidr: { get_param: ironic_baremetal_network_cidr } |
Michael Polenchuk | 486cadf | 2020-08-24 16:25:51 +0400 | [diff] [blame] | 124 | $ironic_baremetal_tunnel_cidr: { get_param: ironic_baremetal_tunnel_cidr } |
| 125 | $ironic_mt_enabled: { get_param: ironic_mt_enabled } |
Vasyl Saienko | 3dd0c27 | 2020-11-16 17:20:07 +0200 | [diff] [blame] | 126 | $tunnel_interface_ip: { get_attr: [tun_server_port, fixed_ips, 0, ip_address] } |
Vasyl Saienko | 846c634 | 2021-02-24 17:01:36 +0200 | [diff] [blame^] | 127 | $frr_bgp_neighbors: { get_param: frr_bgp_neighbors } |
Oleh Hryhorov | dccb1cd | 2020-03-04 15:52:55 +0200 | [diff] [blame] | 128 | |
Vasyl Saienko | f9ee158 | 2020-03-02 16:53:41 +0200 | [diff] [blame] | 129 | inject_files: |
| 130 | type: "OS::Heat::CloudConfig" |
| 131 | properties: |
| 132 | cloud_config: |
| 133 | write_files: |
| 134 | - path: /usr/sbin/prepare-metadata.py |
| 135 | owner: "root:root" |
| 136 | permissions: "0755" |
| 137 | content: {get_file: ../scripts/prepare-metadata.py} |
| 138 | - path: /usr/share/metadata/lab-metadata.yaml |
| 139 | owner: "root:root" |
| 140 | permissions: "0644" |
| 141 | content: { get_param: hardware_metadata} |
| 142 | |
| 143 | install_config_agent: |
| 144 | type: "OS::Heat::MultipartMime" |
| 145 | properties: |
| 146 | parts: |
| 147 | - config: {get_resource: software_config} |
| 148 | - config: {get_resource: inject_files} |
| 149 | |
Oleh Hryhorov | dccb1cd | 2020-03-04 15:52:55 +0200 | [diff] [blame] | 150 | server: |
| 151 | type: OS::Nova::Server |
| 152 | properties: |
| 153 | image: { get_param: image } |
| 154 | flavor: { get_param: flavor } |
| 155 | key_name: { get_param: key_name } |
| 156 | availability_zone: nova |
| 157 | networks: |
| 158 | - network: { get_param: accessible_network } |
| 159 | # NOTE(ohryhorov): connect to accessible network only as ironic doesn't |
| 160 | # support multitenancy use-case. Use private_floating_network for IPAM only. |
Vasyl Saienko | 36f2edf | 2020-05-14 10:44:52 +0300 | [diff] [blame] | 161 | # NOTE(vsaienko): ditto about ironic network |
Vasyl Saienko | f9ee158 | 2020-03-02 16:53:41 +0200 | [diff] [blame] | 162 | user_data_format: SOFTWARE_CONFIG |
| 163 | user_data: { get_resource: install_config_agent} |
Oleh Hryhorov | dccb1cd | 2020-03-04 15:52:55 +0200 | [diff] [blame] | 164 | metadata: { get_param: metadata } |
| 165 | |
| 166 | private_floating_server_port: |
| 167 | type: OS::Neutron::Port |
| 168 | properties: |
| 169 | network_id: { get_param: private_floating_network } |
| 170 | port_security_enabled: false |
| 171 | fixed_ips: |
| 172 | - subnet: { get_param: private_floating_subnet_id } |
| 173 | |
| 174 | storage_backend_server_port: |
| 175 | type: OS::Neutron::Port |
| 176 | properties: |
| 177 | network_id: { get_param: storage_backend_network } |
| 178 | port_security_enabled: false |
| 179 | fixed_ips: |
| 180 | - subnet: { get_param: storage_backend_subnet_id } |
| 181 | |
| 182 | storage_frontend_server_port: |
| 183 | type: OS::Neutron::Port |
| 184 | properties: |
| 185 | network_id: { get_param: storage_frontend_network } |
| 186 | port_security_enabled: false |
| 187 | fixed_ips: |
| 188 | - subnet: { get_param: storage_frontend_subnet_id } |
| 189 | |
Vasyl Saienko | 36f2edf | 2020-05-14 10:44:52 +0300 | [diff] [blame] | 190 | ironic_baremetal_server_port: |
| 191 | type: OS::Neutron::Port |
| 192 | properties: |
| 193 | network_id: { get_param: ironic_baremetal_network } |
| 194 | port_security_enabled: false |
| 195 | fixed_ips: |
| 196 | - subnet: { get_param: ironic_baremetal_subnet_id } |
| 197 | |
Oleh Hryhorov | e7feab4 | 2020-11-11 18:00:29 +0200 | [diff] [blame] | 198 | tun_server_port: |
Anton Samoylov | 13b055e | 2020-07-23 15:44:07 +0400 | [diff] [blame] | 199 | type: OS::Neutron::Port |
Anton Samoylov | 13b055e | 2020-07-23 15:44:07 +0400 | [diff] [blame] | 200 | properties: |
Oleh Hryhorov | e7feab4 | 2020-11-11 18:00:29 +0200 | [diff] [blame] | 201 | network_id: { get_param: tun_network } |
Anton Samoylov | 13b055e | 2020-07-23 15:44:07 +0400 | [diff] [blame] | 202 | port_security_enabled: false |
| 203 | fixed_ips: |
Oleh Hryhorov | e7feab4 | 2020-11-11 18:00:29 +0200 | [diff] [blame] | 204 | - subnet: { get_param: tun_subnet_id } |
Anton Samoylov | 13b055e | 2020-07-23 15:44:07 +0400 | [diff] [blame] | 205 | |
Oleh Hryhorov | dccb1cd | 2020-03-04 15:52:55 +0200 | [diff] [blame] | 206 | wait_handle: |
| 207 | type: OS::Heat::WaitConditionHandle |
| 208 | wait_condition: |
| 209 | type: OS::Heat::WaitCondition |
| 210 | properties: |
| 211 | handle: { get_resource: wait_handle } |
| 212 | timeout: { get_param: boot_timeout } |
| 213 | |
| 214 | |
| 215 | outputs: |
| 216 | server_private_ip: |
| 217 | description: IP address of server in private network |
| 218 | value: { get_attr: [server, networks, { get_param: accessible_network}, 0]} |
| 219 | server_private_floating_ip: |
| 220 | description: IP address of server in private floating network |
| 221 | value: { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] } |
Vasyl Saienko | 4e3f463 | 2020-05-26 14:43:09 +0300 | [diff] [blame] | 222 | server_ironic_baremetal_ip: |
| 223 | description: IP address of server in ironic baremetal network |
| 224 | value: { get_attr: [ironic_baremetal_server_port, fixed_ips, 0, ip_address] } |
Anton Samoylov | 13b055e | 2020-07-23 15:44:07 +0400 | [diff] [blame] | 225 | server_tf_data_ip: |
| 226 | description: IP address of server in tf data network |
Oleh Hryhorov | e7feab4 | 2020-11-11 18:00:29 +0200 | [diff] [blame] | 227 | value: { get_attr: [tun_server_port, fixed_ips, 0, ip_address] } |
Oleh Hryhorov | dccb1cd | 2020-03-04 15:52:55 +0200 | [diff] [blame] | 228 | server_public_ip: |
| 229 | description: Floating IP address of server in public network |
| 230 | value: { get_attr: [server, networks, { get_param: accessible_network}, 0]} |
Vasyl Saienko | 846c634 | 2021-02-24 17:01:36 +0200 | [diff] [blame^] | 231 | server_tun_ip: |
| 232 | description: IP address of server in tunnel network |
| 233 | value: { get_attr: [ tun_server_port, fixed_ips, 0, ip_address ] } |
Vasyl Saienko | f9ee158 | 2020-03-02 16:53:41 +0200 | [diff] [blame] | 234 | wc_data: |
| 235 | description: Metadata from instance |
| 236 | value: { get_attr: [wait_condition, data]} |