From 4ca3a20d181397823712e16989ebf84c77b14fdf Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Sat, 19 Oct 2019 13:27:27 +0000 Subject: [PATCH] Depend on wg0 for node exporter --- .../files/prometheus-node-exporter.service-override.conf | 2 ++ roles/monitoring/tasks/node_exporter.yml | 5 +++++ 2 files changed, 7 insertions(+) create mode 100644 roles/monitoring/files/prometheus-node-exporter.service-override.conf diff --git a/roles/monitoring/files/prometheus-node-exporter.service-override.conf b/roles/monitoring/files/prometheus-node-exporter.service-override.conf new file mode 100644 index 0000000..6d8e9ce --- /dev/null +++ b/roles/monitoring/files/prometheus-node-exporter.service-override.conf @@ -0,0 +1,2 @@ +[Unit] +After=wg-quick@wg0.service diff --git a/roles/monitoring/tasks/node_exporter.yml b/roles/monitoring/tasks/node_exporter.yml index c3f8ede..fa974b7 100644 --- a/roles/monitoring/tasks/node_exporter.yml +++ b/roles/monitoring/tasks/node_exporter.yml @@ -10,3 +10,8 @@ regexp: '^ARGS=' line: ARGS="--web.listen-address=10.80.0.2:9100" notify: restart-node-exporter + +- name: depend on wg0 for node exporter + copy: + dest: /etc/systemd/system/prometheus-node-exporter.service.d/override.conf + src: prometheus-node-exporter.service-override.conf