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 |
Anton Samoylov | 13b055e | 2020-07-23 15:44:07 +0400 | [diff] [blame] | 55 | tungstenfabric_enabled: |
| 56 | type: boolean |
| 57 | tf_data_network: |
| 58 | type: string |
| 59 | tf_data_subnet_id: |
| 60 | type: string |
Oleh Hryhorov | dccb1cd | 2020-03-04 15:52:55 +0200 | [diff] [blame] | 61 | functions_override: |
| 62 | type: string |
| 63 | boot_timeout: |
| 64 | type: number |
| 65 | description: Boot timeout for instance |
Vasyl Saienko | f36f39c | 2020-03-10 00:21:42 +0200 | [diff] [blame] | 66 | default: 3600 |
Oleh Hryhorov | dccb1cd | 2020-03-04 15:52:55 +0200 | [diff] [blame] | 67 | ucp_master_host: |
| 68 | type: string |
| 69 | default: '' |
Vasyl Saienko | 84ee4fd | 2020-09-02 10:00:18 +0300 | [diff] [blame] | 70 | docker_ucp_image: |
| 71 | type: string |
Oleh Hryhorov | dccb1cd | 2020-03-04 15:52:55 +0200 | [diff] [blame] | 72 | public_net_id: |
| 73 | type: string |
| 74 | default: '' |
| 75 | docker_ee_release: |
| 76 | type: string |
| 77 | docker_ee_url: |
| 78 | type: string |
Vasyl Saienko | f9ee158 | 2020-03-02 16:53:41 +0200 | [diff] [blame] | 79 | hardware_metadata: |
| 80 | description: The content of lab metadata. |
| 81 | type: string |
Oleh Hryhorov | dccb1cd | 2020-03-04 15:52:55 +0200 | [diff] [blame] | 82 | |
Anton Samoylov | 13b055e | 2020-07-23 15:44:07 +0400 | [diff] [blame] | 83 | conditions: |
| 84 | create_tf_data_network_res: |
| 85 | get_param: tungstenfabric_enabled |
| 86 | |
Oleh Hryhorov | dccb1cd | 2020-03-04 15:52:55 +0200 | [diff] [blame] | 87 | resources: |
| 88 | |
| 89 | software_config: |
| 90 | type: OS::Heat::SoftwareConfig |
| 91 | properties: |
| 92 | group: ungrouped |
| 93 | config: |
| 94 | str_replace: |
| 95 | template: { get_file: ../scripts/instance_boot.sh } |
| 96 | params: |
| 97 | $node_type: { get_param: node_type } |
| 98 | $wait_condition_notify: { get_attr: [ wait_handle, curl_cli ] } |
Oleh Hryhorov | dccb1cd | 2020-03-04 15:52:55 +0200 | [diff] [blame] | 99 | $docker_ee_url: { get_param: docker_ee_url } |
| 100 | $docker_ee_release: { get_param: docker_ee_release } |
| 101 | $ucp_master_host: { get_param: ucp_master_host } |
Vasyl Saienko | 84ee4fd | 2020-09-02 10:00:18 +0300 | [diff] [blame] | 102 | $docker_ucp_image: { get_param: docker_ucp_image } |
Oleh Hryhorov | dccb1cd | 2020-03-04 15:52:55 +0200 | [diff] [blame] | 103 | $node_metadata: { get_param: metadata } |
Vasyl Saienko | 0fa6f19 | 2020-03-06 16:08:51 +0200 | [diff] [blame] | 104 | $control_network_cidr: { get_param: control_network_cidr } |
Oleh Hryhorov | dccb1cd | 2020-03-04 15:52:55 +0200 | [diff] [blame] | 105 | $private_floating_interface: { get_param: private_floating_interface } |
| 106 | $private_floating_network_cidr: { get_param: private_floating_network_cidr } |
| 107 | $private_floating_interface_ip: { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] } |
| 108 | $functions_override: { get_param: functions_override } |
| 109 | $storage_frontend_interface: { get_param: storage_frontend_interface } |
| 110 | $storage_frontend_network_interface_ip: { get_attr: [storage_frontend_server_port, fixed_ips, 0, ip_address] } |
| 111 | $storage_frontend_network_cidr: { get_param: storage_frontend_network_cidr } |
| 112 | $storage_backend_interface: { get_param: storage_backend_interface } |
| 113 | $storage_backend_network_interface_ip: { get_attr: [storage_backend_server_port, fixed_ips, 0, ip_address] } |
| 114 | $storage_backend_network_cidr: { get_param: storage_backend_network_cidr } |
Vasyl Saienko | 36f2edf | 2020-05-14 10:44:52 +0300 | [diff] [blame] | 115 | $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] | 116 | $ironic_baremetal_network_cidr: { get_param: ironic_baremetal_network_cidr } |
Oleh Hryhorov | dccb1cd | 2020-03-04 15:52:55 +0200 | [diff] [blame] | 117 | |
Vasyl Saienko | f9ee158 | 2020-03-02 16:53:41 +0200 | [diff] [blame] | 118 | inject_files: |
| 119 | type: "OS::Heat::CloudConfig" |
| 120 | properties: |
| 121 | cloud_config: |
| 122 | write_files: |
| 123 | - path: /usr/sbin/prepare-metadata.py |
| 124 | owner: "root:root" |
| 125 | permissions: "0755" |
| 126 | content: {get_file: ../scripts/prepare-metadata.py} |
| 127 | - path: /usr/share/metadata/lab-metadata.yaml |
| 128 | owner: "root:root" |
| 129 | permissions: "0644" |
| 130 | content: { get_param: hardware_metadata} |
| 131 | |
| 132 | install_config_agent: |
| 133 | type: "OS::Heat::MultipartMime" |
| 134 | properties: |
| 135 | parts: |
| 136 | - config: {get_resource: software_config} |
| 137 | - config: {get_resource: inject_files} |
| 138 | |
Oleh Hryhorov | dccb1cd | 2020-03-04 15:52:55 +0200 | [diff] [blame] | 139 | server: |
| 140 | type: OS::Nova::Server |
| 141 | properties: |
| 142 | image: { get_param: image } |
| 143 | flavor: { get_param: flavor } |
| 144 | key_name: { get_param: key_name } |
| 145 | availability_zone: nova |
| 146 | networks: |
| 147 | - network: { get_param: accessible_network } |
| 148 | # NOTE(ohryhorov): connect to accessible network only as ironic doesn't |
| 149 | # support multitenancy use-case. Use private_floating_network for IPAM only. |
Vasyl Saienko | 36f2edf | 2020-05-14 10:44:52 +0300 | [diff] [blame] | 150 | # NOTE(vsaienko): ditto about ironic network |
Vasyl Saienko | f9ee158 | 2020-03-02 16:53:41 +0200 | [diff] [blame] | 151 | user_data_format: SOFTWARE_CONFIG |
| 152 | user_data: { get_resource: install_config_agent} |
Oleh Hryhorov | dccb1cd | 2020-03-04 15:52:55 +0200 | [diff] [blame] | 153 | metadata: { get_param: metadata } |
| 154 | |
| 155 | private_floating_server_port: |
| 156 | type: OS::Neutron::Port |
| 157 | properties: |
| 158 | network_id: { get_param: private_floating_network } |
| 159 | port_security_enabled: false |
| 160 | fixed_ips: |
| 161 | - subnet: { get_param: private_floating_subnet_id } |
| 162 | |
| 163 | storage_backend_server_port: |
| 164 | type: OS::Neutron::Port |
| 165 | properties: |
| 166 | network_id: { get_param: storage_backend_network } |
| 167 | port_security_enabled: false |
| 168 | fixed_ips: |
| 169 | - subnet: { get_param: storage_backend_subnet_id } |
| 170 | |
| 171 | storage_frontend_server_port: |
| 172 | type: OS::Neutron::Port |
| 173 | properties: |
| 174 | network_id: { get_param: storage_frontend_network } |
| 175 | port_security_enabled: false |
| 176 | fixed_ips: |
| 177 | - subnet: { get_param: storage_frontend_subnet_id } |
| 178 | |
Vasyl Saienko | 36f2edf | 2020-05-14 10:44:52 +0300 | [diff] [blame] | 179 | ironic_baremetal_server_port: |
| 180 | type: OS::Neutron::Port |
| 181 | properties: |
| 182 | network_id: { get_param: ironic_baremetal_network } |
| 183 | port_security_enabled: false |
| 184 | fixed_ips: |
| 185 | - subnet: { get_param: ironic_baremetal_subnet_id } |
| 186 | |
Anton Samoylov | 13b055e | 2020-07-23 15:44:07 +0400 | [diff] [blame] | 187 | tf_data_server_port: |
| 188 | type: OS::Neutron::Port |
| 189 | condition: create_tf_data_network_res |
| 190 | properties: |
| 191 | network_id: { get_param: tf_data_network } |
| 192 | port_security_enabled: false |
| 193 | fixed_ips: |
| 194 | - subnet: { get_param: tf_data_subnet_id } |
| 195 | |
Oleh Hryhorov | dccb1cd | 2020-03-04 15:52:55 +0200 | [diff] [blame] | 196 | wait_handle: |
| 197 | type: OS::Heat::WaitConditionHandle |
| 198 | wait_condition: |
| 199 | type: OS::Heat::WaitCondition |
| 200 | properties: |
| 201 | handle: { get_resource: wait_handle } |
| 202 | timeout: { get_param: boot_timeout } |
| 203 | |
| 204 | |
| 205 | outputs: |
| 206 | server_private_ip: |
| 207 | description: IP address of server in private network |
| 208 | value: { get_attr: [server, networks, { get_param: accessible_network}, 0]} |
| 209 | server_private_floating_ip: |
| 210 | description: IP address of server in private floating network |
| 211 | value: { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] } |
Vasyl Saienko | 4e3f463 | 2020-05-26 14:43:09 +0300 | [diff] [blame] | 212 | server_ironic_baremetal_ip: |
| 213 | description: IP address of server in ironic baremetal network |
| 214 | value: { get_attr: [ironic_baremetal_server_port, fixed_ips, 0, ip_address] } |
Anton Samoylov | 13b055e | 2020-07-23 15:44:07 +0400 | [diff] [blame] | 215 | server_tf_data_ip: |
| 216 | description: IP address of server in tf data network |
| 217 | value: { get_attr: [tf_data_server_port, fixed_ips, 0, ip_address] } |
| 218 | condition: create_tf_data_network_res |
Oleh Hryhorov | dccb1cd | 2020-03-04 15:52:55 +0200 | [diff] [blame] | 219 | server_public_ip: |
| 220 | description: Floating IP address of server in public network |
| 221 | value: { get_attr: [server, networks, { get_param: accessible_network}, 0]} |
Vasyl Saienko | f9ee158 | 2020-03-02 16:53:41 +0200 | [diff] [blame] | 222 | wc_data: |
| 223 | description: Metadata from instance |
| 224 | value: { get_attr: [wait_condition, data]} |