diff --git a/roles/alertmanager/templates/alertmanager.service.j2 b/roles/alertmanager/templates/alertmanager.service.j2 index 9499c3551..32710bce9 100644 --- a/roles/alertmanager/templates/alertmanager.service.j2 +++ b/roles/alertmanager/templates/alertmanager.service.j2 @@ -17,7 +17,11 @@ StartLimitIntervalSec=0 [Service] Type=simple +{% if (ansible_facts.packages.systemd | first).version is version('239', '>=') %} +PIDFile=/run/alertmanager.pid +{% else %} PIDFile=/var/run/alertmanager.pid +{% endif %} User=alertmanager Group=alertmanager ExecReload=/bin/kill -HUP $MAINPID