blob: 42e7f47a5525d619e3b998e8658aa98572576781 [file] [log] [blame]
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +02001heat_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
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +020012 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
33 storage_backend_network_cidr:
34 type: string
35 storage_backend_network:
36 type: string
37 storage_backend_subnet_id:
38 type: string
39 storage_backend_interface:
40 type: string
41 storage_frontend_network:
42 type: string
43 storage_frontend_network_cidr:
44 type: string
45 storage_frontend_subnet_id:
46 type: string
47 storage_frontend_interface:
48 type: string
Vasyl Saienko0fa6f192020-03-06 16:08:51 +020049 control_network_cidr:
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +020050 type: string
Vasyl Saienko36f2edf2020-05-14 10:44:52 +030051 ironic_baremetal_network:
52 type: string
53 ironic_baremetal_subnet_id:
54 type: string
Vasyl Saienko4c468192020-05-19 11:51:13 +030055 ironic_baremetal_network_cidr:
Vasyl Saienko36f2edf2020-05-14 10:44:52 +030056 type: string
Michael Polenchuk486cadf2020-08-24 16:25:51 +040057 ironic_baremetal_tunnel_cidr:
58 type: string
59 ironic_mt_enabled:
60 type: boolean
Anton Samoylov13b055e2020-07-23 15:44:07 +040061 tungstenfabric_enabled:
62 type: boolean
Oleh Hryhorove7feab42020-11-11 18:00:29 +020063 tun_network:
Anton Samoylov13b055e2020-07-23 15:44:07 +040064 type: string
Oleh Hryhorove7feab42020-11-11 18:00:29 +020065 tun_subnet_id:
Anton Samoylov13b055e2020-07-23 15:44:07 +040066 type: string
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +020067 functions_override:
68 type: string
69 boot_timeout:
70 type: number
71 description: Boot timeout for instance
Vasyl Saienkof36f39c2020-03-10 00:21:42 +020072 default: 3600
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +020073 ucp_master_host:
74 type: string
75 default: ''
Vasyl Saienko84ee4fd2020-09-02 10:00:18 +030076 docker_ucp_image:
77 type: string
Stepan Rogov60bc3522020-12-16 17:43:25 +030078 docker_default_address_pool:
79 type: string
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +020080 public_net_id:
81 type: string
82 default: ''
83 docker_ee_release:
84 type: string
85 docker_ee_url:
86 type: string
Vasyl Saienkof9ee1582020-03-02 16:53:41 +020087 hardware_metadata:
88 description: The content of lab metadata.
89 type: string
Vasyl Saienko846c6342021-02-24 17:01:36 +020090 frr_bgp_neighbors:
91 description: Comma separated list of IP of BGP neighbors
92 default: ''
93 type: string
Denis Egorenkoe09856a2021-11-01 13:52:46 +040094 num_volumes:
95 type: number
96 default: 0
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +020097
98resources:
99
100 software_config:
101 type: OS::Heat::SoftwareConfig
102 properties:
103 group: ungrouped
104 config:
105 str_replace:
106 template: { get_file: ../scripts/instance_boot.sh }
107 params:
108 $node_type: { get_param: node_type }
Vasyl Saienko8d34ad02021-07-26 11:55:23 +0300109 $kubernetes_installer: { get_param: kubernetes_installer }
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +0200110 $wait_condition_notify: { get_attr: [ wait_handle, curl_cli ] }
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +0200111 $docker_ee_url: { get_param: docker_ee_url }
112 $docker_ee_release: { get_param: docker_ee_release }
113 $ucp_master_host: { get_param: ucp_master_host }
Vasyl Saienko84ee4fd2020-09-02 10:00:18 +0300114 $docker_ucp_image: { get_param: docker_ucp_image }
Stepan Rogov60bc3522020-12-16 17:43:25 +0300115 $docker_default_address_pool: { get_param: docker_default_address_pool }
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +0200116 $node_metadata: { get_param: metadata }
Vasyl Saienko0fa6f192020-03-06 16:08:51 +0200117 $control_network_cidr: { get_param: control_network_cidr }
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +0200118 $private_floating_interface: { get_param: private_floating_interface }
119 $private_floating_network_cidr: { get_param: private_floating_network_cidr }
120 $private_floating_interface_ip: { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] }
121 $functions_override: { get_param: functions_override }
122 $storage_frontend_interface: { get_param: storage_frontend_interface }
123 $storage_frontend_network_interface_ip: { get_attr: [storage_frontend_server_port, fixed_ips, 0, ip_address] }
124 $storage_frontend_network_cidr: { get_param: storage_frontend_network_cidr }
125 $storage_backend_interface: { get_param: storage_backend_interface }
126 $storage_backend_network_interface_ip: { get_attr: [storage_backend_server_port, fixed_ips, 0, ip_address] }
127 $storage_backend_network_cidr: { get_param: storage_backend_network_cidr }
Vasyl Saienko36f2edf2020-05-14 10:44:52 +0300128 $ironic_baremetal_interface_ip: { get_attr: [ironic_baremetal_server_port, fixed_ips, 0, ip_address] }
Vasyl Saienko4c468192020-05-19 11:51:13 +0300129 $ironic_baremetal_network_cidr: { get_param: ironic_baremetal_network_cidr }
Michael Polenchuk486cadf2020-08-24 16:25:51 +0400130 $ironic_baremetal_tunnel_cidr: { get_param: ironic_baremetal_tunnel_cidr }
131 $ironic_mt_enabled: { get_param: ironic_mt_enabled }
Vasyl Saienko3dd0c272020-11-16 17:20:07 +0200132 $tunnel_interface_ip: { get_attr: [tun_server_port, fixed_ips, 0, ip_address] }
Vasyl Saienko846c6342021-02-24 17:01:36 +0200133 $frr_bgp_neighbors: { get_param: frr_bgp_neighbors }
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +0200134
Vasyl Saienkof9ee1582020-03-02 16:53:41 +0200135 inject_files:
136 type: "OS::Heat::CloudConfig"
137 properties:
138 cloud_config:
139 write_files:
140 - path: /usr/sbin/prepare-metadata.py
141 owner: "root:root"
142 permissions: "0755"
143 content: {get_file: ../scripts/prepare-metadata.py}
144 - path: /usr/share/metadata/lab-metadata.yaml
145 owner: "root:root"
146 permissions: "0644"
147 content: { get_param: hardware_metadata}
148
149 install_config_agent:
150 type: "OS::Heat::MultipartMime"
151 properties:
152 parts:
153 - config: {get_resource: software_config}
154 - config: {get_resource: inject_files}
155
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +0200156 server:
157 type: OS::Nova::Server
158 properties:
Mykyta Karpin8b164562021-03-19 15:20:23 +0200159 config_drive: true
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +0200160 image: { get_param: image }
161 flavor: { get_param: flavor }
162 key_name: { get_param: key_name }
163 availability_zone: nova
164 networks:
165 - network: { get_param: accessible_network }
166 # NOTE(ohryhorov): connect to accessible network only as ironic doesn't
167 # support multitenancy use-case. Use private_floating_network for IPAM only.
Vasyl Saienko36f2edf2020-05-14 10:44:52 +0300168 # NOTE(vsaienko): ditto about ironic network
Vasyl Saienkof9ee1582020-03-02 16:53:41 +0200169 user_data_format: SOFTWARE_CONFIG
170 user_data: { get_resource: install_config_agent}
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +0200171 metadata: { get_param: metadata }
172
173 private_floating_server_port:
174 type: OS::Neutron::Port
175 properties:
176 network_id: { get_param: private_floating_network }
177 port_security_enabled: false
178 fixed_ips:
179 - subnet: { get_param: private_floating_subnet_id }
180
181 storage_backend_server_port:
182 type: OS::Neutron::Port
183 properties:
184 network_id: { get_param: storage_backend_network }
185 port_security_enabled: false
186 fixed_ips:
187 - subnet: { get_param: storage_backend_subnet_id }
188
189 storage_frontend_server_port:
190 type: OS::Neutron::Port
191 properties:
192 network_id: { get_param: storage_frontend_network }
193 port_security_enabled: false
194 fixed_ips:
195 - subnet: { get_param: storage_frontend_subnet_id }
196
Vasyl Saienko36f2edf2020-05-14 10:44:52 +0300197 ironic_baremetal_server_port:
198 type: OS::Neutron::Port
199 properties:
200 network_id: { get_param: ironic_baremetal_network }
201 port_security_enabled: false
202 fixed_ips:
203 - subnet: { get_param: ironic_baremetal_subnet_id }
204
Oleh Hryhorove7feab42020-11-11 18:00:29 +0200205 tun_server_port:
Anton Samoylov13b055e2020-07-23 15:44:07 +0400206 type: OS::Neutron::Port
Anton Samoylov13b055e2020-07-23 15:44:07 +0400207 properties:
Oleh Hryhorove7feab42020-11-11 18:00:29 +0200208 network_id: { get_param: tun_network }
Anton Samoylov13b055e2020-07-23 15:44:07 +0400209 port_security_enabled: false
210 fixed_ips:
Oleh Hryhorove7feab42020-11-11 18:00:29 +0200211 - subnet: { get_param: tun_subnet_id }
Anton Samoylov13b055e2020-07-23 15:44:07 +0400212
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +0200213 wait_handle:
214 type: OS::Heat::WaitConditionHandle
215 wait_condition:
216 type: OS::Heat::WaitCondition
217 properties:
218 handle: { get_resource: wait_handle }
219 timeout: { get_param: boot_timeout }
220
221
222outputs:
223 server_private_ip:
224 description: IP address of server in private network
225 value: { get_attr: [server, networks, { get_param: accessible_network}, 0]}
226 server_private_floating_ip:
227 description: IP address of server in private floating network
228 value: { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] }
Vasyl Saienko4e3f4632020-05-26 14:43:09 +0300229 server_ironic_baremetal_ip:
230 description: IP address of server in ironic baremetal network
231 value: { get_attr: [ironic_baremetal_server_port, fixed_ips, 0, ip_address] }
Anton Samoylov13b055e2020-07-23 15:44:07 +0400232 server_tf_data_ip:
233 description: IP address of server in tf data network
Oleh Hryhorove7feab42020-11-11 18:00:29 +0200234 value: { get_attr: [tun_server_port, fixed_ips, 0, ip_address] }
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +0200235 server_public_ip:
236 description: Floating IP address of server in public network
237 value: { get_attr: [server, networks, { get_param: accessible_network}, 0]}
Vasyl Saienko846c6342021-02-24 17:01:36 +0200238 server_tun_ip:
239 description: IP address of server in tunnel network
240 value: { get_attr: [ tun_server_port, fixed_ips, 0, ip_address ] }
Vasyl Saienkof9ee1582020-03-02 16:53:41 +0200241 wc_data:
242 description: Metadata from instance
243 value: { get_attr: [wait_condition, data]}