Newer
Older
class iaas::profile::haproxy (
$stats_enabled = undef,
$stats_ports = undef,
$stats_refresh = undef,
$stats_login = undef,
$stats_password = undef,
$stats_uri = undef,
$servers = undef,
Quentin MACHU
committed
class { '::haproxy':
defaults_options => {
'mode' => 'http',
'log' => 'global',
'option' => [
'tcplog',
'dontlognull',
'redispatch',
],
Quentin MACHU
committed
'retries' => '3',
'timeout' => [
'http-request 10s',
Quentin MACHU
committed
'queue 1m',
Quentin MACHU
committed
'connect 10s',
Quentin MACHU
committed
'client 1m',
'server 1m',
'http-keep-alive 10s',
Quentin MACHU
committed
'check 10s',
],
Quentin MACHU
committed
},
}
if stats_enabled {
haproxy::listen { 'stats':
ipaddress => '0.0.0.0',
mode => 'http',
ports => $stats_ports,
options => {
'stats' => [
'enable',
'hide-version',
"refresh ${stats_refresh}",
'show-node',
"auth ${stats_login}:${stats_password}",
"uri ${stats_uri}"
],
}
}
}
haproxy::listen { 'percona_cluster':
ipaddress => '0.0.0.0',
mode => 'tcp',
ports => '3306',
options => {
'option' => ['httpchk','tcpka'],
'balance' => 'leastconn',
if $servers != undef {
haproxy::balancermember { 'percona_cluster_prior':
listening_service => 'percona_cluster',
ports => '3307',
server_names => $servers[priority_hostname],
ipaddresses => $servers[priority_ip],
options => 'check port 9200',
}
haproxy::balancermember { 'percona_cluster_secondaries':
listening_service => 'percona_cluster',
ports => '3307',
server_names => $servers[hostnames],
ipaddresses => $servers[ips],
options => 'check port 9200 backup',
}
haproxy::listen { 'mysql_cluster_nova':
ipaddress => '0.0.0.0',
mode => 'tcp',
ports => '7306',
Quentin MACHU
committed
options => {
'option' => ['httpchk','tcpka'],
'balance' => 'leastconn',
Quentin MACHU
committed
}
}
if $servers != undef {
haproxy::balancermember { 'mysql_cluster_nova_prior':
listening_service => 'mysql_cluster_nova',
ports => '3307',
server_names => $servers[priority_hostname],
ipaddresses => $servers[priority_ip],
options => 'check port 9200',
}
haproxy::balancermember { 'mysql_cluster_nova_secondaries':
listening_service => 'mysql_cluster_nova',
ports => '3307',
server_names => $servers[hostnames],
ipaddresses => $servers[ips],
options => 'check port 9200 backup',
}
haproxy::listen { 'mysql_cluster_neutron':
ipaddress => '0.0.0.0',
mode => 'tcp',
ports => '9306',
options => {
'option' => ['httpchk','tcpka'],
'balance' => 'leastconn',
}
}
if $servers != undef {
haproxy::balancermember { 'mysql_cluster_neutron_prior':
listening_service => 'mysql_cluster_neutron',
ports => '3307',
server_names => $servers[priority_hostname],
ipaddresses => $servers[priority_ip],
options => 'check port 9200',
}
haproxy::balancermember { 'mysql_cluster_neutron_secondaries':
listening_service => 'mysql_cluster_neutron',
ports => '3307',
server_names => $servers[hostnames],
ipaddresses => $servers[ips],
options => 'check port 9200 backup',
}
# haproxy::listen { 'rabbitmq':
# ipaddress => '0.0.0.0',
# mode => 'tcp',
# ports => '5672',
# options => {
# 'option' => ['tcpka'],
# 'timeout' => [
# 'client 7d',
# 'server 7d',
# ]
# }
# }
# haproxy::listen { 'keystone_admin_cluster':
# ipaddress => '0.0.0.0',
# ports => '35357',
# options => {
# 'option' => ['tcpka', 'httpchk', 'tcplog'],
# }
# }
#
# haproxy::listen { 'keystone_public_internal_cluster':
# ipaddress => '0.0.0.0',
# ports => '5000',
# options => {
# 'option' => ['tcpka', 'httpchk', 'tcplog'],
# }
# }
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
# haproxy::listen { 'glance_api_cluster':
# ipaddress => '0.0.0.0',
# ports => '9292',
# options => {
# 'option' => ['tcpka', 'httpchk', 'tcplog'],
# }
# }
#
# haproxy::listen { 'glance_registry_cluster':
# ipaddress => '0.0.0.0',
# ports => '9191',
# options => {
# 'option' => ['tcpka', 'httpchk', 'tcplog'],
# 'http-check' => 'expect status 401',
# }
# }
#
# haproxy::listen { 'cinder_api_cluster':
# ipaddress => '0.0.0.0',
# ports => '8776',
# options => {
# 'option' => ['tcpka', 'httpchk', 'tcplog'],
# }
# }
#
# haproxy::listen { 'nova_api_cluster':
# ipaddress => '0.0.0.0',
# ports => '8774',
# options => {
# 'option' => ['tcpka', 'httpchk', 'tcplog'],
# }
# }
#
# haproxy::listen { 'nova_metadata_api_cluster':
# ipaddress => '0.0.0.0',
# ports => '8775',
# options => {
# 'option' => ['tcpka', 'httpchk', 'tcplog'],
# }
# }
#
# haproxy::listen { 'nova_novncproxy':
# ipaddress => '0.0.0.0',
# ports => '6080',
# options => {
# 'option' => ['tcpka', 'tcplog'],
# }
# }
#
# haproxy::listen { 'neutron_api_cluster':
# ipaddress => '0.0.0.0',
# ports => '9696',
# options => {
# 'option' => ['tcpka', 'httpchk', 'tcplog'],
# }
# }
#
# haproxy::listen { 'heat_api_cluster':
# ipaddress => '0.0.0.0',
# ports => '8004',
# options => {
# 'option' => ['tcpka', 'httpchk', 'tcplog'],
# }
# }
#
# haproxy::listen { 'heat_api_cfn_cluster':
# ipaddress => '0.0.0.0',
# ports => '8000',
# options => {
# 'option' => ['tcpka', 'httpchk', 'tcplog'],
# }
# }
#
# haproxy::listen { 'heat_api_cw_cluster':
# ipaddress => '0.0.0.0',
# ports => '8003',
# options => {
# 'option' => ['tcpka', 'httpchk', 'tcplog'],
# }
# }
#
# haproxy::listen { 'horizon_cluster':
# ipaddress => '0.0.0.0',
# ports => '80',
# options => {
# 'option' => ['tcpka', 'httpchk', 'tcplog'],
# }
# }
#
# haproxy::listen { 'ceilometer_api_cluster':
# ipaddress => '0.0.0.0',
# ports => '8777',
# options => {
# 'option' => ['tcpka', 'httpchk', 'tcplog'],
# 'http-check' => 'expect status 401',
# }
# }