Oleh Hryhorov | b58460e | 2020-02-05 15:53:48 +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 |
Vasyl Saienko | 0fa6f19 | 2020-03-06 16:08:51 +0200 | [diff] [blame] | 31 | control_network_cidr: |
Oleh Hryhorov | b58460e | 2020-02-05 15:53:48 +0200 | [diff] [blame] | 32 | type: string |
| 33 | functions_override: |
| 34 | type: string |
| 35 | boot_timeout: |
| 36 | type: number |
| 37 | description: Boot timeout for instance |
| 38 | default: 1200 |
| 39 | ucp_master_host: |
| 40 | type: string |
| 41 | default: '' |
| 42 | public_net_id: |
| 43 | type: string |
| 44 | default: '' |
Mykyta Karpin | 5ed5fd8 | 2020-01-27 18:23:29 +0200 | [diff] [blame] | 45 | docker_ee_release: |
| 46 | type: string |
| 47 | docker_ee_url: |
| 48 | type: string |
Vasyl Saienko | f9ee158 | 2020-03-02 16:53:41 +0200 | [diff] [blame] | 49 | hardware_metadata: |
| 50 | description: The content of lab metadata. |
| 51 | default: '' |
| 52 | type: string |
Oleh Hryhorov | b58460e | 2020-02-05 15:53:48 +0200 | [diff] [blame] | 53 | |
| 54 | resources: |
| 55 | |
| 56 | software_config: |
| 57 | type: OS::Heat::SoftwareConfig |
| 58 | properties: |
| 59 | group: ungrouped |
| 60 | config: |
| 61 | str_replace: |
| 62 | template: { get_file: ../scripts/instance_boot.sh } |
| 63 | params: |
| 64 | $node_type: { get_param: node_type } |
| 65 | $wait_condition_notify: { get_attr: [ wait_handle, curl_cli ] } |
| 66 | $ucp_license_key: { get_file: ../scripts/license.lic } |
Mykyta Karpin | 5ed5fd8 | 2020-01-27 18:23:29 +0200 | [diff] [blame] | 67 | $docker_ee_url: { get_param: docker_ee_url } |
| 68 | $docker_ee_release: { get_param: docker_ee_release } |
Oleh Hryhorov | b58460e | 2020-02-05 15:53:48 +0200 | [diff] [blame] | 69 | $ucp_master_host: { get_param: ucp_master_host } |
| 70 | $node_metadata: { get_param: metadata } |
Vasyl Saienko | 0fa6f19 | 2020-03-06 16:08:51 +0200 | [diff] [blame] | 71 | $control_network_cidr: { get_param: control_network_cidr } |
Oleh Hryhorov | b58460e | 2020-02-05 15:53:48 +0200 | [diff] [blame] | 72 | $private_floating_interface: { get_param: private_floating_interface } |
Oleh Hryhorov | ca77209 | 2020-02-13 11:15:17 +0200 | [diff] [blame] | 73 | $private_floating_network_cidr: { get_param: private_floating_network_cidr } |
Oleh Hryhorov | b58460e | 2020-02-05 15:53:48 +0200 | [diff] [blame] | 74 | $private_floating_interface_ip: { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] } |
| 75 | $functions_override: { get_param: functions_override } |
| 76 | |
Vasyl Saienko | f9ee158 | 2020-03-02 16:53:41 +0200 | [diff] [blame] | 77 | inject_files: |
| 78 | type: "OS::Heat::CloudConfig" |
| 79 | properties: |
| 80 | cloud_config: |
| 81 | write_files: |
| 82 | - path: /usr/sbin/prepare-metadata.py |
| 83 | owner: "root:root" |
| 84 | permissions: "0755" |
| 85 | content: {get_file: ../scripts/prepare-metadata.py} |
| 86 | - path: /usr/share/metadata/lab-metadata.yaml |
| 87 | owner: "root:root" |
| 88 | permissions: "0644" |
| 89 | content: { get_param: hardware_metadata} |
| 90 | |
| 91 | install_config_agent: |
| 92 | type: "OS::Heat::MultipartMime" |
| 93 | properties: |
| 94 | parts: |
| 95 | - config: {get_resource: software_config} |
| 96 | - config: {get_resource: inject_files} |
| 97 | |
Oleh Hryhorov | b58460e | 2020-02-05 15:53:48 +0200 | [diff] [blame] | 98 | server: |
| 99 | type: OS::Nova::Server |
| 100 | properties: |
| 101 | image: { get_param: image } |
| 102 | flavor: { get_param: flavor } |
| 103 | key_name: { get_param: key_name } |
| 104 | availability_zone: nova |
| 105 | networks: |
| 106 | - network: { get_param: accessible_network } |
| 107 | # NOTE(ohryhorov): connect to accessible network only as ironic doesn't |
| 108 | # support multitenancy use-case. Use private_floating_network for IPAM only. |
Vasyl Saienko | f9ee158 | 2020-03-02 16:53:41 +0200 | [diff] [blame] | 109 | user_data_format: SOFTWARE_CONFIG |
| 110 | user_data: { get_resource: install_config_agent} |
Oleh Hryhorov | b58460e | 2020-02-05 15:53:48 +0200 | [diff] [blame] | 111 | metadata: { get_param: metadata } |
| 112 | |
| 113 | private_floating_server_port: |
| 114 | type: OS::Neutron::Port |
| 115 | properties: |
| 116 | network_id: { get_param: private_floating_network } |
| 117 | port_security_enabled: false |
| 118 | fixed_ips: |
| 119 | - subnet: { get_param: private_floating_subnet_id } |
| 120 | |
| 121 | wait_handle: |
| 122 | type: OS::Heat::WaitConditionHandle |
| 123 | wait_condition: |
| 124 | type: OS::Heat::WaitCondition |
| 125 | properties: |
| 126 | handle: { get_resource: wait_handle } |
| 127 | timeout: { get_param: boot_timeout } |
| 128 | |
| 129 | |
| 130 | outputs: |
| 131 | server_private_ip: |
| 132 | description: IP address of server in private network |
| 133 | value: { get_attr: [server, networks, { get_param: accessible_network}, 0]} |
| 134 | server_private_floating_ip: |
| 135 | description: IP address of server in private floating network |
| 136 | value: { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] } |
| 137 | server_public_ip: |
| 138 | description: Floating IP address of server in public network |
| 139 | value: { get_attr: [server, networks, { get_param: accessible_network}, 0]} |
Vasyl Saienko | f9ee158 | 2020-03-02 16:53:41 +0200 | [diff] [blame] | 140 | wc_data: |
| 141 | description: Metadata from instance |
| 142 | value: { get_attr: [wait_condition, data]} |