blob: 7ab445156c30fa7aecf6b26ba9c81e6e6a3b1982 [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
Vasyl Saienko0fa6f192020-03-06 16:08:51 +020045 control_network_cidr:
Mateusz Lose2ad0772020-02-27 21:41:54 +010046 type: string
47 functions_override:
48 type: string
49 boot_timeout:
50 type: number
51 description: Boot timeout for instance
Vasyl Saienkof36f39c2020-03-10 00:21:42 +020052 default: 3600
Mateusz Lose2ad0772020-02-27 21:41:54 +010053 ucp_master_host:
54 type: string
55 default: ''
56 public_net_id:
57 type: string
58 docker_ee_release:
59 type: string
60 docker_ee_url:
61 type: string
Vasyl Saienkof9ee1582020-03-02 16:53:41 +020062 hardware_metadata:
63 description: The content of lab metadata.
64 type: string
Oleh Hryhorov33e30e22020-03-12 11:51:40 +020065 user_data_config:
66 description: This is part of clout-config which denies to mount drive with label ephemeral0 to /mnt
67 type: string
68 default: |
69 #cloud-config
70 #
71 # Don't mount ephemeral0 to /mnt as it's by default
72 mounts:
73 - [ ephemeral0, null ]
Mateusz Lose2ad0772020-02-27 21:41:54 +010074
75resources:
76
77 software_config:
78 type: OS::Heat::SoftwareConfig
79 properties:
80 group: ungrouped
81 config:
82 str_replace:
83 template: { get_file: ../scripts/instance_boot.sh }
84 params:
85 $node_type: { get_param: node_type }
86 $wait_condition_notify: { get_attr: [ wait_handle, curl_cli ] }
Mateusz Lose2ad0772020-02-27 21:41:54 +010087 $docker_ee_url: { get_param: docker_ee_url }
88 $docker_ee_release: { get_param: docker_ee_release }
89 $ucp_master_host: { get_param: ucp_master_host }
90 $node_metadata: { get_param: metadata }
Vasyl Saienko0fa6f192020-03-06 16:08:51 +020091 $control_network_cidr: { get_param: control_network_cidr }
Mateusz Lose2ad0772020-02-27 21:41:54 +010092 $private_floating_interface: { get_param: private_floating_interface }
93 $private_floating_interface_ip: { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] }
94 $private_floating_network_cidr: { get_param: private_floating_network_cidr }
95 $functions_override: { get_param: functions_override }
Oleh Hryhorov1832d232020-03-05 11:33:13 +020096 $storage_frontend_interface: { get_param: storage_frontend_interface }
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +020097 $storage_frontend_network_interface_ip: { get_attr: [storage_frontend_server_port, fixed_ips, 0, ip_address] }
98 $storage_frontend_network_cidr: { get_param: storage_frontend_network_cidr }
Vasyl Saienko36f2edf2020-05-14 10:44:52 +030099 $ironic_baremetal_interface_ip: { get_attr: [ironic_baremetal_server_port, fixed_ips, 0, ip_address] }
Vasyl Saienko4c468192020-05-19 11:51:13 +0300100 $ironic_baremetal_network_cidr: { get_param: ironic_baremetal_network_cidr }
Mateusz Lose2ad0772020-02-27 21:41:54 +0100101
Oleh Hryhorov6cd21902020-03-05 18:29:31 +0200102 inject_files:
103 type: "OS::Heat::CloudConfig"
104 properties:
105 cloud_config:
106 write_files:
107 - path: /usr/sbin/prepare-metadata.py
108 owner: "root:root"
109 permissions: "0755"
110 content: {get_file: ../scripts/prepare-metadata.py}
111 - path: /usr/share/metadata/lab-metadata.yaml
112 owner: "root:root"
113 permissions: "0644"
114 content: { get_param: hardware_metadata}
115
116 install_config_agent:
117 type: "OS::Heat::MultipartMime"
118 properties:
119 parts:
120 - config: {get_resource: software_config}
121 - config: {get_resource: inject_files}
Oleh Hryhorov33e30e22020-03-12 11:51:40 +0200122 - config: {get_param: user_data_config}
Oleh Hryhorov6cd21902020-03-05 18:29:31 +0200123
Mateusz Lose2ad0772020-02-27 21:41:54 +0100124 server:
125 type: OS::Nova::Server
126 properties:
127 image: { get_param: image }
128 flavor: { get_param: flavor }
129 key_name: { get_param: key_name }
130 availability_zone: nova
131 networks:
132 - port: { get_resource: accessible_server_port }
133 - port: { get_resource: private_floating_server_port }
134 - port: { get_resource: storage_frontend_server_port }
Vasyl Saienko36f2edf2020-05-14 10:44:52 +0300135 - port: { get_resource: ironic_baremetal_server_port }
Oleh Hryhorov6cd21902020-03-05 18:29:31 +0200136 user_data_format: SOFTWARE_CONFIG
137 user_data: { get_resource: install_config_agent}
Mateusz Lose2ad0772020-02-27 21:41:54 +0100138 metadata: { get_param: metadata }
139
140 accessible_server_port:
141 type: OS::Neutron::Port
142 properties:
143 network_id: { get_param: accessible_network }
144 port_security_enabled: false
145 fixed_ips:
146 - subnet: { get_param: accessible_subnet_id }
147
148 storage_frontend_server_port:
149 type: OS::Neutron::Port
150 properties:
151 network_id: { get_param: storage_frontend_network }
152 port_security_enabled: false
153 fixed_ips:
154 - subnet: { get_param: storage_frontend_subnet_id }
155
156 private_floating_server_port:
157 type: OS::Neutron::Port
158 properties:
159 network_id: { get_param: private_floating_network }
160 port_security_enabled: false
161 fixed_ips:
162 - subnet: { get_param: private_floating_subnet_id }
163
164 server_floating_ip:
165 type: OS::Neutron::FloatingIP
166 properties:
167 floating_network_id: { get_param: public_net_id }
168 port_id: { get_resource: accessible_server_port }
169
Vasyl Saienko36f2edf2020-05-14 10:44:52 +0300170 ironic_baremetal_server_port:
171 type: OS::Neutron::Port
172 properties:
173 network_id: { get_param: ironic_baremetal_network }
174 port_security_enabled: false
175 fixed_ips:
176 - subnet: { get_param: ironic_baremetal_subnet_id }
177
Mateusz Lose2ad0772020-02-27 21:41:54 +0100178 wait_handle:
179 type: OS::Heat::WaitConditionHandle
180 wait_condition:
181 type: OS::Heat::WaitCondition
182 properties:
183 handle: { get_resource: wait_handle }
184 timeout: { get_param: boot_timeout }
185
186outputs:
187 server_private_ip:
188 description: IP address of server in private network
189 value: { get_attr: [server, networks, { get_param: accessible_network}, 0]}
190 server_private_floating_ip:
191 description: IP address of server in private floating network
192 value: { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] }
Vasyl Saienko4e3f4632020-05-26 14:43:09 +0300193 server_ironic_baremetal_ip:
194 description: IP address of server in ironic baremetal network
195 value: { get_attr: [ironic_baremetal_server_port, fixed_ips, 0, ip_address] }
Mateusz Lose2ad0772020-02-27 21:41:54 +0100196 server_public_ip:
197 description: Floating IP address of server in public network
198 value: { get_attr: [ server_floating_ip, floating_ip_address ] }
Vasyl Saienkof9ee1582020-03-02 16:53:41 +0200199 wc_data:
200 description: Metadata from instance
201 value: { get_attr: [wait_condition, data]}