From 172598e0a60aa78d9756dbfdc2d65e64210f7d91 Mon Sep 17 00:00:00 2001
From: handreas <andreas.hamacher@monash.edu>
Date: Thu, 23 Sep 2021 14:51:54 +1000
Subject: [PATCH] ibstat fails when run on a re-install before reboot

---
 roles/mellanox_drivers/tasks/main.yml | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/roles/mellanox_drivers/tasks/main.yml b/roles/mellanox_drivers/tasks/main.yml
index 08380a35..b41e2278 100644
--- a/roles/mellanox_drivers/tasks/main.yml
+++ b/roles/mellanox_drivers/tasks/main.yml
@@ -241,6 +241,14 @@
   become_user: root
   when: install_now and buildKMOD==True and ansible_os_family == "Debian"
 
+#
+# A REBOOT IS NEEDED AFTER SUCCESSFUL INSTALL
+#
+- name: restart machine
+  reboot:
+  become: true
+  when: reboot_now
+
 - name: stat if etc systemd system roce_mode.service exists
   stat:
     path: /etc/systemd/system/roce_mode.service
@@ -275,13 +283,6 @@
 - name: enable roce_mode setting
   service: name=roce_mode enabled=yes
   become: true
-#
-# A REBOOT IS NEEDED AFTER SUCCESSFUL INSTALL
-#
-- name: restart machine
-  reboot:
-  become: true
-  when: reboot_now
 
 - name: enable roce_mode setting
   service: name=roce_mode state=started enabled=yes
-- 
GitLab