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