From 86fe3db78fa6f4d4a73585bae978200f6f6919d6 Mon Sep 17 00:00:00 2001 From: Bruno Travouillon Date: Fri, 16 Feb 2024 08:09:14 -0500 Subject: [PATCH] Restart slurm services after a Slurm upgrade Make sure to execute the correct Slurm after the upgrade. Otherwise, this may cause issues when reloading the service during logrotate since some files changed on the system. --- handlers/main.yml | 6 ++++++ tasks/slurmctld.yml | 2 ++ tasks/slurmd.yml | 2 ++ tasks/slurmdbd.yml | 2 ++ 4 files changed, 12 insertions(+) diff --git a/handlers/main.yml b/handlers/main.yml index 805a33c..7caf470 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -10,6 +10,12 @@ state: reloaded when: "slurm_start_services and ('slurmdbdservers' in group_names or 'dbd' in slurm_roles)" +- name: Restart slurmdbd + ansible.builtin.service: + name: "{{ slurmdbd_service_name }}" + state: restarted + when: "slurm_start_services and ('slurmdbdservers' in group_names or 'dbd' in slurm_roles)" + - name: Reload slurmctld ansible.builtin.service: name: "{{ slurmctld_service_name }}" diff --git a/tasks/slurmctld.yml b/tasks/slurmctld.yml index b15152c..2301445 100644 --- a/tasks/slurmctld.yml +++ b/tasks/slurmctld.yml @@ -4,6 +4,8 @@ ansible.builtin.package: name: "{{ __slurm_packages.slurmctld }}" state: "{{ 'latest' if slurm_upgrade else 'present' }}" + notify: + - Restart slurmctld - name: Create slurm state directory ansible.builtin.file: diff --git a/tasks/slurmd.yml b/tasks/slurmd.yml index 1ed0899..a8cbf23 100644 --- a/tasks/slurmd.yml +++ b/tasks/slurmd.yml @@ -4,6 +4,8 @@ ansible.builtin.package: name: "{{ __slurm_packages.slurmd }}" state: "{{ 'latest' if slurm_upgrade else 'present' }}" + notify: + - Restart slurmd - name: Create slurm spool directory ansible.builtin.file: diff --git a/tasks/slurmdbd.yml b/tasks/slurmdbd.yml index 138349a..932df4c 100644 --- a/tasks/slurmdbd.yml +++ b/tasks/slurmdbd.yml @@ -4,6 +4,8 @@ ansible.builtin.package: name: "{{ __slurm_packages.slurmdbd }}" state: "{{ 'latest' if slurm_upgrade else 'present' }}" + notify: + - Restart slurmdbd - name: Create slurm log directory ansible.builtin.file: