diff --git a/examples/resources/simple/haproxy/run.yml b/examples/resources/simple/haproxy/run.yml index fa09fc6..6d01b7d 100644 --- a/examples/resources/simple/haproxy/run.yml +++ b/examples/resources/simple/haproxy/run.yml @@ -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}} diff --git a/examples/resources/templates/haproxy.cfg.j2 b/examples/resources/templates/haproxy.cfg.j2 index 8bdb826..5f14c9a 100644 --- a/examples/resources/templates/haproxy.cfg.j2 +++ b/examples/resources/templates/haproxy.cfg.j2 @@ -1,6 +1,6 @@ global maxconn 4096 - pidfile /var/run/haproxy.pidfile + pidfile /var/run/haproxy.pid defaults mode tcp timeout connect 5s