diff --git a/roles/upgrade/tasks/main.yml b/roles/upgrade/tasks/main.yml
index 90af15826ea6ef54ceac30e3e89e751e13756c3b..8a7ffe5eb3fd2f242075b78e79a1efeda368c0f3 100644
--- a/roles/upgrade/tasks/main.yml
+++ b/roles/upgrade/tasks/main.yml
@@ -1,4 +1,44 @@
 ---
+- name: get kernel version
+  shell: uname -r
+  register: uname_r_output
+  check_mode: no
+  changed_when: False
+  
+- name: remove conflicting packages if kernel is going to changed
+  block:
+    - name: see if we have a lustre-client service
+      shell: systemctl status lustre-client
+      register: lustreStatus
+      changed_when: False
+      failed_when: '"could not be found" in lustreStatus.stdout'
+
+    - name: stop lustre
+      service: name=lustre-client state=stopped
+      become: true
+      when: lustreStatus.failed
+
+    - name: remove conflicting packages if kernel is going to changed
+      package:
+        state: absent
+        name: 
+          - kmod-lustre-client
+          - kernel-devel
+      become: true
+    - name: remove mellanox rpms
+      yum:
+        state: absent
+        name:
+          - mlnx-ofa_kernel
+          - mlnx-ofa_kernel-devel
+          - mlnx-ofa_kernel-modules
+          - libibverbs
+          - libgpod
+          - usbmuxd
+          - libmlx5
+          - libmlx4
+      become: true
+  when: uname_r_output.stdout != KERNEL_VERSION
 
 - name: install aptitude
   apt: name=aptitude state=present
@@ -52,6 +92,9 @@
     name:
       - kernel-devel-{{ KERNEL_VERSION }}
       - kernel-{{ KERNEL_VERSION }}
+      - kernel-headers-{{ KERNEL_VERSION }}
+      - kernel-tools-{{ KERNEL_VERSION }}
+      - kernel-tools-libs-{{ KERNEL_VERSION }}
     state: present
   become: true
   when: ansible_os_family=="RedHat"