From 0a794d590cfc1936cb90056bce94567bfa96d1d2 Mon Sep 17 00:00:00 2001
From: Yohann D'ANELLO <ynerant@crans.org>
Date: Tue, 23 Feb 2021 16:12:48 +0100
Subject: [PATCH] [prometheus] Restart nginx before prometheus-nginx-exporter

Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
---
 roles/prometheus-nginx-exporter/handlers/main.yml | 8 ++++----
 roles/prometheus-nginx-exporter/tasks/main.yml    | 4 +++-
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/roles/prometheus-nginx-exporter/handlers/main.yml b/roles/prometheus-nginx-exporter/handlers/main.yml
index 25a545df..23b542b1 100644
--- a/roles/prometheus-nginx-exporter/handlers/main.yml
+++ b/roles/prometheus-nginx-exporter/handlers/main.yml
@@ -1,10 +1,10 @@
 ---
-- name: Restart prometheus-nginx-exporter
+- name: Restart nginx
   service:
-    name: prometheus-nginx-exporter
+    name: nginx
     state: restarted
 
-- name: Restart nginx
+- name: Restart prometheus-nginx-exporter
   service:
-    name: nginx
+    name: prometheus-nginx-exporter
     state: restarted
diff --git a/roles/prometheus-nginx-exporter/tasks/main.yml b/roles/prometheus-nginx-exporter/tasks/main.yml
index 6a398b79..8517d290 100644
--- a/roles/prometheus-nginx-exporter/tasks/main.yml
+++ b/roles/prometheus-nginx-exporter/tasks/main.yml
@@ -13,7 +13,9 @@
     regexp: '^ARGS='
     line: |
       ARGS="-web.listen-address={{ adm_ipv4 }}:9117"
-  notify: Restart prometheus-nginx-exporter
+  notify:
+    - Restart nginx
+    - Restart prometheus-nginx-exporter
 
 - name: Configure nginx
   template:
-- 
GitLab