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