Skip to content
Snippets Groups Projects
Commit f6bed743 authored by Andreas Hamacher's avatar Andreas Hamacher
Browse files

adding check_mode for script

Former-commit-id: fc4e1d2a
parent c287dc96
No related branches found
No related tags found
No related merge requests found
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
- name: "Force this role to fail if no Mellanox hardware is present" - name: "Force this role to fail if no Mellanox hardware is present"
#Exclude the role via tags ans ansible-playbook --skip-tags mlx #Exclude the role via tags ans ansible-playbook --skip-tags mlx
shell: "lspci | grep Mellanox" shell: "lspci | grep Mellanox"
check_mode: yes
- include_vars: mellanoxVars.yml - include_vars: mellanoxVars.yml
...@@ -12,7 +13,7 @@ ...@@ -12,7 +13,7 @@
become_user: root become_user: root
ignore_errors: true ignore_errors: true
when: ansible_os_family == "RedHat" when: ansible_os_family == "RedHat"
- name: test for existing installation of drivers - name: test for existing installation of drivers
shell: '/bin/ibv_devinfo' shell: '/bin/ibv_devinfo'
become: true become: true
...@@ -26,8 +27,8 @@ ...@@ -26,8 +27,8 @@
debug: var=drivers_installed debug: var=drivers_installed
- name: default dont install - name: default dont install
set_fact: set_fact:
install_now: false install_now: false
reboot_now: false reboot_now: false
- name: get driver version - name: get driver version
...@@ -56,8 +57,8 @@ ...@@ -56,8 +57,8 @@
debug: var=desired_driver_version debug: var=desired_driver_version
- name: set install due to version mismatch - name: set install due to version mismatch
set_fact: set_fact:
install_now: true install_now: true
reboot_now: true reboot_now: true
when: driver_version.failed or not desired_driver_version.stdout in driver_version.stdout when: driver_version.failed or not desired_driver_version.stdout in driver_version.stdout
...@@ -71,7 +72,7 @@ ...@@ -71,7 +72,7 @@
when: install_now when: install_now
#remove old mellanox drivers as they may interfere with an update #remove old mellanox drivers as they may interfere with an update
- name: stop lustre - name: stop lustre
service: name=lustre-client state=stopped service: name=lustre-client state=stopped
become: true become: true
become_user: root become_user: root
...@@ -108,8 +109,8 @@ ...@@ -108,8 +109,8 @@
become_user: root become_user: root
ignore_errors: true ignore_errors: true
with_items: with_items:
- mlnx-ofa_kernel - mlnx-ofa_kernel
- mlnx-ofa_kernel-devel - mlnx-ofa_kernel-devel
- mlnx-ofa_kernel-modules - mlnx-ofa_kernel-modules
when: install_now when: install_now
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment