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): ...@@ -87,7 +87,11 @@ class Recipe(GenericBaseRecipe):
'haproxy-listen-snippet.cfg.in') 'haproxy-listen-snippet.cfg.in')
server_snippet = "" server_snippet = ""
ip = self.options['ip'] 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 # FIXME: maxconn must be provided per-backend, not globally
maxconn = self.options['maxconn'] maxconn = self.options['maxconn']
i = 0 i = 0
...@@ -97,7 +101,7 @@ class Recipe(GenericBaseRecipe): ...@@ -97,7 +101,7 @@ class Recipe(GenericBaseRecipe):
'name': name, 'name': name,
'ip': ip, 'ip': ip,
'port': port, 'port': port,
'server_check_path': server_check_path, 'httpchk': httpchk,
}) })
for address in backend_list: for address in backend_list:
i += 1 i += 1
......
listen %(name)s %(ip)s:%(port)s listen %(name)s %(ip)s:%(port)s
cookie SERVERID insert cookie SERVERID insert
balance roundrobin balance roundrobin
option httpchk GET %(server_check_path)s %(httpchk)s
stats uri /haproxy stats uri /haproxy
stats realm Global\ statistics 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