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