blob: c06fd188fa71afd6f72b108c73e8fbb434e84a59 [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_frontend_network_cidr:
32 type: string
Mateusz Lose2ad0772020-02-27 21:41:54 +010033 storage_frontend_network:
34 type: string
35 storage_frontend_subnet_id:
36 type: string
Oleh Hryhorov1832d232020-03-05 11:33:13 +020037 storage_frontend_interface:
38 type: string
Vasyl Saienko36f2edf2020-05-14 10:44:52 +030039 ironic_baremetal_network:
40 type: string
41 ironic_baremetal_subnet_id:
42 type: string
Vasyl Saienko4c468192020-05-19 11:51:13 +030043 ironic_baremetal_network_cidr:
Vasyl Saienko36f2edf2020-05-14 10:44:52 +030044 type: string
Michael Polenchuk486cadf2020-08-24 16:25:51 +040045 ironic_baremetal_tunnel_cidr:
46 type: string
47 ironic_mt_enabled:
48 type: boolean
Vasyl Saienko0fa6f192020-03-06 16:08:51 +020049 control_network_cidr:
Mateusz Lose2ad0772020-02-27 21:41:54 +010050 type: string
51 functions_override:
52 type: string
53 boot_timeout:
54 type: number
55 description: Boot timeout for instance
Vasyl Saienkof36f39c2020-03-10 00:21:42 +020056 default: 3600
Mateusz Lose2ad0772020-02-27 21:41:54 +010057 ucp_master_host:
58 type: string
59 default: ''
Vasyl Saienko84ee4fd2020-09-02 10:00:18 +030060 docker_ucp_image:
61 type: string
Stepan Rogov60bc3522020-12-16 17:43:25 +030062 docker_default_address_pool:
63 type: string
Mateusz Lose2ad0772020-02-27 21:41:54 +010064 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 ] }
Mateusz Lose2ad0772020-02-27 21:41:54 +010095 $docker_ee_url: { get_param: docker_ee_url }
96 $docker_ee_release: { get_param: docker_ee_release }
97 $ucp_master_host: { get_param: ucp_master_host }
Vasyl Saienko84ee4fd2020-09-02 10:00:18 +030098 $docker_ucp_image: { get_param: docker_ucp_image }
Stepan Rogov60bc3522020-12-16 17:43:25 +030099 $docker_default_address_pool: { get_param: docker_default_address_pool }
Mateusz Lose2ad0772020-02-27 21:41:54 +0100100 $node_metadata: { get_param: metadata }
Vasyl Saienko0fa6f192020-03-06 16:08:51 +0200101 $control_network_cidr: { get_param: control_network_cidr }
Mateusz Lose2ad0772020-02-27 21:41:54 +0100102 $private_floating_interface: { get_param: private_floating_interface }
103 $private_floating_interface_ip: { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] }
104 $private_floating_network_cidr: { get_param: private_floating_network_cidr }
105 $functions_override: { get_param: functions_override }
Oleh Hryhorov1832d232020-03-05 11:33:13 +0200106 $storage_frontend_interface: { get_param: storage_frontend_interface }
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +0200107 $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 }
Vasyl Saienko36f2edf2020-05-14 10:44:52 +0300109 $ironic_baremetal_interface_ip: { get_attr: [ironic_baremetal_server_port, fixed_ips, 0, ip_address] }
Vasyl Saienko4c468192020-05-19 11:51:13 +0300110 $ironic_baremetal_network_cidr: { get_param: ironic_baremetal_network_cidr }
Michael Polenchuk486cadf2020-08-24 16:25:51 +0400111 $ironic_baremetal_tunnel_cidr: { get_param: ironic_baremetal_tunnel_cidr }
112 $ironic_mt_enabled: { get_param: ironic_mt_enabled }
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:
Mykyta Karpin8b164562021-03-19 15:20:23 +0200139 config_drive: true
Mateusz Lose2ad0772020-02-27 21:41:54 +0100140 image: { get_param: image }
141 flavor: { get_param: flavor }
142 key_name: { get_param: key_name }
143 availability_zone: nova
144 networks:
145 - port: { get_resource: accessible_server_port }
146 - port: { get_resource: private_floating_server_port }
147 - port: { get_resource: storage_frontend_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_frontend_server_port:
162 type: OS::Neutron::Port
163 properties:
164 network_id: { get_param: storage_frontend_network }
165 port_security_enabled: false
166 fixed_ips:
167 - subnet: { get_param: storage_frontend_subnet_id }
168
169 private_floating_server_port:
170 type: OS::Neutron::Port
171 properties:
172 network_id: { get_param: private_floating_network }
173 port_security_enabled: false
174 fixed_ips:
175 - subnet: { get_param: private_floating_subnet_id }
176
177 server_floating_ip:
178 type: OS::Neutron::FloatingIP
179 properties:
180 floating_network_id: { get_param: public_net_id }
181 port_id: { get_resource: accessible_server_port }
182
Vasyl Saienko36f2edf2020-05-14 10:44:52 +0300183 ironic_baremetal_server_port:
184 type: OS::Neutron::Port
185 properties:
186 network_id: { get_param: ironic_baremetal_network }
187 port_security_enabled: false
188 fixed_ips:
189 - subnet: { get_param: ironic_baremetal_subnet_id }
190
Mateusz Lose2ad0772020-02-27 21:41:54 +0100191 wait_handle:
192 type: OS::Heat::WaitConditionHandle
193 wait_condition:
194 type: OS::Heat::WaitCondition
195 properties:
196 handle: { get_resource: wait_handle }
197 timeout: { get_param: boot_timeout }
198
199outputs:
200 server_private_ip:
201 description: IP address of server in private network
202 value: { get_attr: [server, networks, { get_param: accessible_network}, 0]}
203 server_private_floating_ip:
204 description: IP address of server in private floating network
205 value: { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] }
Vasyl Saienko4e3f4632020-05-26 14:43:09 +0300206 server_ironic_baremetal_ip:
207 description: IP address of server in ironic baremetal network
208 value: { get_attr: [ironic_baremetal_server_port, fixed_ips, 0, ip_address] }
Mateusz Lose2ad0772020-02-27 21:41:54 +0100209 server_public_ip:
210 description: Floating IP address of server in public network
211 value: { get_attr: [ server_floating_ip, floating_ip_address ] }
Vasyl Saienkof9ee1582020-03-02 16:53:41 +0200212 wc_data:
213 description: Metadata from instance
214 value: { get_attr: [wait_condition, data]}