Merge lp:~thedac/charm-helpers/haproxy-options into lp:charm-helpers

Proposed by David Ames
Status: Merged
Merged at revision: 730
Proposed branch: lp:~thedac/charm-helpers/haproxy-options
Merge into: lp:charm-helpers
Diff against target: 19 lines (+9/-0)
1 file modified
charmhelpers/contrib/openstack/templates/haproxy.cfg (+9/-0)
To merge this branch: bzr merge lp:~thedac/charm-helpers/haproxy-options
Reviewer Review Type Date Requested Status
Billy Olsen Approve
charmers Pending
Review via email: mp+321390@code.launchpad.net

Description of the change

Allow for backend haproxy options

To post a comment you must log in.
Revision history for this message
Billy Olsen (billy-olsen) wrote :

LGTM

review: Approve
Revision history for this message
Billy Olsen (billy-olsen) wrote :

I'm also curious if any of the services may need to set something which is not an option? For instance, the retries count may need to be specified differently for different backends but the syntax is not "option retries", it is instead "retries <count>" so the backend couldn't tune it as necessary.

Revision history for this message
David Ames (thedac) wrote :

Good point. I'll rearrange that.

729. By David Ames

Allow for non 'option' options

Revision history for this message
Billy Olsen (billy-olsen) wrote :

Okay, really LGTM this time.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'charmhelpers/contrib/openstack/templates/haproxy.cfg'
2--- charmhelpers/contrib/openstack/templates/haproxy.cfg 2017-03-28 22:18:10 +0000
3+++ charmhelpers/contrib/openstack/templates/haproxy.cfg 2017-03-30 18:38:49 +0000
4@@ -60,6 +60,15 @@
5 {% for frontend in frontends -%}
6 backend {{ service }}_{{ frontend }}
7 balance leastconn
8+ {% if backend_options -%}
9+ {% if backend_options[service] -%}
10+ {% for option in backend_options[service] -%}
11+ {% for key, value in option.items() -%}
12+ {{ key }} {{ value }}
13+ {% endfor -%}
14+ {% endfor -%}
15+ {% endif -%}
16+ {% endif -%}
17 {% for unit, address in frontends[frontend]['backends'].items() -%}
18 server {{ unit }} {{ address }}:{{ ports[1] }} check
19 {% endfor %}

Subscribers

People subscribed via source and target branches