From 5a5957c5846c93a24b10bd4c31f136d3d47d70fd Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Tue, 29 Dec 2020 22:30:29 +0100 Subject: [PATCH] Run the docker tasks for haproxy once. --- tasks/haproxy_conf.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tasks/haproxy_conf.yml b/tasks/haproxy_conf.yml index 5cd0667..d712e66 100644 --- a/tasks/haproxy_conf.yml +++ b/tasks/haproxy_conf.yml @@ -8,5 +8,8 @@ template: src=haproxy.cfg.j2 dest=/etc/haproxy/haproxy.cfg owner=root group=root mode='0444' notify: Reload the HAPROXY configuration - when: docker_swarm_manager + run_once: True + when: + - docker_swarm_manager + - docker_swarm_manager_main_node is defined and docker_swarm_manager_main_node | bool tags: [ 'haproxy', 'docker_haproxy', 'docker_swarm', 'docker', 'haproxy_conf' ]