From 492bc7442f23fe5071462840fa0ebe5227b820dd Mon Sep 17 00:00:00 2001
From: Mark Goddard <mark@stackhpc.com>
Date: Fri, 29 Jul 2022 14:39:13 +0100
Subject: [PATCH] haproxy-config: move firewalld reload handler to haproxy role

With the handler in the haproxy-config role, it gets triggered once for
every service that changes the firewall config. This happens because the
role is included dynamically. If we move the handler to the haproxy
role, which is only included once, the handler will trigger at most
once.

This is a follow up for Iea3680142711873984efff2b701347b6a56dd355.

Change-Id: Iad9ed241026435085bc9a0f5802818010b47830f
---
 ansible/roles/haproxy-config/handlers/main.yml | 6 ------
 ansible/roles/loadbalancer/handlers/main.yml   | 6 ++++++
 2 files changed, 6 insertions(+), 6 deletions(-)
 delete mode 100644 ansible/roles/haproxy-config/handlers/main.yml

diff --git a/ansible/roles/haproxy-config/handlers/main.yml b/ansible/roles/haproxy-config/handlers/main.yml
deleted file mode 100644
index 0f57dca449..0000000000
--- a/ansible/roles/haproxy-config/handlers/main.yml
+++ /dev/null
@@ -1,6 +0,0 @@
----
-- name: Reload firewalld
-  become: True
-  service:
-    name: "firewalld"
-    state: reloaded
diff --git a/ansible/roles/loadbalancer/handlers/main.yml b/ansible/roles/loadbalancer/handlers/main.yml
index f17d3f8aa0..a65dcbd8a7 100644
--- a/ansible/roles/loadbalancer/handlers/main.yml
+++ b/ansible/roles/loadbalancer/handlers/main.yml
@@ -1,4 +1,10 @@
 ---
+- name: Reload firewalld
+  become: True
+  service:
+    name: "firewalld"
+    state: reloaded
+
 # NOTE(yoctozepto): this handler dance is to ensure we delay restarting master
 # keepalived and haproxy which control VIP address until we have working backups.
 # This could be improved by checking if backup keepalived do not report FAULT state.