ansible-haproxy icon indicating copy to clipboard operation
ansible-haproxy copied to clipboard

Added support for conf.d like configuration handling.

Open nesh opened this issue 7 years ago • 5 comments

  • Instead of managing just one haproxy.cfg file with this final configuration file will be assembled from all files residing inside of haproxy_cfg_path. It will give users option to add own files into the main configuration for cases which are not covered with standard configuration options in the role, i.e. generated frontend/backend lists from external sources.
  • Moved few hardcoded paths into variables.
  • Added a fix to the .travis.yml so it can work again with latest trusty image changes.
  • Created additional Vagrantfile which can be used to test any distro / ansible version combination instead waiting for Travis to complain.

nesh avatar Jun 28 '17 12:06 nesh

Looks really interesting! However it might take some time from my side for it to be merged. I'll keep you posted.

tersmitten avatar Jun 30 '17 09:06 tersmitten

NP, for now I'll use my forked version.

I may in the meantime find a better way to inject additional configuration files than using pre_task section.

Assemble should really be a handler but I did not manage to find a good way (at simple one) to fire it from the main task when files are changed or removed other than duplicating it as task which does not look good to me (ansible newbie :)).

nesh avatar Jun 30 '17 10:06 nesh

Nice change. The assemble as a task is probably better than running it as a handler because it facilitates dropping configuration parts into conf.d outside the scope of this role while still maintaining idempotency in regenerating the compiled config. :)

logan2211 avatar Aug 15 '17 19:08 logan2211

With haproxy version 1.7 you can just pass -f /path/to/conf.d and it will load all .conf files there. for older haproxiees you have to name all files present -f conf.d/file1.conf .... I think that would be better solution to this problem as we do not need to merge files into one.

haad avatar Sep 03 '17 10:09 haad

You can see it implemented at #34

haad avatar Sep 03 '17 10:09 haad