Mateusz Los | e2ad077 | 2020-02-27 21:41:54 +0100 | [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 |
Oleh Hryhorov | dccb1cd | 2020-03-04 15:52:55 +0200 | [diff] [blame] | 31 | storage_frontend_network_cidr: |
| 32 | type: string |
Mateusz Los | e2ad077 | 2020-02-27 21:41:54 +0100 | [diff] [blame] | 33 | storage_frontend_network: |
| 34 | type: string |
| 35 | storage_frontend_subnet_id: |
| 36 | type: string |
Oleh Hryhorov | 1832d23 | 2020-03-05 11:33:13 +0200 | [diff] [blame] | 37 | storage_frontend_interface: |
| 38 | type: string |
Vasyl Saienko | 36f2edf | 2020-05-14 10:44:52 +0300 | [diff] [blame] | 39 | ironic_baremetal_network: |
| 40 | type: string |
| 41 | ironic_baremetal_subnet_id: |
| 42 | type: string |
Vasyl Saienko | 4c46819 | 2020-05-19 11:51:13 +0300 | [diff] [blame] | 43 | ironic_baremetal_network_cidr: |
Vasyl Saienko | 36f2edf | 2020-05-14 10:44:52 +0300 | [diff] [blame] | 44 | type: string |
Michael Polenchuk | 486cadf | 2020-08-24 16:25:51 +0400 | [diff] [blame] | 45 | ironic_baremetal_tunnel_cidr: |
| 46 | type: string |
| 47 | ironic_mt_enabled: |
| 48 | type: boolean |
Vasyl Saienko | 0fa6f19 | 2020-03-06 16:08:51 +0200 | [diff] [blame] | 49 | control_network_cidr: |
Mateusz Los | e2ad077 | 2020-02-27 21:41:54 +0100 | [diff] [blame] | 50 | type: string |
| 51 | functions_override: |
| 52 | type: string |
| 53 | boot_timeout: |
| 54 | type: number |
| 55 | description: Boot timeout for instance |
Vasyl Saienko | f36f39c | 2020-03-10 00:21:42 +0200 | [diff] [blame] | 56 | default: 3600 |
Mateusz Los | e2ad077 | 2020-02-27 21:41:54 +0100 | [diff] [blame] | 57 | ucp_master_host: |
| 58 | type: string |
| 59 | default: '' |
Vasyl Saienko | 84ee4fd | 2020-09-02 10:00:18 +0300 | [diff] [blame] | 60 | docker_ucp_image: |
| 61 | type: string |
Mateusz Los | e2ad077 | 2020-02-27 21:41:54 +0100 | [diff] [blame] | 62 | public_net_id: |
| 63 | type: string |
| 64 | docker_ee_release: |
| 65 | type: string |
| 66 | docker_ee_url: |
| 67 | type: string |
Vasyl Saienko | f9ee158 | 2020-03-02 16:53:41 +0200 | [diff] [blame] | 68 | hardware_metadata: |
| 69 | description: The content of lab metadata. |
| 70 | type: string |
Oleh Hryhorov | 33e30e2 | 2020-03-12 11:51:40 +0200 | [diff] [blame] | 71 | user_data_config: |
| 72 | description: This is part of clout-config which denies to mount drive with label ephemeral0 to /mnt |
| 73 | type: string |
| 74 | default: | |
| 75 | #cloud-config |
| 76 | # |
| 77 | # Don't mount ephemeral0 to /mnt as it's by default |
| 78 | mounts: |
| 79 | - [ ephemeral0, null ] |
Mateusz Los | e2ad077 | 2020-02-27 21:41:54 +0100 | [diff] [blame] | 80 | |
| 81 | resources: |
| 82 | |
| 83 | software_config: |
| 84 | type: OS::Heat::SoftwareConfig |
| 85 | properties: |
| 86 | group: ungrouped |
| 87 | config: |
| 88 | str_replace: |
| 89 | template: { get_file: ../scripts/instance_boot.sh } |
| 90 | params: |
| 91 | $node_type: { get_param: node_type } |
| 92 | $wait_condition_notify: { get_attr: [ wait_handle, curl_cli ] } |
Mateusz Los | e2ad077 | 2020-02-27 21:41:54 +0100 | [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 } |
Mateusz Los | e2ad077 | 2020-02-27 21:41:54 +0100 | [diff] [blame] | 97 | $node_metadata: { get_param: metadata } |
Vasyl Saienko | 0fa6f19 | 2020-03-06 16:08:51 +0200 | [diff] [blame] | 98 | $control_network_cidr: { get_param: control_network_cidr } |
Mateusz Los | e2ad077 | 2020-02-27 21:41:54 +0100 | [diff] [blame] | 99 | $private_floating_interface: { get_param: private_floating_interface } |
| 100 | $private_floating_interface_ip: { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] } |
| 101 | $private_floating_network_cidr: { get_param: private_floating_network_cidr } |
| 102 | $functions_override: { get_param: functions_override } |
Oleh Hryhorov | 1832d23 | 2020-03-05 11:33:13 +0200 | [diff] [blame] | 103 | $storage_frontend_interface: { get_param: storage_frontend_interface } |
Oleh Hryhorov | dccb1cd | 2020-03-04 15:52:55 +0200 | [diff] [blame] | 104 | $storage_frontend_network_interface_ip: { get_attr: [storage_frontend_server_port, fixed_ips, 0, ip_address] } |
| 105 | $storage_frontend_network_cidr: { get_param: storage_frontend_network_cidr } |
Vasyl Saienko | 36f2edf | 2020-05-14 10:44:52 +0300 | [diff] [blame] | 106 | $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] | 107 | $ironic_baremetal_network_cidr: { get_param: ironic_baremetal_network_cidr } |
Michael Polenchuk | 486cadf | 2020-08-24 16:25:51 +0400 | [diff] [blame] | 108 | $ironic_baremetal_tunnel_cidr: { get_param: ironic_baremetal_tunnel_cidr } |
| 109 | $ironic_mt_enabled: { get_param: ironic_mt_enabled } |
Mateusz Los | e2ad077 | 2020-02-27 21:41:54 +0100 | [diff] [blame] | 110 | |
Oleh Hryhorov | 6cd2190 | 2020-03-05 18:29:31 +0200 | [diff] [blame] | 111 | inject_files: |
| 112 | type: "OS::Heat::CloudConfig" |
| 113 | properties: |
| 114 | cloud_config: |
| 115 | write_files: |
| 116 | - path: /usr/sbin/prepare-metadata.py |
| 117 | owner: "root:root" |
| 118 | permissions: "0755" |
| 119 | content: {get_file: ../scripts/prepare-metadata.py} |
| 120 | - path: /usr/share/metadata/lab-metadata.yaml |
| 121 | owner: "root:root" |
| 122 | permissions: "0644" |
| 123 | content: { get_param: hardware_metadata} |
| 124 | |
| 125 | install_config_agent: |
| 126 | type: "OS::Heat::MultipartMime" |
| 127 | properties: |
| 128 | parts: |
| 129 | - config: {get_resource: software_config} |
| 130 | - config: {get_resource: inject_files} |
Oleh Hryhorov | 33e30e2 | 2020-03-12 11:51:40 +0200 | [diff] [blame] | 131 | - config: {get_param: user_data_config} |
Oleh Hryhorov | 6cd2190 | 2020-03-05 18:29:31 +0200 | [diff] [blame] | 132 | |
Mateusz Los | e2ad077 | 2020-02-27 21:41:54 +0100 | [diff] [blame] | 133 | server: |
| 134 | type: OS::Nova::Server |
| 135 | properties: |
| 136 | image: { get_param: image } |
| 137 | flavor: { get_param: flavor } |
| 138 | key_name: { get_param: key_name } |
| 139 | availability_zone: nova |
| 140 | networks: |
| 141 | - port: { get_resource: accessible_server_port } |
| 142 | - port: { get_resource: private_floating_server_port } |
| 143 | - port: { get_resource: storage_frontend_server_port } |
Vasyl Saienko | 36f2edf | 2020-05-14 10:44:52 +0300 | [diff] [blame] | 144 | - port: { get_resource: ironic_baremetal_server_port } |
Oleh Hryhorov | 6cd2190 | 2020-03-05 18:29:31 +0200 | [diff] [blame] | 145 | user_data_format: SOFTWARE_CONFIG |
| 146 | user_data: { get_resource: install_config_agent} |
Mateusz Los | e2ad077 | 2020-02-27 21:41:54 +0100 | [diff] [blame] | 147 | metadata: { get_param: metadata } |
| 148 | |
| 149 | accessible_server_port: |
| 150 | type: OS::Neutron::Port |
| 151 | properties: |
| 152 | network_id: { get_param: accessible_network } |
| 153 | port_security_enabled: false |
| 154 | fixed_ips: |
| 155 | - subnet: { get_param: accessible_subnet_id } |
| 156 | |
| 157 | storage_frontend_server_port: |
| 158 | type: OS::Neutron::Port |
| 159 | properties: |
| 160 | network_id: { get_param: storage_frontend_network } |
| 161 | port_security_enabled: false |
| 162 | fixed_ips: |
| 163 | - subnet: { get_param: storage_frontend_subnet_id } |
| 164 | |
| 165 | private_floating_server_port: |
| 166 | type: OS::Neutron::Port |
| 167 | properties: |
| 168 | network_id: { get_param: private_floating_network } |
| 169 | port_security_enabled: false |
| 170 | fixed_ips: |
| 171 | - subnet: { get_param: private_floating_subnet_id } |
| 172 | |
| 173 | server_floating_ip: |
| 174 | type: OS::Neutron::FloatingIP |
| 175 | properties: |
| 176 | floating_network_id: { get_param: public_net_id } |
| 177 | port_id: { get_resource: accessible_server_port } |
| 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 | |
Mateusz Los | e2ad077 | 2020-02-27 21:41:54 +0100 | [diff] [blame] | 187 | wait_handle: |
| 188 | type: OS::Heat::WaitConditionHandle |
| 189 | wait_condition: |
| 190 | type: OS::Heat::WaitCondition |
| 191 | properties: |
| 192 | handle: { get_resource: wait_handle } |
| 193 | timeout: { get_param: boot_timeout } |
| 194 | |
| 195 | outputs: |
| 196 | server_private_ip: |
| 197 | description: IP address of server in private network |
| 198 | value: { get_attr: [server, networks, { get_param: accessible_network}, 0]} |
| 199 | server_private_floating_ip: |
| 200 | description: IP address of server in private floating network |
| 201 | value: { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] } |
Vasyl Saienko | 4e3f463 | 2020-05-26 14:43:09 +0300 | [diff] [blame] | 202 | server_ironic_baremetal_ip: |
| 203 | description: IP address of server in ironic baremetal network |
| 204 | value: { get_attr: [ironic_baremetal_server_port, fixed_ips, 0, ip_address] } |
Mateusz Los | e2ad077 | 2020-02-27 21:41:54 +0100 | [diff] [blame] | 205 | server_public_ip: |
| 206 | description: Floating IP address of server in public network |
| 207 | value: { get_attr: [ server_floating_ip, floating_ip_address ] } |
Vasyl Saienko | f9ee158 | 2020-03-02 16:53:41 +0200 | [diff] [blame] | 208 | wc_data: |
| 209 | description: Metadata from instance |
| 210 | value: { get_attr: [wait_condition, data]} |