Commit a2103257 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

make server_check_path optional in haproxy recipe.

parent c80a0c9a
......@@ -87,7 +87,11 @@ class Recipe(GenericBaseRecipe):
'haproxy-listen-snippet.cfg.in')
server_snippet = ""
ip = self.options['ip']
server_check_path = self.options['server-check-path']
server_check_path = self.options.get('server-check-path', None)
if server_check_path:
httpchk = 'option httpchk GET %s' % server_check_path
else:
httpchk = ''
# FIXME: maxconn must be provided per-backend, not globally
maxconn = self.options['maxconn']
i = 0
......@@ -97,7 +101,7 @@ class Recipe(GenericBaseRecipe):
'name': name,
'ip': ip,
'port': port,
'server_check_path': server_check_path,
'httpchk': httpchk,
})
for address in backend_list:
i += 1
......
listen %(name)s %(ip)s:%(port)s
cookie SERVERID insert
balance roundrobin
option httpchk GET %(server_check_path)s
%(httpchk)s
stats uri /haproxy
stats realm Global\ statistics
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment