diff --git a/roles/mellanox_drivers/tasks/main.yml b/roles/mellanox_drivers/tasks/main.yml
index 04322c7a9c7b208eff9ea90a66460c34293b0585..04471528cd8aa9d4b38b1632a06c3123bae84839 100644
--- a/roles/mellanox_drivers/tasks/main.yml
+++ b/roles/mellanox_drivers/tasks/main.yml
@@ -231,7 +231,7 @@
     chdir: "/tmp/{{ MELLANOX_DRIVER_SRC }}"
   become: true
   become_user: root
-  when: install_now and buildKMOD!=True and ansible_os_family == "Redhat"
+  when: install_now and buildKMOD!=True and ansible_os_family == "RedHat"
 
 - name: build and install drivers Redhat
   shell: ./mlnxofedinstall -q --skip-repo --without-fw-update --add-kernel-support --hpc --kmp --all
@@ -239,7 +239,7 @@
     chdir: "/tmp/{{ MELLANOX_DRIVER_SRC }}"
   become: true
   become_user: root
-  when: install_now and buildKMOD==True and ansible_os_family == "Redhat"
+  when: install_now and buildKMOD==True and ansible_os_family == "RedHat"
 
 - name: build and install drivers Debian
   shell: ./mlnxofedinstall -q --skip-repo --without-fw-update --hpc --dkms