Hi Maxime,

On Wed, May 01, 2013 at 11:27:52AM -0400, Maxime Ducharme wrote:
> Hello
> 
> I am trying to create an ACL on 1.4 version where the criterion would be a
> simple string but not sure it is possible.
> 
> something similar to this :
> acl maintenanceMode -f /etc/haproxy/maintenance.mode on
> acl maintenanceMode on -f /etc/haproxy/maintenance.mode
> 
> I'd like compare the string "on" from the content of a file without luck
> yet, someone has an idea ?

It does not do what you wrote unfortunately. Haproxy can load patterns from
a file upon startup and append them to the other patterns declared on the
same line. So basically "-f /etc/haproxy/maintenance.mode on" will match
all patterns from maintenance.mode and "on" against whetever you use the
ACL with.

At the moment there is no way to fetch constant data to compare to patterns,
though that can easily be done on 1.5. I think I can add some fetches to do
that as well as for using environment variables.

However you need to keep in mind that matching against patterns from files
only happens once when you reload the config, so I'm not certain this is
what you need.

Willy


Reply via email to