Discussion:
haproxy config order
John Roesler
2018-12-02 19:18:51 UTC
Permalink
Hello,

I am from sous-chefs, the Chef Community team that maintains a chef
cookbook for haproxy. We have found that haproxy warns or alerts on various
configuration ordering and would like to update our cookbook to handle this
ordering.

A specific example would be the warning: "a 'http-request' rule placed
after a 'use_backend' rule will still be processed before." which is found
in a frontend or listen section.

My question: Is this order documented somewhere that I could leverage to
update our cookbook to handle appropriately so that users don't have their
configuration validity checks muddied.

For more background, I documented an issue in our repo here ->
https://github.com/sous-chefs/haproxy/issues/319

Thank you! Looking forward to a response :)
John
Willy Tarreau
2018-12-03 03:36:15 UTC
Permalink
Hello John,
Post by John Roesler
Hello,
I am from sous-chefs, the Chef Community team that maintains a chef
cookbook for haproxy. We have found that haproxy warns or alerts on various
configuration ordering and would like to update our cookbook to handle this
ordering.
A specific example would be the warning: "a 'http-request' rule placed
after a 'use_backend' rule will still be processed before." which is found
in a frontend or listen section.
My question: Is this order documented somewhere that I could leverage to
update our cookbook to handle appropriately so that users don't have their
configuration validity checks muddied.
The main place where this is documented is ... the config parser itself :

http://git.haproxy.org/?p=haproxy.git;a=blob;f=src/cfgparse-listen.c;hb=HEAD

Look there for the "warnif_rule_after..." and "warnif_misplaced_...".
These functions detect suspicious ordering of various rule types. There
are not that many in the end, so I think it is feasible to implement
the logic in your product. We'd definitely need to add a section in the
doc to explain this. Each keyword's documentation implicitly describes
when the rule is evaluated, but it's not clear enough now that there are
several such rule types.

Cheers,
Willy

Loading...