blob: 8ba5d558a3f2242a570092b11c762e07fbab3ddd [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
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
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +020031 storage_backend_network_cidr:
32 type: string
Mateusz Lose2ad0772020-02-27 21:41:54 +010033 storage_backend_network:
34 type: string
35 storage_backend_subnet_id:
36 type: string
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +020037 storage_backend_interface:
38 type: string
Mateusz Lose2ad0772020-02-27 21:41:54 +010039 storage_frontend_network:
40 type: string
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +020041 storage_frontend_network_cidr:
42 type: string
Mateusz Lose2ad0772020-02-27 21:41:54 +010043 storage_frontend_subnet_id:
44 type: string
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +020045 storage_frontend_interface:
46 type: string
Vasyl Saienko0fa6f192020-03-06 16:08:51 +020047 control_network_cidr:
Mateusz Lose2ad0772020-02-27 21:41:54 +010048 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
Mateusz Lose2ad0772020-02-27 21:41:54 +010055 functions_override:
56 type: string
57 boot_timeout:
58 type: number
59 description: Boot timeout for instance
Vasyl Saienkof36f39c2020-03-10 00:21:42 +020060 default: 3600
Mateusz Lose2ad0772020-02-27 21:41:54 +010061 ucp_master_host:
62 type: string
63 default: ''
64 public_net_id:
65 type: string
66 docker_ee_release:
67 type: string
68 docker_ee_url:
69 type: string
Vasyl Saienkof9ee1582020-03-02 16:53:41 +020070 hardware_metadata:
71 description: The content of lab metadata.
72 type: string
Oleh Hryhorov33e30e22020-03-12 11:51:40 +020073 user_data_config:
74 description: This is part of clout-config which denies to mount drive with label ephemeral0 to /mnt
75 type: string
76 default: |
77 #cloud-config
78 #
79 # Don't mount ephemeral0 to /mnt as it's by default
80 mounts:
81 - [ ephemeral0, null ]
Mateusz Lose2ad0772020-02-27 21:41:54 +010082
83resources:
84
85 software_config:
86 type: OS::Heat::SoftwareConfig
87 properties:
88 group: ungrouped
89 config:
90 str_replace:
91 template: { get_file: ../scripts/instance_boot.sh }
92 params:
93 $node_type: { get_param: node_type }
94 $wait_condition_notify: { get_attr: [ wait_handle, curl_cli ] }
95 $ucp_license_key: { get_file: ../scripts/license.lic }
96 $docker_ee_url: { get_param: docker_ee_url }
97 $docker_ee_release: { get_param: docker_ee_release }
98 $ucp_master_host: { get_param: ucp_master_host }
99 $node_metadata: { get_param: metadata }
Vasyl Saienko0fa6f192020-03-06 16:08:51 +0200100 $control_network_cidr: { get_param: control_network_cidr }
Mateusz Lose2ad0772020-02-27 21:41:54 +0100101 $private_floating_interface: { get_param: private_floating_interface }
102 $private_floating_interface_ip: { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] }
103 $private_floating_network_cidr: { get_param: private_floating_network_cidr }
104 $functions_override: { get_param: functions_override }
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +0200105 $storage_frontend_interface: { get_param: storage_frontend_interface }
106 $storage_frontend_network_interface_ip: { get_attr: [storage_frontend_server_port, fixed_ips, 0, ip_address] }
107 $storage_frontend_network_cidr: { get_param: storage_frontend_network_cidr }
108 $storage_backend_interface: { get_param: storage_backend_interface }
109 $storage_backend_network_interface_ip: { get_attr: [storage_backend_server_port, fixed_ips, 0, ip_address] }
110 $storage_backend_network_cidr: { get_param: storage_backend_network_cidr }
Vasyl Saienko36f2edf2020-05-14 10:44:52 +0300111 $ironic_baremetal_interface_ip: { get_attr: [ironic_baremetal_server_port, fixed_ips, 0, ip_address] }
Vasyl Saienko4c468192020-05-19 11:51:13 +0300112 $ironic_baremetal_network_cidr: { get_param: ironic_baremetal_network_cidr }
Mateusz Lose2ad0772020-02-27 21:41:54 +0100113
Oleh Hryhorov6cd21902020-03-05 18:29:31 +0200114 inject_files:
115 type: "OS::Heat::CloudConfig"
116 properties:
117 cloud_config:
118 write_files:
119 - path: /usr/sbin/prepare-metadata.py
120 owner: "root:root"
121 permissions: "0755"
122 content: {get_file: ../scripts/prepare-metadata.py}
123 - path: /usr/share/metadata/lab-metadata.yaml
124 owner: "root:root"
125 permissions: "0644"
126 content: { get_param: hardware_metadata}
127
128 install_config_agent:
129 type: "OS::Heat::MultipartMime"
130 properties:
131 parts:
132 - config: {get_resource: software_config}
133 - config: {get_resource: inject_files}
Oleh Hryhorov33e30e22020-03-12 11:51:40 +0200134 - config: {get_param: user_data_config}
Oleh Hryhorov6cd21902020-03-05 18:29:31 +0200135
Mateusz Lose2ad0772020-02-27 21:41:54 +0100136 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 - port: { get_resource: accessible_server_port }
145 - port: { get_resource: private_floating_server_port }
Mateusz Lose2ad0772020-02-27 21:41:54 +0100146 - port: { get_resource: storage_frontend_server_port }
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +0200147 - port: { get_resource: storage_backend_server_port }
Vasyl Saienko36f2edf2020-05-14 10:44:52 +0300148 - port: { get_resource: ironic_baremetal_server_port }
Oleh Hryhorov6cd21902020-03-05 18:29:31 +0200149 user_data_format: SOFTWARE_CONFIG
150 user_data: { get_resource: install_config_agent}
Mateusz Lose2ad0772020-02-27 21:41:54 +0100151 metadata: { get_param: metadata }
152
153 accessible_server_port:
154 type: OS::Neutron::Port
155 properties:
156 network_id: { get_param: accessible_network }
157 port_security_enabled: false
158 fixed_ips:
159 - subnet: { get_param: accessible_subnet_id }
160
161 storage_backend_server_port:
162 type: OS::Neutron::Port
163 properties:
164 network_id: { get_param: storage_backend_network }
165 port_security_enabled: false
166 fixed_ips:
167 - subnet: { get_param: storage_backend_subnet_id }
168
169 storage_frontend_server_port:
170 type: OS::Neutron::Port
171 properties:
172 network_id: { get_param: storage_frontend_network }
173 port_security_enabled: false
174 fixed_ips:
175 - subnet: { get_param: storage_frontend_subnet_id }
176
177 private_floating_server_port:
178 type: OS::Neutron::Port
179 properties:
180 network_id: { get_param: private_floating_network }
181 port_security_enabled: false
182 fixed_ips:
183 - subnet: { get_param: private_floating_subnet_id }
184
185 server_floating_ip:
186 type: OS::Neutron::FloatingIP
187 properties:
188 floating_network_id: { get_param: public_net_id }
189 port_id: { get_resource: accessible_server_port }
190
Vasyl Saienko36f2edf2020-05-14 10:44:52 +0300191 ironic_baremetal_server_port:
192 type: OS::Neutron::Port
193 properties:
194 network_id: { get_param: ironic_baremetal_network }
195 port_security_enabled: false
196 fixed_ips:
197 - subnet: { get_param: ironic_baremetal_subnet_id }
198
Mateusz Lose2ad0772020-02-27 21:41:54 +0100199 wait_handle:
200 type: OS::Heat::WaitConditionHandle
201 wait_condition:
202 type: OS::Heat::WaitCondition
203 properties:
204 handle: { get_resource: wait_handle }
205 timeout: { get_param: boot_timeout }
206
207outputs:
208 server_private_ip:
209 description: IP address of server in private network
210 value: { get_attr: [server, networks, { get_param: accessible_network}, 0]}
211 server_private_floating_ip:
212 description: IP address of server in private floating network
213 value: { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] }
Vasyl Saienko4e3f4632020-05-26 14:43:09 +0300214 server_ironic_baremetal_ip:
215 description: IP address of server in ironic baremetal network
216 value: { get_attr: [ironic_baremetal_server_port, fixed_ips, 0, ip_address] }
Mateusz Lose2ad0772020-02-27 21:41:54 +0100217 server_public_ip:
218 description: Floating IP address of server in public network
219 value: { get_attr: [ server_floating_ip, floating_ip_address ] }
Vasyl Saienkof9ee1582020-03-02 16:53:41 +0200220 wc_data:
221 description: Metadata from instance
222 value: { get_attr: [wait_condition, data]}