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