subakva / haproxy-tools

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

More Feature Support #13

Open nowells opened 9 years ago

nowells commented 9 years ago

Thanks for creating this! I wanted to add support for updating/parsing more portions of HAProxy config files. I also added normalizing leading indentation, but let me know if you want me to rip that out or put it behind a flag.

nowells commented 9 years ago

I will be continuing to add more support as I run this on our large haproxy config, but I wanted to get this to you early for feedback and thoughts.

subakva commented 9 years ago

Thanks for the PR! Generally, the support for new config elements looks good, but I'd like to see some tests to prevent regressions.

I'm not sure about the indentation feature. I don't want to start worrying about tabs vs. spaces. :space_invader: But, it might be nice to clean things up as long as there's no danger of corrupting the config. Again, some tests demonstrating how the auto-indent feature should work would make me feel more confident about it.

@drewsonne You've been working on this actively; any thoughts or opinions on this PR?

nowells commented 9 years ago

@subakva thanks for taking a look! I will definitely go about adding tests (and probably just rip out the indentation stuff, or at least put it behind a flag and add tests). Glad to hear that the general approach sounds good, so I'll definitely go about adding test support. Cheers!

P.S. I am thinking of better flushing out the keyword support and use_backend since they do not currently work with the keyword handling uniqueness currently.

drewsonne commented 9 years ago

Uhhh... nothing substantive. :-) I can see the auto-indent would be nice, as long as it doesn't mean tabs v spaces. Yes, I agree tests are always good, in fact, practically mandatory. As @nowells has implemented users lists, which I was beating my head against for a while, that makes me a very happy camper. I'm happy to help with writing test cases.