devops-coop / ansible-haproxy

Installs and configure HAProxy
Apache License 2.0
96 stars 97 forks source link

Flexible way to add parameters into template files #45

Closed ozbillwang closed 8 years ago

ozbillwang commented 8 years ago

when preparing variable files, such as global, defaults, frontend, backend, listen, etc. I stuck with some parameters or options which are not defined in these template files.

There are so many parameters in haproxy, and we are not possible to include them all.

So will it be fine to add an extra part to include all parameters directly if they are not defined. Such as:

{% if item.extra is defined %}
{% for parameter in item.extra %}
    {{ parameter }}
{% endfor %}
{% endif -%}

We need add it in all template files.

Then you will easily add more.

haproxy_global:
    extra: 
       - tune.ssl.default-dh-param 2048
       - more parameter and options.

@PierrePaul

Your options? If you are happy with this idea, I will prepare the pull request.

PierrePaul commented 8 years ago

I don't like this, but you are right. Haproxy is growing too fast for contributors of this ansible module to keep up with all the new attributes for every release.

If we look at it the other way, what would prevent people to just push everything in the extra variable instead of using already present attributes?

Also, I would prefer if we could separate the instruction (tune.ssl.default-dh-param) and the value (2048), but I'm not sure if this covers all cases.

ozbillwang commented 8 years ago

But without pull request to merge your repo now, I can't make the setting and have to fork yours and build mine. Which I don't want to do that.

And there is no possible to include all attributes to satisfy all requests, it is no end job to include all of them.

I hope to use all time focus on single galaxy module, not branch too much (if you look into these ansible galaxy modules, and compare with puppet forge modules, you will see a big gap between them ). Your haproxy module is most close to my request and is the best after I test more than 5 similar haproxy galaxy modules.

I can't wait too much time, because my project deadline is closed. Seems fork and implement in my way is the way I have to deal, and wait for future updates from you.

ozbillwang commented 8 years ago

I already did the fork and update with my way, this ticket can be closed.