blob: 320b564b95ea68292e7ecda725cea913adf25f58 [file] [log] [blame]
Mateusz Lose2ad0772020-02-27 21:41:54 +01001heat_template_version: queens
2
3parameters:
4
5 metadata:
6 type: json
7 default: {}
8 node_type:
9 type: string
Vasyl Saienko8d34ad02021-07-26 11:55:23 +030010 kubernetes_installer:
11 type: string
Mateusz Lose2ad0772020-02-27 21:41:54 +010012 key_name:
13 type: string
14 description: Name of keypair to assign to servers
15 image:
16 type: string
17 description: Name of image to use for servers
18 flavor:
19 type: string
20 description: Flavor to use for servers
21 accessible_network:
22 type: string
23 accessible_subnet_id:
24 type: string
25 private_floating_network:
26 type: string
27 private_floating_network_cidr:
28 type: string
29 private_floating_subnet_id:
30 type: string
31 private_floating_interface:
32 type: string
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +020033 storage_frontend_network_cidr:
34 type: string
Mateusz Lose2ad0772020-02-27 21:41:54 +010035 storage_frontend_network:
36 type: string
37 storage_frontend_subnet_id:
38 type: string
Oleh Hryhorov1832d232020-03-05 11:33:13 +020039 storage_frontend_interface:
40 type: string
Vasyl Saienko36f2edf2020-05-14 10:44:52 +030041 ironic_baremetal_network:
42 type: string
43 ironic_baremetal_subnet_id:
44 type: string
Vasyl Saienko4c468192020-05-19 11:51:13 +030045 ironic_baremetal_network_cidr:
Vasyl Saienko36f2edf2020-05-14 10:44:52 +030046 type: string
Michael Polenchuk486cadf2020-08-24 16:25:51 +040047 ironic_baremetal_tunnel_cidr:
48 type: string
49 ironic_mt_enabled:
50 type: boolean
Vasyl Saienko0fa6f192020-03-06 16:08:51 +020051 control_network_cidr:
Mateusz Lose2ad0772020-02-27 21:41:54 +010052 type: string
53 functions_override:
54 type: string
55 boot_timeout:
56 type: number
57 description: Boot timeout for instance
Vasyl Saienkof36f39c2020-03-10 00:21:42 +020058 default: 3600
Mateusz Lose2ad0772020-02-27 21:41:54 +010059 ucp_master_host:
60 type: string
61 default: ''
Vasyl Saienko84ee4fd2020-09-02 10:00:18 +030062 docker_ucp_image:
63 type: string
Stepan Rogov60bc3522020-12-16 17:43:25 +030064 docker_default_address_pool:
65 type: string
Vasyl Saienkoa94bf182023-04-01 10:42:17 +000066 binary_base_url:
67 type: string
Mateusz Lose2ad0772020-02-27 21:41:54 +010068 public_net_id:
69 type: string
70 docker_ee_release:
71 type: string
Vasyl Saienkofa714102024-03-22 09:30:25 +020072 docker_ee_packages:
73 type: string
Mateusz Lose2ad0772020-02-27 21:41:54 +010074 docker_ee_url:
75 type: string
Vasyl Saienkof9ee1582020-03-02 16:53:41 +020076 hardware_metadata:
77 description: The content of lab metadata.
78 type: string
Oleh Hryhorov33e30e22020-03-12 11:51:40 +020079 user_data_config:
80 description: This is part of clout-config which denies to mount drive with label ephemeral0 to /mnt
81 type: string
82 default: |
83 #cloud-config
84 #
85 # Don't mount ephemeral0 to /mnt as it's by default
86 mounts:
87 - [ ephemeral0, null ]
Vasyl Saienko773aa4a2021-11-23 18:56:34 +020088 availability_zone:
Vasyl Saienkofa9bed02021-11-04 18:52:45 +020089 type: string
90 default: nova
Michael Polenchuk4f2e7762022-09-16 17:36:28 +040091 kubectl_version:
92 type: string
93 default: 1.18.8
Vasyl Saienko4a2832d2024-05-16 09:00:03 +030094 devops_utils_refspec:
95 type: string
96 default: 'master'
Mateusz Lose2ad0772020-02-27 21:41:54 +010097
98resources:
99
100 software_config:
101 type: OS::Heat::SoftwareConfig
102 properties:
103 group: ungrouped
104 config:
105 str_replace:
Vasyl Saienko4a2832d2024-05-16 09:00:03 +0300106 template: { get_file: ../scripts/launch.sh }
Mateusz Lose2ad0772020-02-27 21:41:54 +0100107 params:
108 $node_type: { get_param: node_type }
Vasyl Saienko8d34ad02021-07-26 11:55:23 +0300109 $kubernetes_installer: { get_param: kubernetes_installer }
Mateusz Lose2ad0772020-02-27 21:41:54 +0100110 $wait_condition_notify: { get_attr: [ wait_handle, curl_cli ] }
Mateusz Lose2ad0772020-02-27 21:41:54 +0100111 $docker_ee_url: { get_param: docker_ee_url }
Vasyl Saienkofa714102024-03-22 09:30:25 +0200112 $docker_ee_packages: { get_param: docker_ee_packages }
Mateusz Lose2ad0772020-02-27 21:41:54 +0100113 $docker_ee_release: { get_param: docker_ee_release }
114 $ucp_master_host: { get_param: ucp_master_host }
Vasyl Saienko84ee4fd2020-09-02 10:00:18 +0300115 $docker_ucp_image: { get_param: docker_ucp_image }
Stepan Rogov60bc3522020-12-16 17:43:25 +0300116 $docker_default_address_pool: { get_param: docker_default_address_pool }
Vasyl Saienkoa94bf182023-04-01 10:42:17 +0000117 $binary_base_url: { get_param: binary_base_url }
Mateusz Lose2ad0772020-02-27 21:41:54 +0100118 $node_metadata: { get_param: metadata }
Vasyl Saienko0fa6f192020-03-06 16:08:51 +0200119 $control_network_cidr: { get_param: control_network_cidr }
Mateusz Lose2ad0772020-02-27 21:41:54 +0100120 $private_floating_interface: { get_param: private_floating_interface }
121 $private_floating_interface_ip: { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] }
122 $private_floating_network_cidr: { get_param: private_floating_network_cidr }
123 $functions_override: { get_param: functions_override }
Oleh Hryhorov1832d232020-03-05 11:33:13 +0200124 $storage_frontend_interface: { get_param: storage_frontend_interface }
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +0200125 $storage_frontend_network_interface_ip: { get_attr: [storage_frontend_server_port, fixed_ips, 0, ip_address] }
126 $storage_frontend_network_cidr: { get_param: storage_frontend_network_cidr }
Vasyl Saienko36f2edf2020-05-14 10:44:52 +0300127 $ironic_baremetal_interface_ip: { get_attr: [ironic_baremetal_server_port, fixed_ips, 0, ip_address] }
Vasyl Saienko4c468192020-05-19 11:51:13 +0300128 $ironic_baremetal_network_cidr: { get_param: ironic_baremetal_network_cidr }
Michael Polenchuk486cadf2020-08-24 16:25:51 +0400129 $ironic_baremetal_tunnel_cidr: { get_param: ironic_baremetal_tunnel_cidr }
130 $ironic_mt_enabled: { get_param: ironic_mt_enabled }
Michael Polenchuk4f2e7762022-09-16 17:36:28 +0400131 $kubectl_version: { get_param: kubectl_version }
Vasyl Saienko4a2832d2024-05-16 09:00:03 +0300132 $devops_utils_refspec: { get_param: devops_utils_refspec }
Mateusz Lose2ad0772020-02-27 21:41:54 +0100133
Oleh Hryhorov6cd21902020-03-05 18:29:31 +0200134 inject_files:
135 type: "OS::Heat::CloudConfig"
136 properties:
137 cloud_config:
138 write_files:
139 - path: /usr/sbin/prepare-metadata.py
140 owner: "root:root"
141 permissions: "0755"
142 content: {get_file: ../scripts/prepare-metadata.py}
143 - path: /usr/share/metadata/lab-metadata.yaml
144 owner: "root:root"
145 permissions: "0644"
146 content: { get_param: hardware_metadata}
147
148 install_config_agent:
149 type: "OS::Heat::MultipartMime"
150 properties:
151 parts:
152 - config: {get_resource: software_config}
153 - config: {get_resource: inject_files}
Oleh Hryhorov33e30e22020-03-12 11:51:40 +0200154 - config: {get_param: user_data_config}
Oleh Hryhorov6cd21902020-03-05 18:29:31 +0200155
Mateusz Lose2ad0772020-02-27 21:41:54 +0100156 server:
157 type: OS::Nova::Server
158 properties:
Mykyta Karpin8b164562021-03-19 15:20:23 +0200159 config_drive: true
Mateusz Lose2ad0772020-02-27 21:41:54 +0100160 image: { get_param: image }
161 flavor: { get_param: flavor }
162 key_name: { get_param: key_name }
Vasyl Saienkofa9bed02021-11-04 18:52:45 +0200163 availability_zone: { get_param: availability_zone }
Mateusz Lose2ad0772020-02-27 21:41:54 +0100164 networks:
165 - port: { get_resource: accessible_server_port }
166 - port: { get_resource: private_floating_server_port }
167 - port: { get_resource: storage_frontend_server_port }
Vasyl Saienko36f2edf2020-05-14 10:44:52 +0300168 - port: { get_resource: ironic_baremetal_server_port }
Oleh Hryhorov6cd21902020-03-05 18:29:31 +0200169 user_data_format: SOFTWARE_CONFIG
170 user_data: { get_resource: install_config_agent}
Mateusz Lose2ad0772020-02-27 21:41:54 +0100171 metadata: { get_param: metadata }
172
173 accessible_server_port:
174 type: OS::Neutron::Port
175 properties:
176 network_id: { get_param: accessible_network }
177 port_security_enabled: false
178 fixed_ips:
179 - subnet: { get_param: accessible_subnet_id }
180
181 storage_frontend_server_port:
182 type: OS::Neutron::Port
183 properties:
184 network_id: { get_param: storage_frontend_network }
185 port_security_enabled: false
186 fixed_ips:
187 - subnet: { get_param: storage_frontend_subnet_id }
188
189 private_floating_server_port:
190 type: OS::Neutron::Port
191 properties:
192 network_id: { get_param: private_floating_network }
193 port_security_enabled: false
194 fixed_ips:
195 - subnet: { get_param: private_floating_subnet_id }
196
197 server_floating_ip:
198 type: OS::Neutron::FloatingIP
199 properties:
200 floating_network_id: { get_param: public_net_id }
201 port_id: { get_resource: accessible_server_port }
202
Vasyl Saienko36f2edf2020-05-14 10:44:52 +0300203 ironic_baremetal_server_port:
204 type: OS::Neutron::Port
205 properties:
206 network_id: { get_param: ironic_baremetal_network }
207 port_security_enabled: false
208 fixed_ips:
209 - subnet: { get_param: ironic_baremetal_subnet_id }
210
Mateusz Lose2ad0772020-02-27 21:41:54 +0100211 wait_handle:
212 type: OS::Heat::WaitConditionHandle
213 wait_condition:
214 type: OS::Heat::WaitCondition
215 properties:
216 handle: { get_resource: wait_handle }
217 timeout: { get_param: boot_timeout }
218
219outputs:
220 server_private_ip:
221 description: IP address of server in private network
222 value: { get_attr: [server, networks, { get_param: accessible_network}, 0]}
223 server_private_floating_ip:
224 description: IP address of server in private floating network
225 value: { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] }
Vasyl Saienko4e3f4632020-05-26 14:43:09 +0300226 server_ironic_baremetal_ip:
227 description: IP address of server in ironic baremetal network
228 value: { get_attr: [ironic_baremetal_server_port, fixed_ips, 0, ip_address] }
Mateusz Lose2ad0772020-02-27 21:41:54 +0100229 server_public_ip:
230 description: Floating IP address of server in public network
231 value: { get_attr: [ server_floating_ip, floating_ip_address ] }
Vasyl Saienkof9ee1582020-03-02 16:53:41 +0200232 wc_data:
233 description: Metadata from instance
234 value: { get_attr: [wait_condition, data]}