2 # file: roles/common/tasks/mellanox.yaml
4 - name: Mellanox Install - Check Presence of Mellanox Hardware
5 shell: "lspci | grep Mellanox | awk '{print $1}'"
6 register: mellanox_pcis
11 - name: Mellanox Install - Get OFED
13 url: 'http://content.mellanox.com/ofed/MLNX_OFED-{{ mellanox.version }}/MLNX_OFED_LINUX-{{ mellanox.version }}-{{ ansible_distribution|lower }}{{ ansible_distribution_version }}-{{ ansible_machine }}.tgz'
14 dest: '/opt/MLNX_OFED_LINUX-{{ mellanox.version }}-{{ ansible_distribution|lower }}{{ ansible_distribution_version }}-{{ ansible_machine }}.tgz'
16 when: mellanox_pcis.stdout_lines | length > 0
17 tags: install-mellanox
19 - name: Mellanox Install - Extract OFED
22 src: '/opt/MLNX_OFED_LINUX-{{ mellanox.version }}-{{ ansible_distribution|lower }}{{ ansible_distribution_version }}-{{ ansible_machine }}.tgz'
24 creates: '/opt/MLNX_OFED_LINUX-{{ mellanox.version }}-{{ ansible_distribution|lower }}{{ ansible_distribution_version }}-{{ ansible_machine }}'
25 register: mellanox_firmware_extracted
26 when: mellanox_pcis.stdout_lines | length > 0
27 tags: install-mellanox
29 - name: Mellanox Install - Install OFED
30 command: './mlnxofedinstall --with-mft --dpdk --force --upstream-libs'
32 chdir: '/opt/MLNX_OFED_LINUX-{{ mellanox.version }}-{{ ansible_distribution|lower }}{{ ansible_distribution_version }}-{{ ansible_machine }}'
33 when: mellanox_pcis.stdout_lines | length > 0 and mellanox_firmware_extracted
34 tags: install-mellanox
36 - name: Mellanox Install - Switch Infiniband to Ethernet
37 command: 'mlxconfig --yes --dev {{ item }} set LINK_TYPE_P1=2 LINK_TYPE_P2=2'
38 with_items: "{{ mellanox_pcis.stdout_lines }}"
39 tags: install-mellanox