diff --git a/roles/slurm-common/templates/slurmlog.j2 b/roles/slurm-common/templates/slurmlog.j2
index 03ae9764f459d44f32d616f935c0c645f962537d..54731e01308d7ee15d470736242630112354e8e9 100644
--- a/roles/slurm-common/templates/slurmlog.j2
+++ b/roles/slurm-common/templates/slurmlog.j2
@@ -20,7 +20,11 @@
 {% endif %}
 {% endif %}
 {% if ansible_os_family == 'RedHat' and ansible_distribution_version >= '7' %}
+{% if slurmctrl == inventory_hostname %}
   systemctl restart slurmctld 
+{% else %}
+  systemctl restart slurmd 
+{% endif %}
 {% else %}
  postrotate /etc/init.d/slurm reconfig 
 {% endif %}