subakva / haproxy-tools

Ruby tools for HAProxy, including config file management.
MIT License
32 stars 14 forks source link

Added HAProxy 1.5 features + TravisCI #9

Closed drewsonne closed 9 years ago

drewsonne commented 9 years ago

In HAProxy 1.5, timeout configs have changed their syntax from "a keyword, and its argument" to "a keyword, its type, and its argument".

Eg, clitimeout 60000 has become timeout cli 60000

I've modified the grammar and added tests to allow this functionality for timeouts and errorfiles only. This can be expanded for other general forms of the 3 part config by adding the specific config keys in the grammar.

I've also added integration with TravisCI. The owner of this repo would need to enable this repo in TravisCI, but the rest of the build testing should be automatic.

subakva commented 9 years ago

Looks good to me. I'll merge this and create new minor release.

drewsonne commented 9 years ago

I'm looking to use this library quite extensively, so I'm doing quite a bit of work on it. I'm having trouble with adding new configs to the defaults and they are not rendered. I'm working my way through the renderer and trying to understand how the contexts work. I noticed there's no test case for editing ConfigBlocks, is this functionality that is not intended to work, or just missing a testcase?

drewsonne commented 9 years ago

Also, thanks for the merge! :-)

subakva commented 9 years ago

My motivation to write this in the first place was to add / remove backend servers behind proxy instances during deployments. I wanted it to be able to parse and render a complete file, but I was only concerned with handling changes to servers.

A completely parseable, editable, and renderable model would be nice to have, but getting there will require some work.

drewsonne commented 9 years ago

Cool thanks! That clears up the intention, so I can get an idea on where to go from here. I'm using the library as a base layer for another project, so I probably won't need a completely parseable, editable, renderable model, but I should be able to do a decent amount of work towards that.