2 # file: roles/mellanox/tasks/main.yaml
4 - name: Inst - Update Package Cache (APT)
9 - ansible_distribution|lower == 'ubuntu'
11 - mellanox-inst-prerequisites
13 - name: Inst - Prerequisites
15 name: "{{ packages | flatten(levels=1) }}"
18 - mellanox-inst-prerequisites
20 - name: Inst - Check Presence of Mellanox Hardware
21 shell: "lspci | grep Mellanox | awk '{print $1}'"
22 register: mellanox_pcis
28 - name: Inst - Get OFED
30 url: "http://content.mellanox.com/ofed/MLNX_OFED-{{ mellanox_version }}/MLNX_OFED_LINUX-{{ mellanox_version }}-{{ ansible_distribution|lower }}{{ ansible_distribution_version }}-{{ ansible_machine }}.tgz"
31 dest: "/opt/MLNX_OFED_LINUX-{{ mellanox_version }}-{{ ansible_distribution|lower }}{{ ansible_distribution_version }}-{{ ansible_machine }}.tgz"
33 when: mellanox_pcis.stdout_lines | length > 0
37 - name: Inst - Extract OFED
40 src: "/opt/MLNX_OFED_LINUX-{{ mellanox_version }}-{{ ansible_distribution|lower }}{{ ansible_distribution_version }}-{{ ansible_machine }}.tgz"
42 creates: "/opt/MLNX_OFED_LINUX-{{ mellanox_version }}-{{ ansible_distribution|lower }}{{ ansible_distribution_version }}-{{ ansible_machine }}"
43 register: mellanox_firmware_extracted
44 when: mellanox_pcis.stdout_lines | length > 0
49 command: "./mlnxofedinstall --with-mft --dpdk --force --upstream-libs"
51 chdir: "/opt/MLNX_OFED_LINUX-{{ mellanox_version }}-{{ ansible_distribution|lower }}{{ ansible_distribution_version }}-{{ ansible_machine }}"
52 when: mellanox_pcis.stdout_lines | length > 0 and mellanox_firmware_extracted
56 - name: Switch Infiniband to Ethernet
57 command: "mlxconfig --yes --dev {{ item }} set LINK_TYPE_P1=2 LINK_TYPE_P2=2"
58 with_items: "{{ mellanox_pcis.stdout_lines }}"
62 - name: FIX qemu-system removal