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 |
Vasyl Saienko | f36f39c | 2020-03-10 00:21:42 +0200 | [diff] [blame] | 38 | default: 3600 |
Oleh Hryhorov | b58460e | 2020-02-05 15:53:48 +0200 | [diff] [blame] | 39 | ucp_master_host: |
| 40 | type: string |
| 41 | default: '' |
| 42 | public_net_id: |
| 43 | type: string |
Mykyta Karpin | 5ed5fd8 | 2020-01-27 18:23:29 +0200 | [diff] [blame] | 44 | docker_ee_release: |
| 45 | type: string |
| 46 | docker_ee_url: |
| 47 | type: string |
Vasyl Saienko | b59853e | 2020-05-25 10:15:26 +0300 | [diff] [blame] | 48 | docker_ucp_image: |
| 49 | type: string |
| 50 | default: 'docker/ucp:3.2.4' |
Vasyl Saienko | cfbedc7 | 2021-02-15 18:02:56 +0200 | [diff] [blame^] | 51 | docker_ucp_swarm_data_port: |
| 52 | type: string |
| 53 | default: 4789 |
Stepan Rogov | 60bc352 | 2020-12-16 17:43:25 +0300 | [diff] [blame] | 54 | docker_default_address_pool: |
| 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 | default: '' |
| 59 | type: string |
Oleh Hryhorov | 43bbc8c | 2020-12-03 15:30:09 +0200 | [diff] [blame] | 60 | single_node: |
| 61 | type: string |
Oleh Hryhorov | cd1a3bd | 2020-12-04 13:21:06 +0200 | [diff] [blame] | 62 | user_data_config: |
| 63 | description: This is part of clout-config which denies to mount drive with label ephemeral0 to /mnt |
| 64 | type: string |
| 65 | default: | |
| 66 | #cloud-config |
| 67 | # |
| 68 | # Don't mount ephemeral0 to /mnt as it's by default |
| 69 | mounts: |
| 70 | - [ ephemeral0, null ] |
Oleh Hryhorov | b58460e | 2020-02-05 15:53:48 +0200 | [diff] [blame] | 71 | |
| 72 | resources: |
| 73 | |
| 74 | software_config: |
| 75 | type: OS::Heat::SoftwareConfig |
| 76 | properties: |
| 77 | group: ungrouped |
| 78 | config: |
| 79 | str_replace: |
| 80 | template: { get_file: ../scripts/instance_boot.sh } |
| 81 | params: |
| 82 | $node_type: { get_param: node_type } |
| 83 | $wait_condition_notify: { get_attr: [ wait_handle, curl_cli ] } |
Mykyta Karpin | 5ed5fd8 | 2020-01-27 18:23:29 +0200 | [diff] [blame] | 84 | $docker_ee_url: { get_param: docker_ee_url } |
| 85 | $docker_ee_release: { get_param: docker_ee_release } |
Oleh Hryhorov | b58460e | 2020-02-05 15:53:48 +0200 | [diff] [blame] | 86 | $ucp_master_host: { get_param: ucp_master_host } |
| 87 | $node_metadata: { get_param: metadata } |
Vasyl Saienko | 0fa6f19 | 2020-03-06 16:08:51 +0200 | [diff] [blame] | 88 | $control_network_cidr: { get_param: control_network_cidr } |
Oleh Hryhorov | b58460e | 2020-02-05 15:53:48 +0200 | [diff] [blame] | 89 | $private_floating_interface: { get_param: private_floating_interface } |
| 90 | $private_floating_interface_ip: { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] } |
Oleh Hryhorov | ca77209 | 2020-02-13 11:15:17 +0200 | [diff] [blame] | 91 | $private_floating_network_cidr: { get_param: private_floating_network_cidr } |
Oleh Hryhorov | b58460e | 2020-02-05 15:53:48 +0200 | [diff] [blame] | 92 | $functions_override: { get_param: functions_override } |
Vasyl Saienko | b59853e | 2020-05-25 10:15:26 +0300 | [diff] [blame] | 93 | $docker_ucp_image: { get_param: docker_ucp_image } |
Vasyl Saienko | cfbedc7 | 2021-02-15 18:02:56 +0200 | [diff] [blame^] | 94 | $docker_ucp_swarm_data_port: { get_param: docker_ucp_swarm_data_port } |
Stepan Rogov | 60bc352 | 2020-12-16 17:43:25 +0300 | [diff] [blame] | 95 | $docker_default_address_pool: { get_param: docker_default_address_pool } |
Oleh Hryhorov | 43bbc8c | 2020-12-03 15:30:09 +0200 | [diff] [blame] | 96 | $single_node: { get_param: single_node } |
Oleh Hryhorov | b58460e | 2020-02-05 15:53:48 +0200 | [diff] [blame] | 97 | |
Vasyl Saienko | f9ee158 | 2020-03-02 16:53:41 +0200 | [diff] [blame] | 98 | inject_files: |
| 99 | type: "OS::Heat::CloudConfig" |
| 100 | properties: |
| 101 | cloud_config: |
| 102 | write_files: |
| 103 | - path: /usr/sbin/prepare-metadata.py |
| 104 | owner: "root:root" |
| 105 | permissions: "0755" |
| 106 | content: {get_file: ../scripts/prepare-metadata.py} |
| 107 | - path: /usr/share/metadata/lab-metadata.yaml |
| 108 | owner: "root:root" |
| 109 | permissions: "0644" |
| 110 | content: { get_param: hardware_metadata} |
| 111 | |
| 112 | install_config_agent: |
| 113 | type: "OS::Heat::MultipartMime" |
| 114 | properties: |
| 115 | parts: |
| 116 | - config: {get_resource: software_config} |
| 117 | - config: {get_resource: inject_files} |
Oleh Hryhorov | cd1a3bd | 2020-12-04 13:21:06 +0200 | [diff] [blame] | 118 | - config: {get_param: user_data_config} |
Vasyl Saienko | f9ee158 | 2020-03-02 16:53:41 +0200 | [diff] [blame] | 119 | |
Oleh Hryhorov | b58460e | 2020-02-05 15:53:48 +0200 | [diff] [blame] | 120 | server: |
| 121 | type: OS::Nova::Server |
| 122 | properties: |
| 123 | image: { get_param: image } |
| 124 | flavor: { get_param: flavor } |
| 125 | key_name: { get_param: key_name } |
| 126 | availability_zone: nova |
| 127 | networks: |
| 128 | - port: { get_resource: accessible_server_port } |
| 129 | - port: { get_resource: private_floating_server_port } |
Vasyl Saienko | f9ee158 | 2020-03-02 16:53:41 +0200 | [diff] [blame] | 130 | user_data_format: SOFTWARE_CONFIG |
| 131 | user_data: { get_resource: install_config_agent} |
Oleh Hryhorov | b58460e | 2020-02-05 15:53:48 +0200 | [diff] [blame] | 132 | metadata: { get_param: metadata } |
| 133 | |
| 134 | accessible_server_port: |
| 135 | type: OS::Neutron::Port |
| 136 | properties: |
| 137 | network_id: { get_param: accessible_network } |
| 138 | port_security_enabled: false |
| 139 | fixed_ips: |
| 140 | - subnet: { get_param: accessible_subnet_id } |
| 141 | |
| 142 | private_floating_server_port: |
| 143 | type: OS::Neutron::Port |
| 144 | properties: |
| 145 | network_id: { get_param: private_floating_network } |
| 146 | port_security_enabled: false |
| 147 | fixed_ips: |
| 148 | - subnet: { get_param: private_floating_subnet_id } |
| 149 | |
| 150 | server_floating_ip: |
| 151 | type: OS::Neutron::FloatingIP |
| 152 | properties: |
| 153 | floating_network_id: { get_param: public_net_id } |
| 154 | port_id: { get_resource: accessible_server_port } |
| 155 | |
| 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 | outputs: |
| 165 | server_private_ip: |
| 166 | description: IP address of server in private network |
| 167 | value: { get_attr: [server, networks, { get_param: accessible_network}, 0]} |
| 168 | server_private_floating_ip: |
| 169 | description: IP address of server in private floating network |
Oleh Hryhorov | cd1a3bd | 2020-12-04 13:21:06 +0200 | [diff] [blame] | 170 | value: [ { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] } ] |
Oleh Hryhorov | b58460e | 2020-02-05 15:53:48 +0200 | [diff] [blame] | 171 | server_public_ip: |
| 172 | description: Floating IP address of server in public network |
| 173 | value: { get_attr: [ server_floating_ip, floating_ip_address ] } |
Vasyl Saienko | f9ee158 | 2020-03-02 16:53:41 +0200 | [diff] [blame] | 174 | wc_data: |
| 175 | description: Metadata from instance |
| 176 | value: { get_attr: [wait_condition, data]} |