aboutsummaryrefslogtreecommitdiffstats
path: root/fdio.infra.ansible/roles/mellanox/tasks/ofed.yaml
blob: c39975bab666b91a7ea6655ee65d0f4a0825e010 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
---
# file: tasks/ofed.yaml

- name: Inst - Get OFED
  ansible.builtin.get_url:
    url: "{{ mellanox_download_url }}/MLNX_OFED-{{ ofed }}/MLNX_OFED_LINUX-{{ ofed }}-{{ ansible_distribution|lower }}{{ ansible_distribution_version }}-{{ ansible_machine }}.tgz"
    dest: "{{ mellanox_extract_dir }}/MLNX_OFED_LINUX-{{ ofed }}-{{ ansible_distribution|lower }}{{ ansible_distribution_version }}-{{ ansible_machine }}.tgz"
    mode: "0644"
  when: mellanox_pcis.stdout_lines | length > 0
  tags:
    - mellanox-inst-drivers

- name: Inst - Extract OFED
  ansible.builtin.unarchive:
    remote_src: true
    src: "{{ mellanox_extract_dir }}/MLNX_OFED_LINUX-{{ ofed }}-{{ ansible_distribution|lower }}{{ ansible_distribution_version }}-{{ ansible_machine }}.tgz"
    dest: "{{ mellanox_extract_dir }}/"
    creates: "{{ mellanox_extract_dir }}/MLNX_OFED_LINUX-{{ ofed }}-{{ ansible_distribution|lower }}{{ ansible_distribution_version }}-{{ ansible_machine }}"
  register: mellanox_firmware_extracted
  tags:
    - mellanox-inst-drivers

- name: Inst - OFED
  ansible.builtin.command: "./mlnxofedinstall --with-mft --dpdk --force --upstream-libs" # --without-fw-update"
  args:
    chdir: "{{ mellanox_extract_dir }}/MLNX_OFED_LINUX-{{ ofed }}-{{ ansible_distribution|lower }}{{ ansible_distribution_version }}-{{ ansible_machine }}"
  when: mellanox_firmware_extracted
  tags:
    - mellanox-inst-drivers

- name: Inst - Switch Infiniband to Ethernet
  ansible.builtin.command: "mlxconfig --yes --dev {{ item }} set LINK_TYPE_P1=2 LINK_TYPE_P2=2"
  with_items: "{{ mellanox_pcis.stdout_lines }}"
  failed_when: false
  changed_when: false
  tags:
    - mellanox-inst-drivers