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