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