aboutsummaryrefslogtreecommitdiffstats
path: root/fdio.infra.ansible/roles/mellanox/tasks/main.yaml
blob: 53376eb997f0158a97c462fd61a563987fab24d9 (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
38
39
40
41
42
43
---
# file: tasks/main.yaml

- name: Inst - Update Package Cache (APT)
  apt:
    update_cache: true
    cache_valid_time: 3600
  when:
    - ansible_distribution|lower == 'ubuntu'
  tags:
    - mellanox-inst-drivers

- name: Inst - Prerequisites
  package:
    name: "{{ packages | flatten(levels=1) }}"
    state: "latest"
  tags:
    - mellanox-inst-drivers

- name: Inst - Check Presence of Mellanox
  shell: "lspci | grep Mellanox | awk '{print $1}'"
  register: mellanox_pcis
  failed_when: false
  changed_when: false
  tags:
    - mellanox-inst-drivers

- name: Inst - Get Mellanox OFED driver versions
  set_fact:
    ofed: "{{ mellanox_compatibility_matrix[mellanox_matrix]['ofed'] }}"
  when: >
    mellanox_pcis.stdout_lines | length > 0 and
    mellanox_matrix is defined
  tags:
    - mellanox-inst-drivers

- name: Inst - Driver Mellanox
  import_tasks: ofed.yaml
  when: >
    mellanox_pcis.stdout_lines | length > 0 and
    mellanox_matrix is defined
  tags:
    - mellanox-inst-drivers