diff --git a/library/roles/prometheus-haproxy-exporter/templates/haproxy_exporter.systemd.j2 b/library/roles/prometheus-haproxy-exporter/templates/haproxy_exporter.systemd.j2 index d0fa079e..0de4dbbd 100644 --- a/library/roles/prometheus-haproxy-exporter/templates/haproxy_exporter.systemd.j2 +++ b/library/roles/prometheus-haproxy-exporter/templates/haproxy_exporter.systemd.j2 @@ -4,9 +4,14 @@ After=network.target [Service] Type=simple +Restart=on-failure User={{ prometheus_h_e_user }} Group={{ prometheus_h_e_user }} ExecStart={{ prometheus_h_e_cmd }} {{ prometheus_h_e_opts }} {{ prometheus_h_e_additional_opts }} +[Install] +WantedBy=multi-user.target +Alias=node_exporter.service + diff --git a/library/roles/prometheus-node-exporter/templates/node_exporter.systemd.j2 b/library/roles/prometheus-node-exporter/templates/node_exporter.systemd.j2 index 19593723..e7e5f125 100644 --- a/library/roles/prometheus-node-exporter/templates/node_exporter.systemd.j2 +++ b/library/roles/prometheus-node-exporter/templates/node_exporter.systemd.j2 @@ -4,9 +4,14 @@ After=network.target [Service] Type=simple +Restart=on-failure User={{ prometheus_n_e_user }} Group={{ prometheus_n_e_user }} ExecStart={{ prometheus_n_e_cmd }} {{ prometheus_n_e_opts }} {{ prometheus_n_e_additional_opts }} --collector.systemd +[Install] +WantedBy=multi-user.target +Alias=node_exporter.service +