blob: 05226727b7c101e2b414975099af2fd83f1f7dfc [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
Mateusz Lose2ad0772020-02-27 21:41:54 +010047 host_interface:
48 type: string
49 functions_override:
50 type: string
51 boot_timeout:
52 type: number
53 description: Boot timeout for instance
54 default: 1200
55 ucp_master_host:
56 type: string
57 default: ''
58 public_net_id:
59 type: string
60 docker_ee_release:
61 type: string
62 docker_ee_url:
63 type: string
64
65resources:
66
67 software_config:
68 type: OS::Heat::SoftwareConfig
69 properties:
70 group: ungrouped
71 config:
72 str_replace:
73 template: { get_file: ../scripts/instance_boot.sh }
74 params:
75 $node_type: { get_param: node_type }
76 $wait_condition_notify: { get_attr: [ wait_handle, curl_cli ] }
77 $ucp_license_key: { get_file: ../scripts/license.lic }
78 $docker_ee_url: { get_param: docker_ee_url }
79 $docker_ee_release: { get_param: docker_ee_release }
80 $ucp_master_host: { get_param: ucp_master_host }
81 $node_metadata: { get_param: metadata }
82 $host_interface: { get_param: host_interface }
83 $private_floating_interface: { get_param: private_floating_interface }
84 $private_floating_interface_ip: { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] }
85 $private_floating_network_cidr: { get_param: private_floating_network_cidr }
86 $functions_override: { get_param: functions_override }
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +020087 $storage_frontend_interface: { get_param: storage_frontend_interface }
88 $storage_frontend_network_interface_ip: { get_attr: [storage_frontend_server_port, fixed_ips, 0, ip_address] }
89 $storage_frontend_network_cidr: { get_param: storage_frontend_network_cidr }
90 $storage_backend_interface: { get_param: storage_backend_interface }
91 $storage_backend_network_interface_ip: { get_attr: [storage_backend_server_port, fixed_ips, 0, ip_address] }
92 $storage_backend_network_cidr: { get_param: storage_backend_network_cidr }
Mateusz Lose2ad0772020-02-27 21:41:54 +010093
94 server:
95 type: OS::Nova::Server
96 properties:
97 image: { get_param: image }
98 flavor: { get_param: flavor }
99 key_name: { get_param: key_name }
100 availability_zone: nova
101 networks:
102 - port: { get_resource: accessible_server_port }
103 - port: { get_resource: private_floating_server_port }
Mateusz Lose2ad0772020-02-27 21:41:54 +0100104 - port: { get_resource: storage_frontend_server_port }
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +0200105 - port: { get_resource: storage_backend_server_port }
Mateusz Lose2ad0772020-02-27 21:41:54 +0100106 user_data_format: RAW
107 user_data: { get_resource: software_config }
108 metadata: { get_param: metadata }
109
110 accessible_server_port:
111 type: OS::Neutron::Port
112 properties:
113 network_id: { get_param: accessible_network }
114 port_security_enabled: false
115 fixed_ips:
116 - subnet: { get_param: accessible_subnet_id }
117
118 storage_backend_server_port:
119 type: OS::Neutron::Port
120 properties:
121 network_id: { get_param: storage_backend_network }
122 port_security_enabled: false
123 fixed_ips:
124 - subnet: { get_param: storage_backend_subnet_id }
125
126 storage_frontend_server_port:
127 type: OS::Neutron::Port
128 properties:
129 network_id: { get_param: storage_frontend_network }
130 port_security_enabled: false
131 fixed_ips:
132 - subnet: { get_param: storage_frontend_subnet_id }
133
134 private_floating_server_port:
135 type: OS::Neutron::Port
136 properties:
137 network_id: { get_param: private_floating_network }
138 port_security_enabled: false
139 fixed_ips:
140 - subnet: { get_param: private_floating_subnet_id }
141
142 server_floating_ip:
143 type: OS::Neutron::FloatingIP
144 properties:
145 floating_network_id: { get_param: public_net_id }
146 port_id: { get_resource: accessible_server_port }
147
148 wait_handle:
149 type: OS::Heat::WaitConditionHandle
150 wait_condition:
151 type: OS::Heat::WaitCondition
152 properties:
153 handle: { get_resource: wait_handle }
154 timeout: { get_param: boot_timeout }
155
156outputs:
157 server_private_ip:
158 description: IP address of server in private network
159 value: { get_attr: [server, networks, { get_param: accessible_network}, 0]}
160 server_private_floating_ip:
161 description: IP address of server in private floating network
162 value: { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] }
163 server_public_ip:
164 description: Floating IP address of server in public network
165 value: { get_attr: [ server_floating_ip, floating_ip_address ] }