Merge lp://staging/~jseutter/charms/precise/haproxy/errorfiles-2 into lp://staging/~dpb/charms/precise/haproxy/trunk

Proposed by Jerry Seutter
Status: Merged
Merged at revision: 72
Proposed branch: lp://staging/~jseutter/charms/precise/haproxy/errorfiles-2
Merge into: lp://staging/~dpb/charms/precise/haproxy/trunk
Diff against target: 161 lines (+62/-11)
2 files modified
hooks/hooks.py (+27/-7)
hooks/test_hooks.py (+35/-4)
To merge this branch: bzr merge lp://staging/~jseutter/charms/precise/haproxy/errorfiles-2
Reviewer Review Type Date Requested Status
Landscape Pending
Landscape Pending
Review via email: mp+178396@code.staging.launchpad.net

Description of the change

This change adds support for error files to the haproxy charm.

Background:
When Landscape is down for maintenance (or some other reason), we display an custom error page. A request goes through Apache -> HAProxy -> backend service, and if the backend service is down, HAProxy serves an error page. This is how staging is configured.

Now that Juju is used, HAProxy runs on a different unit than the backend service and no longer has direct access to the html error pages located in the Landscape source tree. This branch takes the errorfiles communicated by the landscape charm and configures HAProxy to use them.

The end result is an HAProxy config file that contains sections like this:

listen appserver 0.0.0.0:81
    mode http
    balance leastconn
    option httpchk GET / HTTP/1.0
    errorfile 403 /var/lib/haproxy/service_appserver/403.html
    errorfile 500 /var/lib/haproxy/service_appserver/500.html
    errorfile 502 /var/lib/haproxy/service_appserver/502.html
    errorfile 503 /var/lib/haproxy/service_appserver/503.html
    errorfile 504 /var/lib/haproxy/service_appserver/504.html
    server appserver 10.0.3.9:8080 check inter 2000 rise 2 fall 5 maxconn 50
    server appserver 10.0.3.9:8081 check inter 2000 rise 2 fall 5 maxconn 50

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to all changes: