Gerrit MCP | bbf9d5d | 2019-12-19 13:47:41 +0100 | [diff] [blame] | 1 | heat_template_version: queens |
| 2 | |
| 3 | parameters: |
| 4 | key_name: |
| 5 | type: string |
| 6 | description: Name of keypair to assign to servers |
| 7 | image: |
| 8 | type: string |
| 9 | description: Name of image to use for servers |
| 10 | flavor: |
| 11 | type: string |
| 12 | description: Flavor to use for servers |
| 13 | public_net_id: |
| 14 | type: string |
| 15 | description: > |
| 16 | ID of public network for which floating IP addresses will be allocated |
| 17 | private_net_id: |
| 18 | type: string |
| 19 | description: ID of private network into which servers get deployed |
| 20 | private_subnet_id: |
| 21 | type: string |
| 22 | description: ID of private subnet |
| 23 | private_floating_network: |
| 24 | type: string |
| 25 | description: ID of network that will be used for floating in nested openstack |
Vasyl Saienko | 3ab29c9 | 2020-01-03 10:39:03 +0200 | [diff] [blame] | 26 | boot_timeout: |
| 27 | type: number |
| 28 | description: Boot timeout for instance |
| 29 | default: 1200 |
Gerrit MCP | bbf9d5d | 2019-12-19 13:47:41 +0100 | [diff] [blame] | 30 | metadata: |
| 31 | type: json |
Vasyl Saienko | 3ab29c9 | 2020-01-03 10:39:03 +0200 | [diff] [blame] | 32 | node_type: |
| 33 | type: string |
| 34 | ucp_master_host: |
| 35 | type: string |
| 36 | default: '' |
Gerrit MCP | bbf9d5d | 2019-12-19 13:47:41 +0100 | [diff] [blame] | 37 | |
| 38 | resources: |
| 39 | |
Vasyl Saienko | 3ab29c9 | 2020-01-03 10:39:03 +0200 | [diff] [blame] | 40 | software_config: |
| 41 | type: OS::Heat::SoftwareConfig |
| 42 | properties: |
| 43 | group: ungrouped |
| 44 | config: |
| 45 | str_replace: |
| 46 | template: { get_file: ./scripts/instance_boot.sh } |
| 47 | params: |
| 48 | $node_type: { get_param: node_type } |
| 49 | $wait_condition_notify: { get_attr: [ wait_handle, curl_cli ] } |
| 50 | $ucp_license_key: { get_file: ./scripts/license.lic } |
| 51 | $ucp_master_host: { get_param: ucp_master_host } |
Oleh Hryhorov | 404e957 | 2020-01-21 18:57:22 +0200 | [diff] [blame] | 52 | $node_metadata: { get_param: metadata } |
Vasyl Saienko | 3ab29c9 | 2020-01-03 10:39:03 +0200 | [diff] [blame] | 53 | |
Gerrit MCP | bbf9d5d | 2019-12-19 13:47:41 +0100 | [diff] [blame] | 54 | server: |
| 55 | type: OS::Nova::Server |
| 56 | properties: |
| 57 | image: { get_param: image } |
| 58 | flavor: { get_param: flavor } |
| 59 | key_name: { get_param: key_name } |
| 60 | availability_zone: nova |
| 61 | networks: |
| 62 | - port: { get_resource: server_port } |
| 63 | - network: { get_param: private_floating_network } |
| 64 | user_data_format: RAW |
Vasyl Saienko | 3ab29c9 | 2020-01-03 10:39:03 +0200 | [diff] [blame] | 65 | user_data: { get_resource: software_config } |
Gerrit MCP | bbf9d5d | 2019-12-19 13:47:41 +0100 | [diff] [blame] | 66 | metadata: { get_param: metadata } |
| 67 | |
| 68 | server_port: |
| 69 | type: OS::Neutron::Port |
| 70 | properties: |
| 71 | network_id: { get_param: private_net_id } |
| 72 | port_security_enabled: false |
| 73 | fixed_ips: |
| 74 | - subnet: { get_param: private_subnet_id } |
| 75 | |
| 76 | server_floating_ip: |
| 77 | type: OS::Neutron::FloatingIP |
| 78 | properties: |
| 79 | floating_network_id: { get_param: public_net_id } |
| 80 | port_id: { get_resource: server_port } |
| 81 | |
Vasyl Saienko | 3ab29c9 | 2020-01-03 10:39:03 +0200 | [diff] [blame] | 82 | wait_handle: |
| 83 | type: OS::Heat::WaitConditionHandle |
| 84 | wait_condition: |
| 85 | type: OS::Heat::WaitCondition |
| 86 | properties: |
| 87 | handle: { get_resource: wait_handle } |
| 88 | timeout: { get_param: boot_timeout } |
Gerrit MCP | bbf9d5d | 2019-12-19 13:47:41 +0100 | [diff] [blame] | 89 | |
| 90 | outputs: |
| 91 | server_private_ip: |
| 92 | description: IP address of server in private network |
| 93 | value: { get_attr: [ server_port, fixed_ips, 0, ip_address] } |
Oleh Hryhorov | 404e957 | 2020-01-21 18:57:22 +0200 | [diff] [blame] | 94 | server_private_floating_ip: |
| 95 | description: IP address of server in private floating network |
| 96 | value: { get_attr: [server, networks, { get_param: private_floating_network }, 0]} |
Gerrit MCP | bbf9d5d | 2019-12-19 13:47:41 +0100 | [diff] [blame] | 97 | server_public_ip: |
| 98 | description: Floating IP address of server in public network |
| 99 | value: { get_attr: [ server_floating_ip, floating_ip_address ] } |