blob: 438af6e4386f9c04aea6688e0b052cefd78e8226 [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
Anton Samoylov13b055e2020-07-23 15:44:07 +040055 tungstenfabric_enabled:
56 type: boolean
57 tf_data_network:
58 type: string
59 tf_data_subnet_id:
60 type: string
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +020061 functions_override:
62 type: string
63 boot_timeout:
64 type: number
65 description: Boot timeout for instance
Vasyl Saienkof36f39c2020-03-10 00:21:42 +020066 default: 3600
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +020067 ucp_master_host:
68 type: string
69 default: ''
70 public_net_id:
71 type: string
72 default: ''
73 docker_ee_release:
74 type: string
75 docker_ee_url:
76 type: string
Vasyl Saienkof9ee1582020-03-02 16:53:41 +020077 hardware_metadata:
78 description: The content of lab metadata.
79 type: string
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +020080
Anton Samoylov13b055e2020-07-23 15:44:07 +040081conditions:
82 create_tf_data_network_res:
83 get_param: tungstenfabric_enabled
84
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +020085resources:
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 }
96 $wait_condition_notify: { get_attr: [ wait_handle, curl_cli ] }
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +020097 $docker_ee_url: { get_param: docker_ee_url }
98 $docker_ee_release: { get_param: docker_ee_release }
99 $ucp_master_host: { get_param: ucp_master_host }
100 $node_metadata: { get_param: metadata }
Vasyl Saienko0fa6f192020-03-06 16:08:51 +0200101 $control_network_cidr: { get_param: control_network_cidr }
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +0200102 $private_floating_interface: { get_param: private_floating_interface }
103 $private_floating_network_cidr: { get_param: private_floating_network_cidr }
104 $private_floating_interface_ip: { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] }
105 $functions_override: { get_param: functions_override }
106 $storage_frontend_interface: { get_param: storage_frontend_interface }
107 $storage_frontend_network_interface_ip: { get_attr: [storage_frontend_server_port, fixed_ips, 0, ip_address] }
108 $storage_frontend_network_cidr: { get_param: storage_frontend_network_cidr }
109 $storage_backend_interface: { get_param: storage_backend_interface }
110 $storage_backend_network_interface_ip: { get_attr: [storage_backend_server_port, fixed_ips, 0, ip_address] }
111 $storage_backend_network_cidr: { get_param: storage_backend_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 }
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +0200114
Vasyl Saienkof9ee1582020-03-02 16:53:41 +0200115 inject_files:
116 type: "OS::Heat::CloudConfig"
117 properties:
118 cloud_config:
119 write_files:
120 - path: /usr/sbin/prepare-metadata.py
121 owner: "root:root"
122 permissions: "0755"
123 content: {get_file: ../scripts/prepare-metadata.py}
124 - path: /usr/share/metadata/lab-metadata.yaml
125 owner: "root:root"
126 permissions: "0644"
127 content: { get_param: hardware_metadata}
128
129 install_config_agent:
130 type: "OS::Heat::MultipartMime"
131 properties:
132 parts:
133 - config: {get_resource: software_config}
134 - config: {get_resource: inject_files}
135
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +0200136 server:
137 type: OS::Nova::Server
138 properties:
139 image: { get_param: image }
140 flavor: { get_param: flavor }
141 key_name: { get_param: key_name }
142 availability_zone: nova
143 networks:
144 - network: { get_param: accessible_network }
145 # NOTE(ohryhorov): connect to accessible network only as ironic doesn't
146 # support multitenancy use-case. Use private_floating_network for IPAM only.
Vasyl Saienko36f2edf2020-05-14 10:44:52 +0300147 # NOTE(vsaienko): ditto about ironic network
Vasyl Saienkof9ee1582020-03-02 16:53:41 +0200148 user_data_format: SOFTWARE_CONFIG
149 user_data: { get_resource: install_config_agent}
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +0200150 metadata: { get_param: metadata }
151
152 private_floating_server_port:
153 type: OS::Neutron::Port
154 properties:
155 network_id: { get_param: private_floating_network }
156 port_security_enabled: false
157 fixed_ips:
158 - subnet: { get_param: private_floating_subnet_id }
159
160 storage_backend_server_port:
161 type: OS::Neutron::Port
162 properties:
163 network_id: { get_param: storage_backend_network }
164 port_security_enabled: false
165 fixed_ips:
166 - subnet: { get_param: storage_backend_subnet_id }
167
168 storage_frontend_server_port:
169 type: OS::Neutron::Port
170 properties:
171 network_id: { get_param: storage_frontend_network }
172 port_security_enabled: false
173 fixed_ips:
174 - subnet: { get_param: storage_frontend_subnet_id }
175
Vasyl Saienko36f2edf2020-05-14 10:44:52 +0300176 ironic_baremetal_server_port:
177 type: OS::Neutron::Port
178 properties:
179 network_id: { get_param: ironic_baremetal_network }
180 port_security_enabled: false
181 fixed_ips:
182 - subnet: { get_param: ironic_baremetal_subnet_id }
183
Anton Samoylov13b055e2020-07-23 15:44:07 +0400184 tf_data_server_port:
185 type: OS::Neutron::Port
186 condition: create_tf_data_network_res
187 properties:
188 network_id: { get_param: tf_data_network }
189 port_security_enabled: false
190 fixed_ips:
191 - subnet: { get_param: tf_data_subnet_id }
192
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +0200193 wait_handle:
194 type: OS::Heat::WaitConditionHandle
195 wait_condition:
196 type: OS::Heat::WaitCondition
197 properties:
198 handle: { get_resource: wait_handle }
199 timeout: { get_param: boot_timeout }
200
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] }
Anton Samoylov13b055e2020-07-23 15:44:07 +0400212 server_tf_data_ip:
213 description: IP address of server in tf data network
214 value: { get_attr: [tf_data_server_port, fixed_ips, 0, ip_address] }
215 condition: create_tf_data_network_res
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +0200216 server_public_ip:
217 description: Floating IP address of server in public network
218 value: { get_attr: [server, networks, { get_param: accessible_network}, 0]}
Vasyl Saienkof9ee1582020-03-02 16:53:41 +0200219 wc_data:
220 description: Metadata from instance
221 value: { get_attr: [wait_condition, data]}