blob: 68f937b6192dfd8ce43190c0c775522656a1fdf9 [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
Mateusz Lose2ad0772020-02-27 21:41:54 +010039 host_interface:
40 type: string
41 functions_override:
42 type: string
43 boot_timeout:
44 type: number
45 description: Boot timeout for instance
46 default: 1200
47 ucp_master_host:
48 type: string
49 default: ''
50 public_net_id:
51 type: string
52 docker_ee_release:
53 type: string
54 docker_ee_url:
55 type: string
56
57resources:
58
59 software_config:
60 type: OS::Heat::SoftwareConfig
61 properties:
62 group: ungrouped
63 config:
64 str_replace:
65 template: { get_file: ../scripts/instance_boot.sh }
66 params:
67 $node_type: { get_param: node_type }
68 $wait_condition_notify: { get_attr: [ wait_handle, curl_cli ] }
69 $ucp_license_key: { get_file: ../scripts/license.lic }
70 $docker_ee_url: { get_param: docker_ee_url }
71 $docker_ee_release: { get_param: docker_ee_release }
72 $ucp_master_host: { get_param: ucp_master_host }
73 $node_metadata: { get_param: metadata }
74 $host_interface: { get_param: host_interface }
75 $private_floating_interface: { get_param: private_floating_interface }
76 $private_floating_interface_ip: { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] }
77 $private_floating_network_cidr: { get_param: private_floating_network_cidr }
78 $functions_override: { get_param: functions_override }
Oleh Hryhorov1832d232020-03-05 11:33:13 +020079 $storage_frontend_interface: { get_param: storage_frontend_interface }
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +020080 $storage_frontend_network_interface_ip: { get_attr: [storage_frontend_server_port, fixed_ips, 0, ip_address] }
81 $storage_frontend_network_cidr: { get_param: storage_frontend_network_cidr }
Mateusz Lose2ad0772020-02-27 21:41:54 +010082
83 server:
84 type: OS::Nova::Server
85 properties:
86 image: { get_param: image }
87 flavor: { get_param: flavor }
88 key_name: { get_param: key_name }
89 availability_zone: nova
90 networks:
91 - port: { get_resource: accessible_server_port }
92 - port: { get_resource: private_floating_server_port }
93 - port: { get_resource: storage_frontend_server_port }
94 user_data_format: RAW
95 user_data: { get_resource: software_config }
96 metadata: { get_param: metadata }
97
98 accessible_server_port:
99 type: OS::Neutron::Port
100 properties:
101 network_id: { get_param: accessible_network }
102 port_security_enabled: false
103 fixed_ips:
104 - subnet: { get_param: accessible_subnet_id }
105
106 storage_frontend_server_port:
107 type: OS::Neutron::Port
108 properties:
109 network_id: { get_param: storage_frontend_network }
110 port_security_enabled: false
111 fixed_ips:
112 - subnet: { get_param: storage_frontend_subnet_id }
113
114 private_floating_server_port:
115 type: OS::Neutron::Port
116 properties:
117 network_id: { get_param: private_floating_network }
118 port_security_enabled: false
119 fixed_ips:
120 - subnet: { get_param: private_floating_subnet_id }
121
122 server_floating_ip:
123 type: OS::Neutron::FloatingIP
124 properties:
125 floating_network_id: { get_param: public_net_id }
126 port_id: { get_resource: accessible_server_port }
127
128 wait_handle:
129 type: OS::Heat::WaitConditionHandle
130 wait_condition:
131 type: OS::Heat::WaitCondition
132 properties:
133 handle: { get_resource: wait_handle }
134 timeout: { get_param: boot_timeout }
135
136outputs:
137 server_private_ip:
138 description: IP address of server in private network
139 value: { get_attr: [server, networks, { get_param: accessible_network}, 0]}
140 server_private_floating_ip:
141 description: IP address of server in private floating network
142 value: { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] }
143 server_public_ip:
144 description: Floating IP address of server in public network
145 value: { get_attr: [ server_floating_ip, floating_ip_address ] }