blob: 6d40d62488602eb8191dedaf77fb28f4d6fbbe5d [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
Vasyl Saienko846c6342021-02-24 17:01:36 +020088 frr_bgp_neighbors:
89 description: Comma separated list of IP of BGP neighbors
90 default: ''
91 type: string
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +020092
93resources:
94
95 software_config:
96 type: OS::Heat::SoftwareConfig
97 properties:
98 group: ungrouped
99 config:
100 str_replace:
101 template: { get_file: ../scripts/instance_boot.sh }
102 params:
103 $node_type: { get_param: node_type }
104 $wait_condition_notify: { get_attr: [ wait_handle, curl_cli ] }
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +0200105 $docker_ee_url: { get_param: docker_ee_url }
106 $docker_ee_release: { get_param: docker_ee_release }
107 $ucp_master_host: { get_param: ucp_master_host }
Vasyl Saienko84ee4fd2020-09-02 10:00:18 +0300108 $docker_ucp_image: { get_param: docker_ucp_image }
Stepan Rogov60bc3522020-12-16 17:43:25 +0300109 $docker_default_address_pool: { get_param: docker_default_address_pool }
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +0200110 $node_metadata: { get_param: metadata }
Vasyl Saienko0fa6f192020-03-06 16:08:51 +0200111 $control_network_cidr: { get_param: control_network_cidr }
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +0200112 $private_floating_interface: { get_param: private_floating_interface }
113 $private_floating_network_cidr: { get_param: private_floating_network_cidr }
114 $private_floating_interface_ip: { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] }
115 $functions_override: { get_param: functions_override }
116 $storage_frontend_interface: { get_param: storage_frontend_interface }
117 $storage_frontend_network_interface_ip: { get_attr: [storage_frontend_server_port, fixed_ips, 0, ip_address] }
118 $storage_frontend_network_cidr: { get_param: storage_frontend_network_cidr }
119 $storage_backend_interface: { get_param: storage_backend_interface }
120 $storage_backend_network_interface_ip: { get_attr: [storage_backend_server_port, fixed_ips, 0, ip_address] }
121 $storage_backend_network_cidr: { get_param: storage_backend_network_cidr }
Vasyl Saienko36f2edf2020-05-14 10:44:52 +0300122 $ironic_baremetal_interface_ip: { get_attr: [ironic_baremetal_server_port, fixed_ips, 0, ip_address] }
Vasyl Saienko4c468192020-05-19 11:51:13 +0300123 $ironic_baremetal_network_cidr: { get_param: ironic_baremetal_network_cidr }
Michael Polenchuk486cadf2020-08-24 16:25:51 +0400124 $ironic_baremetal_tunnel_cidr: { get_param: ironic_baremetal_tunnel_cidr }
125 $ironic_mt_enabled: { get_param: ironic_mt_enabled }
Vasyl Saienko3dd0c272020-11-16 17:20:07 +0200126 $tunnel_interface_ip: { get_attr: [tun_server_port, fixed_ips, 0, ip_address] }
Vasyl Saienko846c6342021-02-24 17:01:36 +0200127 $frr_bgp_neighbors: { get_param: frr_bgp_neighbors }
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +0200128
Vasyl Saienkof9ee1582020-03-02 16:53:41 +0200129 inject_files:
130 type: "OS::Heat::CloudConfig"
131 properties:
132 cloud_config:
133 write_files:
134 - path: /usr/sbin/prepare-metadata.py
135 owner: "root:root"
136 permissions: "0755"
137 content: {get_file: ../scripts/prepare-metadata.py}
138 - path: /usr/share/metadata/lab-metadata.yaml
139 owner: "root:root"
140 permissions: "0644"
141 content: { get_param: hardware_metadata}
142
143 install_config_agent:
144 type: "OS::Heat::MultipartMime"
145 properties:
146 parts:
147 - config: {get_resource: software_config}
148 - config: {get_resource: inject_files}
149
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +0200150 server:
151 type: OS::Nova::Server
152 properties:
153 image: { get_param: image }
154 flavor: { get_param: flavor }
155 key_name: { get_param: key_name }
156 availability_zone: nova
157 networks:
158 - network: { get_param: accessible_network }
159 # NOTE(ohryhorov): connect to accessible network only as ironic doesn't
160 # support multitenancy use-case. Use private_floating_network for IPAM only.
Vasyl Saienko36f2edf2020-05-14 10:44:52 +0300161 # NOTE(vsaienko): ditto about ironic network
Vasyl Saienkof9ee1582020-03-02 16:53:41 +0200162 user_data_format: SOFTWARE_CONFIG
163 user_data: { get_resource: install_config_agent}
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +0200164 metadata: { get_param: metadata }
165
166 private_floating_server_port:
167 type: OS::Neutron::Port
168 properties:
169 network_id: { get_param: private_floating_network }
170 port_security_enabled: false
171 fixed_ips:
172 - subnet: { get_param: private_floating_subnet_id }
173
174 storage_backend_server_port:
175 type: OS::Neutron::Port
176 properties:
177 network_id: { get_param: storage_backend_network }
178 port_security_enabled: false
179 fixed_ips:
180 - subnet: { get_param: storage_backend_subnet_id }
181
182 storage_frontend_server_port:
183 type: OS::Neutron::Port
184 properties:
185 network_id: { get_param: storage_frontend_network }
186 port_security_enabled: false
187 fixed_ips:
188 - subnet: { get_param: storage_frontend_subnet_id }
189
Vasyl Saienko36f2edf2020-05-14 10:44:52 +0300190 ironic_baremetal_server_port:
191 type: OS::Neutron::Port
192 properties:
193 network_id: { get_param: ironic_baremetal_network }
194 port_security_enabled: false
195 fixed_ips:
196 - subnet: { get_param: ironic_baremetal_subnet_id }
197
Oleh Hryhorove7feab42020-11-11 18:00:29 +0200198 tun_server_port:
Anton Samoylov13b055e2020-07-23 15:44:07 +0400199 type: OS::Neutron::Port
Anton Samoylov13b055e2020-07-23 15:44:07 +0400200 properties:
Oleh Hryhorove7feab42020-11-11 18:00:29 +0200201 network_id: { get_param: tun_network }
Anton Samoylov13b055e2020-07-23 15:44:07 +0400202 port_security_enabled: false
203 fixed_ips:
Oleh Hryhorove7feab42020-11-11 18:00:29 +0200204 - subnet: { get_param: tun_subnet_id }
Anton Samoylov13b055e2020-07-23 15:44:07 +0400205
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +0200206 wait_handle:
207 type: OS::Heat::WaitConditionHandle
208 wait_condition:
209 type: OS::Heat::WaitCondition
210 properties:
211 handle: { get_resource: wait_handle }
212 timeout: { get_param: boot_timeout }
213
214
215outputs:
216 server_private_ip:
217 description: IP address of server in private network
218 value: { get_attr: [server, networks, { get_param: accessible_network}, 0]}
219 server_private_floating_ip:
220 description: IP address of server in private floating network
221 value: { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] }
Vasyl Saienko4e3f4632020-05-26 14:43:09 +0300222 server_ironic_baremetal_ip:
223 description: IP address of server in ironic baremetal network
224 value: { get_attr: [ironic_baremetal_server_port, fixed_ips, 0, ip_address] }
Anton Samoylov13b055e2020-07-23 15:44:07 +0400225 server_tf_data_ip:
226 description: IP address of server in tf data network
Oleh Hryhorove7feab42020-11-11 18:00:29 +0200227 value: { get_attr: [tun_server_port, fixed_ips, 0, ip_address] }
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +0200228 server_public_ip:
229 description: Floating IP address of server in public network
230 value: { get_attr: [server, networks, { get_param: accessible_network}, 0]}
Vasyl Saienko846c6342021-02-24 17:01:36 +0200231 server_tun_ip:
232 description: IP address of server in tunnel network
233 value: { get_attr: [ tun_server_port, fixed_ips, 0, ip_address ] }
Vasyl Saienkof9ee1582020-03-02 16:53:41 +0200234 wc_data:
235 description: Metadata from instance
236 value: { get_attr: [wait_condition, data]}