blob: f7aba6bffad613ed02b0100e3c464af2212209b6 [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
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
31 storage_backend_network_cidr:
32 type: string
33 storage_backend_network:
34 type: string
35 storage_backend_subnet_id:
36 type: string
37 storage_backend_interface:
38 type: string
39 storage_frontend_network:
40 type: string
41 storage_frontend_network_cidr:
42 type: string
43 storage_frontend_subnet_id:
44 type: string
45 storage_frontend_interface:
46 type: string
Vasyl Saienko0fa6f192020-03-06 16:08:51 +020047 control_network_cidr:
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +020048 type: string
Vasyl Saienko36f2edf2020-05-14 10:44:52 +030049 ironic_baremetal_network:
50 type: string
51 ironic_baremetal_subnet_id:
52 type: string
Vasyl Saienko4c468192020-05-19 11:51:13 +030053 ironic_baremetal_network_cidr:
Vasyl Saienko36f2edf2020-05-14 10:44:52 +030054 type: string
Michael Polenchuk486cadf2020-08-24 16:25:51 +040055 ironic_baremetal_tunnel_cidr:
56 type: string
57 ironic_mt_enabled:
58 type: boolean
Anton Samoylov13b055e2020-07-23 15:44:07 +040059 tungstenfabric_enabled:
60 type: boolean
Oleh Hryhorove7feab42020-11-11 18:00:29 +020061 tun_network:
Anton Samoylov13b055e2020-07-23 15:44:07 +040062 type: string
Oleh Hryhorove7feab42020-11-11 18:00:29 +020063 tun_subnet_id:
Anton Samoylov13b055e2020-07-23 15:44:07 +040064 type: string
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +020065 functions_override:
66 type: string
67 boot_timeout:
68 type: number
69 description: Boot timeout for instance
Vasyl Saienkof36f39c2020-03-10 00:21:42 +020070 default: 3600
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +020071 ucp_master_host:
72 type: string
73 default: ''
Vasyl Saienko84ee4fd2020-09-02 10:00:18 +030074 docker_ucp_image:
75 type: string
Stepan Rogov60bc3522020-12-16 17:43:25 +030076 docker_default_address_pool:
77 type: string
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +020078 public_net_id:
79 type: string
80 default: ''
81 docker_ee_release:
82 type: string
83 docker_ee_url:
84 type: string
Vasyl Saienkof9ee1582020-03-02 16:53:41 +020085 hardware_metadata:
86 description: The content of lab metadata.
87 type: string
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +020088
89resources:
90
91 software_config:
92 type: OS::Heat::SoftwareConfig
93 properties:
94 group: ungrouped
95 config:
96 str_replace:
97 template: { get_file: ../scripts/instance_boot.sh }
98 params:
99 $node_type: { get_param: node_type }
100 $wait_condition_notify: { get_attr: [ wait_handle, curl_cli ] }
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +0200101 $docker_ee_url: { get_param: docker_ee_url }
102 $docker_ee_release: { get_param: docker_ee_release }
103 $ucp_master_host: { get_param: ucp_master_host }
Vasyl Saienko84ee4fd2020-09-02 10:00:18 +0300104 $docker_ucp_image: { get_param: docker_ucp_image }
Stepan Rogov60bc3522020-12-16 17:43:25 +0300105 $docker_default_address_pool: { get_param: docker_default_address_pool }
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +0200106 $node_metadata: { get_param: metadata }
Vasyl Saienko0fa6f192020-03-06 16:08:51 +0200107 $control_network_cidr: { get_param: control_network_cidr }
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +0200108 $private_floating_interface: { get_param: private_floating_interface }
109 $private_floating_network_cidr: { get_param: private_floating_network_cidr }
110 $private_floating_interface_ip: { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] }
111 $functions_override: { get_param: functions_override }
112 $storage_frontend_interface: { get_param: storage_frontend_interface }
113 $storage_frontend_network_interface_ip: { get_attr: [storage_frontend_server_port, fixed_ips, 0, ip_address] }
114 $storage_frontend_network_cidr: { get_param: storage_frontend_network_cidr }
115 $storage_backend_interface: { get_param: storage_backend_interface }
116 $storage_backend_network_interface_ip: { get_attr: [storage_backend_server_port, fixed_ips, 0, ip_address] }
117 $storage_backend_network_cidr: { get_param: storage_backend_network_cidr }
Vasyl Saienko36f2edf2020-05-14 10:44:52 +0300118 $ironic_baremetal_interface_ip: { get_attr: [ironic_baremetal_server_port, fixed_ips, 0, ip_address] }
Vasyl Saienko4c468192020-05-19 11:51:13 +0300119 $ironic_baremetal_network_cidr: { get_param: ironic_baremetal_network_cidr }
Michael Polenchuk486cadf2020-08-24 16:25:51 +0400120 $ironic_baremetal_tunnel_cidr: { get_param: ironic_baremetal_tunnel_cidr }
121 $ironic_mt_enabled: { get_param: ironic_mt_enabled }
Vasyl Saienko3dd0c272020-11-16 17:20:07 +0200122 $tunnel_interface_ip: { get_attr: [tun_server_port, fixed_ips, 0, ip_address] }
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +0200123
Vasyl Saienkof9ee1582020-03-02 16:53:41 +0200124 inject_files:
125 type: "OS::Heat::CloudConfig"
126 properties:
127 cloud_config:
128 write_files:
129 - path: /usr/sbin/prepare-metadata.py
130 owner: "root:root"
131 permissions: "0755"
132 content: {get_file: ../scripts/prepare-metadata.py}
133 - path: /usr/share/metadata/lab-metadata.yaml
134 owner: "root:root"
135 permissions: "0644"
136 content: { get_param: hardware_metadata}
137
138 install_config_agent:
139 type: "OS::Heat::MultipartMime"
140 properties:
141 parts:
142 - config: {get_resource: software_config}
143 - config: {get_resource: inject_files}
144
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +0200145 server:
146 type: OS::Nova::Server
147 properties:
148 image: { get_param: image }
149 flavor: { get_param: flavor }
150 key_name: { get_param: key_name }
151 availability_zone: nova
152 networks:
153 - network: { get_param: accessible_network }
154 # NOTE(ohryhorov): connect to accessible network only as ironic doesn't
155 # support multitenancy use-case. Use private_floating_network for IPAM only.
Vasyl Saienko36f2edf2020-05-14 10:44:52 +0300156 # NOTE(vsaienko): ditto about ironic network
Vasyl Saienkof9ee1582020-03-02 16:53:41 +0200157 user_data_format: SOFTWARE_CONFIG
158 user_data: { get_resource: install_config_agent}
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +0200159 metadata: { get_param: metadata }
160
161 private_floating_server_port:
162 type: OS::Neutron::Port
163 properties:
164 network_id: { get_param: private_floating_network }
165 port_security_enabled: false
166 fixed_ips:
167 - subnet: { get_param: private_floating_subnet_id }
168
169 storage_backend_server_port:
170 type: OS::Neutron::Port
171 properties:
172 network_id: { get_param: storage_backend_network }
173 port_security_enabled: false
174 fixed_ips:
175 - subnet: { get_param: storage_backend_subnet_id }
176
177 storage_frontend_server_port:
178 type: OS::Neutron::Port
179 properties:
180 network_id: { get_param: storage_frontend_network }
181 port_security_enabled: false
182 fixed_ips:
183 - subnet: { get_param: storage_frontend_subnet_id }
184
Vasyl Saienko36f2edf2020-05-14 10:44:52 +0300185 ironic_baremetal_server_port:
186 type: OS::Neutron::Port
187 properties:
188 network_id: { get_param: ironic_baremetal_network }
189 port_security_enabled: false
190 fixed_ips:
191 - subnet: { get_param: ironic_baremetal_subnet_id }
192
Oleh Hryhorove7feab42020-11-11 18:00:29 +0200193 tun_server_port:
Anton Samoylov13b055e2020-07-23 15:44:07 +0400194 type: OS::Neutron::Port
Anton Samoylov13b055e2020-07-23 15:44:07 +0400195 properties:
Oleh Hryhorove7feab42020-11-11 18:00:29 +0200196 network_id: { get_param: tun_network }
Anton Samoylov13b055e2020-07-23 15:44:07 +0400197 port_security_enabled: false
198 fixed_ips:
Oleh Hryhorove7feab42020-11-11 18:00:29 +0200199 - subnet: { get_param: tun_subnet_id }
Anton Samoylov13b055e2020-07-23 15:44:07 +0400200
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +0200201 wait_handle:
202 type: OS::Heat::WaitConditionHandle
203 wait_condition:
204 type: OS::Heat::WaitCondition
205 properties:
206 handle: { get_resource: wait_handle }
207 timeout: { get_param: boot_timeout }
208
209
210outputs:
211 server_private_ip:
212 description: IP address of server in private network
213 value: { get_attr: [server, networks, { get_param: accessible_network}, 0]}
214 server_private_floating_ip:
215 description: IP address of server in private floating network
216 value: { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] }
Vasyl Saienko4e3f4632020-05-26 14:43:09 +0300217 server_ironic_baremetal_ip:
218 description: IP address of server in ironic baremetal network
219 value: { get_attr: [ironic_baremetal_server_port, fixed_ips, 0, ip_address] }
Anton Samoylov13b055e2020-07-23 15:44:07 +0400220 server_tf_data_ip:
221 description: IP address of server in tf data network
Oleh Hryhorove7feab42020-11-11 18:00:29 +0200222 value: { get_attr: [tun_server_port, fixed_ips, 0, ip_address] }
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +0200223 server_public_ip:
224 description: Floating IP address of server in public network
225 value: { get_attr: [server, networks, { get_param: accessible_network}, 0]}
Vasyl Saienkof9ee1582020-03-02 16:53:41 +0200226 wc_data:
227 description: Metadata from instance
228 value: { get_attr: [wait_condition, data]}