blob: f3d4b7a7a468b78f1f00ce7939ed987f032d1823 [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
Vasyl Saienko8d34ad02021-07-26 11:55:23 +030010 kubernetes_installer:
11 type: string
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +020012 key_name:
13 type: string
14 description: Name of keypair to assign to servers
15 image:
16 type: string
17 description: Name of image to use for servers
18 flavor:
19 type: string
20 description: Flavor to use for servers
21 accessible_network:
22 type: string
23 accessible_subnet_id:
24 type: string
25 private_floating_network:
26 type: string
27 private_floating_network_cidr:
28 type: string
29 private_floating_subnet_id:
30 type: string
31 private_floating_interface:
32 type: string
33 storage_frontend_network_cidr:
34 type: string
35 storage_frontend_network:
36 type: string
37 storage_frontend_subnet_id:
38 type: string
Oleh Hryhorov1832d232020-03-05 11:33:13 +020039 storage_frontend_interface:
40 type: string
Vasyl Saienko0fa6f192020-03-06 16:08:51 +020041 control_network_cidr:
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +020042 type: string
Vasyl Saienko36f2edf2020-05-14 10:44:52 +030043 ironic_baremetal_network:
44 type: string
45 ironic_baremetal_subnet_id:
46 type: string
Vasyl Saienko4c468192020-05-19 11:51:13 +030047 ironic_baremetal_network_cidr:
Vasyl Saienko36f2edf2020-05-14 10:44:52 +030048 type: string
Michael Polenchuk486cadf2020-08-24 16:25:51 +040049 ironic_baremetal_tunnel_cidr:
50 type: string
51 ironic_mt_enabled:
52 type: boolean
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +020053 functions_override:
54 type: string
55 boot_timeout:
56 type: number
57 description: Boot timeout for instance
Vasyl Saienkof36f39c2020-03-10 00:21:42 +020058 default: 3600
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +020059 ucp_master_host:
60 type: string
61 default: ''
Vasyl Saienko84ee4fd2020-09-02 10:00:18 +030062 docker_ucp_image:
63 type: string
Stepan Rogov60bc3522020-12-16 17:43:25 +030064 docker_default_address_pool:
65 type: string
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +020066 public_net_id:
67 type: string
68 default: ''
69 docker_ee_release:
70 type: string
71 docker_ee_url:
72 type: string
Vasyl Saienkof9ee1582020-03-02 16:53:41 +020073 hardware_metadata:
74 description: The content of lab metadata.
75 type: string
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +020076
77resources:
78
79 software_config:
80 type: OS::Heat::SoftwareConfig
81 properties:
82 group: ungrouped
83 config:
84 str_replace:
85 template: { get_file: ../scripts/instance_boot.sh }
86 params:
87 $node_type: { get_param: node_type }
Vasyl Saienko8d34ad02021-07-26 11:55:23 +030088 $kubernetes_installer: { get_param: kubernetes_installer }
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +020089 $wait_condition_notify: { get_attr: [ wait_handle, curl_cli ] }
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +020090 $docker_ee_url: { get_param: docker_ee_url }
91 $docker_ee_release: { get_param: docker_ee_release }
92 $ucp_master_host: { get_param: ucp_master_host }
Vasyl Saienko84ee4fd2020-09-02 10:00:18 +030093 $docker_ucp_image: { get_param: docker_ucp_image }
Stepan Rogov60bc3522020-12-16 17:43:25 +030094 $docker_default_address_pool: { get_param: docker_default_address_pool }
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +020095 $node_metadata: { get_param: metadata }
Vasyl Saienko0fa6f192020-03-06 16:08:51 +020096 $control_network_cidr: { get_param: control_network_cidr }
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +020097 $private_floating_interface: { get_param: private_floating_interface }
98 $private_floating_network_cidr: { get_param: private_floating_network_cidr }
99 $private_floating_interface_ip: { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] }
100 $functions_override: { get_param: functions_override }
Oleh Hryhorov1832d232020-03-05 11:33:13 +0200101 $storage_frontend_interface: { get_param: storage_frontend_interface }
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +0200102 $storage_frontend_network_interface_ip: { get_attr: [storage_frontend_server_port, fixed_ips, 0, ip_address] }
103 $storage_frontend_network_cidr: { get_param: storage_frontend_network_cidr }
Vasyl Saienko36f2edf2020-05-14 10:44:52 +0300104 $ironic_baremetal_interface_ip: { get_attr: [ironic_baremetal_server_port, fixed_ips, 0, ip_address] }
Vasyl Saienko4c468192020-05-19 11:51:13 +0300105 $ironic_baremetal_network_cidr: { get_param: ironic_baremetal_network_cidr }
Michael Polenchuk486cadf2020-08-24 16:25:51 +0400106 $ironic_baremetal_tunnel_cidr: { get_param: ironic_baremetal_tunnel_cidr }
107 $ironic_mt_enabled: { get_param: ironic_mt_enabled }
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +0200108
Vasyl Saienkof9ee1582020-03-02 16:53:41 +0200109 inject_files:
110 type: "OS::Heat::CloudConfig"
111 properties:
112 cloud_config:
113 write_files:
114 - path: /usr/sbin/prepare-metadata.py
115 owner: "root:root"
116 permissions: "0755"
117 content: {get_file: ../scripts/prepare-metadata.py}
118 - path: /usr/share/metadata/lab-metadata.yaml
119 owner: "root:root"
120 permissions: "0644"
121 content: { get_param: hardware_metadata}
122
123 install_config_agent:
124 type: "OS::Heat::MultipartMime"
125 properties:
126 parts:
127 - config: {get_resource: software_config}
128 - config: {get_resource: inject_files}
129
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +0200130 server:
131 type: OS::Nova::Server
132 properties:
Mykyta Karpin8b164562021-03-19 15:20:23 +0200133 config_drive: true
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +0200134 image: { get_param: image }
135 flavor: { get_param: flavor }
136 key_name: { get_param: key_name }
137 availability_zone: nova
138 networks:
139 - network: { get_param: accessible_network }
140 # NOTE(ohryhorov): connect to accessible network only as ironic doesn't
141 # support multitenancy use-case. Use private_floating_network for IPAM only.
Vasyl Saienko36f2edf2020-05-14 10:44:52 +0300142 # NOTE(vsaienko): ditto about ironic baremetal network
Vasyl Saienkof9ee1582020-03-02 16:53:41 +0200143 user_data_format: SOFTWARE_CONFIG
144 user_data: { get_resource: install_config_agent}
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +0200145 metadata: { get_param: metadata }
146
147 private_floating_server_port:
148 type: OS::Neutron::Port
149 properties:
150 network_id: { get_param: private_floating_network }
151 port_security_enabled: false
152 fixed_ips:
153 - subnet: { get_param: private_floating_subnet_id }
154
155 storage_frontend_server_port:
156 type: OS::Neutron::Port
157 properties:
158 network_id: { get_param: storage_frontend_network }
159 port_security_enabled: false
160 fixed_ips:
161 - subnet: { get_param: storage_frontend_subnet_id }
162
Vasyl Saienko36f2edf2020-05-14 10:44:52 +0300163 ironic_baremetal_server_port:
164 type: OS::Neutron::Port
165 properties:
166 network_id: { get_param: ironic_baremetal_network }
167 port_security_enabled: false
168 fixed_ips:
169 - subnet: { get_param: ironic_baremetal_subnet_id }
170
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +0200171 wait_handle:
172 type: OS::Heat::WaitConditionHandle
173 wait_condition:
174 type: OS::Heat::WaitCondition
175 properties:
176 handle: { get_resource: wait_handle }
177 timeout: { get_param: boot_timeout }
178
179
180outputs:
181 server_private_ip:
182 description: IP address of server in private network
183 value: { get_attr: [server, networks, { get_param: accessible_network}, 0]}
184 server_private_floating_ip:
185 description: IP address of server in private floating network
186 value: { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] }
Vasyl Saienko4e3f4632020-05-26 14:43:09 +0300187 server_ironic_baremetal_ip:
188 description: IP address of server in ironic baremetal network
189 value: { get_attr: [ironic_baremetal_server_port, fixed_ips, 0, ip_address] }
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +0200190 server_public_ip:
191 description: Floating IP address of server in public network
192 value: { get_attr: [server, networks, { get_param: accessible_network}, 0]}
Vasyl Saienkof9ee1582020-03-02 16:53:41 +0200193 wc_data:
194 description: Metadata from instance
195 value: { get_attr: [wait_condition, data]}