blob: 5599d11c4cec914280094412b60041af90329d8e [file] [log] [blame]
Oleh Hryhorovb58460e2020-02-05 15:53:48 +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 Hryhorovb58460e2020-02-05 15:53:48 +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
Vasyl Saienko0fa6f192020-03-06 16:08:51 +020033 control_network_cidr:
Oleh Hryhorovb58460e2020-02-05 15:53:48 +020034 type: string
35 functions_override:
36 type: string
37 boot_timeout:
38 type: number
39 description: Boot timeout for instance
Vasyl Saienkof36f39c2020-03-10 00:21:42 +020040 default: 3600
Oleh Hryhorovb58460e2020-02-05 15:53:48 +020041 ucp_master_host:
42 type: string
43 default: ''
44 public_net_id:
45 type: string
46 default: ''
Mykyta Karpin5ed5fd82020-01-27 18:23:29 +020047 docker_ee_release:
48 type: string
49 docker_ee_url:
50 type: string
Vasyl Saienkob59853e2020-05-25 10:15:26 +030051 docker_ucp_image:
52 type: string
Stepan Rogov60bc3522020-12-16 17:43:25 +030053 docker_default_address_pool:
54 type: string
Vasyl Saienkof9ee1582020-03-02 16:53:41 +020055 hardware_metadata:
56 description: The content of lab metadata.
57 default: ''
58 type: string
Vasyl Saienkofa9bed02021-11-04 18:52:45 +020059 availability_zone:
60 type: string
61 default: nova
Oleh Hryhorovb58460e2020-02-05 15:53:48 +020062
63resources:
64
65 software_config:
66 type: OS::Heat::SoftwareConfig
67 properties:
68 group: ungrouped
69 config:
70 str_replace:
71 template: { get_file: ../scripts/instance_boot.sh }
72 params:
73 $node_type: { get_param: node_type }
Vasyl Saienko8d34ad02021-07-26 11:55:23 +030074 $kubernetes_installer: { get_param: kubernetes_installer }
Oleh Hryhorovb58460e2020-02-05 15:53:48 +020075 $wait_condition_notify: { get_attr: [ wait_handle, curl_cli ] }
Mykyta Karpin5ed5fd82020-01-27 18:23:29 +020076 $docker_ee_url: { get_param: docker_ee_url }
77 $docker_ee_release: { get_param: docker_ee_release }
Oleh Hryhorovb58460e2020-02-05 15:53:48 +020078 $ucp_master_host: { get_param: ucp_master_host }
Vasyl Saienko84ee4fd2020-09-02 10:00:18 +030079 $docker_ucp_image: { get_param: docker_ucp_image }
Stepan Rogov60bc3522020-12-16 17:43:25 +030080 $docker_default_address_pool: { get_param: docker_default_address_pool }
Oleh Hryhorovb58460e2020-02-05 15:53:48 +020081 $node_metadata: { get_param: metadata }
Vasyl Saienko0fa6f192020-03-06 16:08:51 +020082 $control_network_cidr: { get_param: control_network_cidr }
Oleh Hryhorovb58460e2020-02-05 15:53:48 +020083 $private_floating_interface: { get_param: private_floating_interface }
Oleh Hryhorovca772092020-02-13 11:15:17 +020084 $private_floating_network_cidr: { get_param: private_floating_network_cidr }
Oleh Hryhorovb58460e2020-02-05 15:53:48 +020085 $private_floating_interface_ip: { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] }
86 $functions_override: { get_param: functions_override }
87
Vasyl Saienkof9ee1582020-03-02 16:53:41 +020088 inject_files:
89 type: "OS::Heat::CloudConfig"
90 properties:
91 cloud_config:
92 write_files:
93 - path: /usr/sbin/prepare-metadata.py
94 owner: "root:root"
95 permissions: "0755"
96 content: {get_file: ../scripts/prepare-metadata.py}
97 - path: /usr/share/metadata/lab-metadata.yaml
98 owner: "root:root"
99 permissions: "0644"
100 content: { get_param: hardware_metadata}
101
102 install_config_agent:
103 type: "OS::Heat::MultipartMime"
104 properties:
105 parts:
106 - config: {get_resource: software_config}
107 - config: {get_resource: inject_files}
108
Oleh Hryhorovb58460e2020-02-05 15:53:48 +0200109 server:
110 type: OS::Nova::Server
111 properties:
Mykyta Karpin8b164562021-03-19 15:20:23 +0200112 config_drive: true
Oleh Hryhorovb58460e2020-02-05 15:53:48 +0200113 image: { get_param: image }
114 flavor: { get_param: flavor }
115 key_name: { get_param: key_name }
Vasyl Saienkofa9bed02021-11-04 18:52:45 +0200116 availability_zone: { get_param: availability_zone }
Oleh Hryhorovb58460e2020-02-05 15:53:48 +0200117 networks:
118 - network: { get_param: accessible_network }
Vasyl Saienkof9ee1582020-03-02 16:53:41 +0200119 user_data_format: SOFTWARE_CONFIG
120 user_data: { get_resource: install_config_agent}
Oleh Hryhorovb58460e2020-02-05 15:53:48 +0200121 metadata: { get_param: metadata }
122
123 private_floating_server_port:
124 type: OS::Neutron::Port
125 properties:
126 network_id: { get_param: private_floating_network }
127 port_security_enabled: false
128 fixed_ips:
129 - subnet: { get_param: private_floating_subnet_id }
130
131 wait_handle:
132 type: OS::Heat::WaitConditionHandle
133 wait_condition:
134 type: OS::Heat::WaitCondition
135 properties:
136 handle: { get_resource: wait_handle }
137 timeout: { get_param: boot_timeout }
138
139
140outputs:
141 server_private_ip:
142 description: IP address of server in private network
143 value: { get_attr: [server, networks, { get_param: accessible_network}, 0]}
144 server_private_floating_ip:
145 description: IP address of server in private floating network
146 value: { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] }
147 server_public_ip:
148 description: Floating IP address of server in public network
149 value: { get_attr: [server, networks, { get_param: accessible_network}, 0]}
Vasyl Saienkof9ee1582020-03-02 16:53:41 +0200150 wc_data:
151 description: Metadata from instance
152 value: { get_attr: [wait_condition, data]}