From 9d98fcfa7af2af8e3f75a173d191deb2e20ecc0d Mon Sep 17 00:00:00 2001 From: pancho horrillo Date: Fri, 15 Mar 2019 07:27:51 +0100 Subject: [PATCH] AWS deploy: prometheus restarts upon config updates --- deploy/aws/provision/main.yml | 6 ++++++ deploy/aws/provision/tasks/prometheus/main.yml | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/deploy/aws/provision/main.yml b/deploy/aws/provision/main.yml index 69311337e..3ec524165 100644 --- a/deploy/aws/provision/main.yml +++ b/deploy/aws/provision/main.yml @@ -91,6 +91,12 @@ - vars.yml tasks: - include: tasks/prometheus/main.yml + handlers: + - name: Restart Prometheus + systemd: + name: prometheus + daemon_reload: yes + state: restarted tags: - prometheus diff --git a/deploy/aws/provision/tasks/prometheus/main.yml b/deploy/aws/provision/tasks/prometheus/main.yml index 66ee112ce..732b8c9df 100644 --- a/deploy/aws/provision/tasks/prometheus/main.yml +++ b/deploy/aws/provision/tasks/prometheus/main.yml @@ -59,6 +59,8 @@ dest: /etc/prometheus/prometheus.yml src: ../../templates/prometheus-config.yml.j2 force: yes + notify: + - Restart Prometheus - name: Install Prometheus systemd service unit file template: @@ -66,6 +68,8 @@ src: ../../templates/{{ item }}.j2 with_items: - prometheus.service + notify: + - Restart Prometheus - name: Enable and run Prometheus service systemd: