blob: cf88f83637de06247cfd883c881f18fa75c1382e [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
Mateusz Lose2ad0772020-02-27 21:41:54 +010066 public_net_id:
67 type: string
68 docker_ee_release:
69 type: string
70 docker_ee_url:
71 type: string
Vasyl Saienkof9ee1582020-03-02 16:53:41 +020072 hardware_metadata:
73 description: The content of lab metadata.
74 type: string
Oleh Hryhorov33e30e22020-03-12 11:51:40 +020075 user_data_config:
76 description: This is part of clout-config which denies to mount drive with label ephemeral0 to /mnt
77 type: string
78 default: |
79 #cloud-config
80 #
81 # Don't mount ephemeral0 to /mnt as it's by default
82 mounts:
83 - [ ephemeral0, null ]
Mateusz Lose2ad0772020-02-27 21:41:54 +010084
85resources:
86
87 software_config:
88 type: OS::Heat::SoftwareConfig
89 properties:
90 group: ungrouped
91 config:
92 str_replace:
93 template: { get_file: ../scripts/instance_boot.sh }
94 params:
95 $node_type: { get_param: node_type }
Vasyl Saienko8d34ad02021-07-26 11:55:23 +030096 $kubernetes_installer: { get_param: kubernetes_installer }
Mateusz Lose2ad0772020-02-27 21:41:54 +010097 $wait_condition_notify: { get_attr: [ wait_handle, curl_cli ] }
Mateusz Lose2ad0772020-02-27 21:41:54 +010098 $docker_ee_url: { get_param: docker_ee_url }
99 $docker_ee_release: { get_param: docker_ee_release }
100 $ucp_master_host: { get_param: ucp_master_host }
Vasyl Saienko84ee4fd2020-09-02 10:00:18 +0300101 $docker_ucp_image: { get_param: docker_ucp_image }
Stepan Rogov60bc3522020-12-16 17:43:25 +0300102 $docker_default_address_pool: { get_param: docker_default_address_pool }
Mateusz Lose2ad0772020-02-27 21:41:54 +0100103 $node_metadata: { get_param: metadata }
Vasyl Saienko0fa6f192020-03-06 16:08:51 +0200104 $control_network_cidr: { get_param: control_network_cidr }
Mateusz Lose2ad0772020-02-27 21:41:54 +0100105 $private_floating_interface: { get_param: private_floating_interface }
106 $private_floating_interface_ip: { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] }
107 $private_floating_network_cidr: { get_param: private_floating_network_cidr }
108 $functions_override: { get_param: functions_override }
Oleh Hryhorov1832d232020-03-05 11:33:13 +0200109 $storage_frontend_interface: { get_param: storage_frontend_interface }
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +0200110 $storage_frontend_network_interface_ip: { get_attr: [storage_frontend_server_port, fixed_ips, 0, ip_address] }
111 $storage_frontend_network_cidr: { get_param: storage_frontend_network_cidr }
Vasyl Saienko36f2edf2020-05-14 10:44:52 +0300112 $ironic_baremetal_interface_ip: { get_attr: [ironic_baremetal_server_port, fixed_ips, 0, ip_address] }
Vasyl Saienko4c468192020-05-19 11:51:13 +0300113 $ironic_baremetal_network_cidr: { get_param: ironic_baremetal_network_cidr }
Michael Polenchuk486cadf2020-08-24 16:25:51 +0400114 $ironic_baremetal_tunnel_cidr: { get_param: ironic_baremetal_tunnel_cidr }
115 $ironic_mt_enabled: { get_param: ironic_mt_enabled }
Mateusz Lose2ad0772020-02-27 21:41:54 +0100116
Oleh Hryhorov6cd21902020-03-05 18:29:31 +0200117 inject_files:
118 type: "OS::Heat::CloudConfig"
119 properties:
120 cloud_config:
121 write_files:
122 - path: /usr/sbin/prepare-metadata.py
123 owner: "root:root"
124 permissions: "0755"
125 content: {get_file: ../scripts/prepare-metadata.py}
126 - path: /usr/share/metadata/lab-metadata.yaml
127 owner: "root:root"
128 permissions: "0644"
129 content: { get_param: hardware_metadata}
130
131 install_config_agent:
132 type: "OS::Heat::MultipartMime"
133 properties:
134 parts:
135 - config: {get_resource: software_config}
136 - config: {get_resource: inject_files}
Oleh Hryhorov33e30e22020-03-12 11:51:40 +0200137 - config: {get_param: user_data_config}
Oleh Hryhorov6cd21902020-03-05 18:29:31 +0200138
Mateusz Lose2ad0772020-02-27 21:41:54 +0100139 server:
140 type: OS::Nova::Server
141 properties:
Mykyta Karpin8b164562021-03-19 15:20:23 +0200142 config_drive: true
Mateusz Lose2ad0772020-02-27 21:41:54 +0100143 image: { get_param: image }
144 flavor: { get_param: flavor }
145 key_name: { get_param: key_name }
146 availability_zone: nova
147 networks:
148 - port: { get_resource: accessible_server_port }
149 - port: { get_resource: private_floating_server_port }
150 - port: { get_resource: storage_frontend_server_port }
Vasyl Saienko36f2edf2020-05-14 10:44:52 +0300151 - port: { get_resource: ironic_baremetal_server_port }
Oleh Hryhorov6cd21902020-03-05 18:29:31 +0200152 user_data_format: SOFTWARE_CONFIG
153 user_data: { get_resource: install_config_agent}
Mateusz Lose2ad0772020-02-27 21:41:54 +0100154 metadata: { get_param: metadata }
155
156 accessible_server_port:
157 type: OS::Neutron::Port
158 properties:
159 network_id: { get_param: accessible_network }
160 port_security_enabled: false
161 fixed_ips:
162 - subnet: { get_param: accessible_subnet_id }
163
164 storage_frontend_server_port:
165 type: OS::Neutron::Port
166 properties:
167 network_id: { get_param: storage_frontend_network }
168 port_security_enabled: false
169 fixed_ips:
170 - subnet: { get_param: storage_frontend_subnet_id }
171
172 private_floating_server_port:
173 type: OS::Neutron::Port
174 properties:
175 network_id: { get_param: private_floating_network }
176 port_security_enabled: false
177 fixed_ips:
178 - subnet: { get_param: private_floating_subnet_id }
179
180 server_floating_ip:
181 type: OS::Neutron::FloatingIP
182 properties:
183 floating_network_id: { get_param: public_net_id }
184 port_id: { get_resource: accessible_server_port }
185
Vasyl Saienko36f2edf2020-05-14 10:44:52 +0300186 ironic_baremetal_server_port:
187 type: OS::Neutron::Port
188 properties:
189 network_id: { get_param: ironic_baremetal_network }
190 port_security_enabled: false
191 fixed_ips:
192 - subnet: { get_param: ironic_baremetal_subnet_id }
193
Mateusz Lose2ad0772020-02-27 21:41:54 +0100194 wait_handle:
195 type: OS::Heat::WaitConditionHandle
196 wait_condition:
197 type: OS::Heat::WaitCondition
198 properties:
199 handle: { get_resource: wait_handle }
200 timeout: { get_param: boot_timeout }
201
202outputs:
203 server_private_ip:
204 description: IP address of server in private network
205 value: { get_attr: [server, networks, { get_param: accessible_network}, 0]}
206 server_private_floating_ip:
207 description: IP address of server in private floating network
208 value: { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] }
Vasyl Saienko4e3f4632020-05-26 14:43:09 +0300209 server_ironic_baremetal_ip:
210 description: IP address of server in ironic baremetal network
211 value: { get_attr: [ironic_baremetal_server_port, fixed_ips, 0, ip_address] }
Mateusz Lose2ad0772020-02-27 21:41:54 +0100212 server_public_ip:
213 description: Floating IP address of server in public network
214 value: { get_attr: [ server_floating_ip, floating_ip_address ] }
Vasyl Saienkof9ee1582020-03-02 16:53:41 +0200215 wc_data:
216 description: Metadata from instance
217 value: { get_attr: [wait_condition, data]}