Restart haproxy after config update

This commit is contained in:
Evgeniy L 2015-04-22 17:30:01 +03:00
parent 324779932b
commit 0f0dd44989
2 changed files with 7 additions and 1 deletions

View File

@ -9,9 +9,15 @@
- file: state=directory path=/etc/solar/{{name}}
# TODO Remove hardcoded path
- template: src=/vagrant/examples/resources/templates/haproxy.cfg.j2 dest=/etc/solar/{{name}}/haproxy.cfg backup=yes
notify:
- haproxy_reload_config
- shell: docker run -d \
--net="host" \
--privileged \
-v /etc/solar/{{name}}/haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro \
--name {{name}} {{image}}
when: is_running|failed
handlers:
- name: haproxy_reload_config
shell: docker restart {{name}}

View File

@ -1,6 +1,6 @@
global
maxconn 4096
pidfile /var/run/haproxy.pidfile
pidfile /var/run/haproxy.pid
defaults
mode tcp
timeout connect 5s