ansible-haproxy
ansible-haproxy copied to clipboard
Added support for conf.d like configuration handling.
- Instead of managing just one
haproxy.cfg
file with this final configuration file will be assembled from all files residing inside ofhaproxy_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.
Looks really interesting! However it might take some time from my side for it to be merged. I'll keep you posted.
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 :)).
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. :)
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.
You can see it implemented at #34