aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/testbed-setup/ansible/roles/common
diff options
context:
space:
mode:
authorPeter Mikus <pmikus@cisco.com>2019-10-14 13:13:46 +0000
committerPeter Mikus <pmikus@cisco.com>2019-10-14 13:17:06 +0000
commitf4604e91598ef6f914b7ce1ab57f7d44dc043460 (patch)
treea84a7fed9be17916408c4c4f34c6b284d28b6d1c /resources/tools/testbed-setup/ansible/roles/common
parent1f2f456231931c0704c932499c285242005b32bf (diff)
Ansible: Mellanox install
+ OFED + ibdev2netdev - aligning few naming conventions Signed-off-by: Peter Mikus <pmikus@cisco.com> Change-Id: I0dff28b2cd4bbc4753597366d9b03b497fa336c4
Diffstat (limited to 'resources/tools/testbed-setup/ansible/roles/common')
-rw-r--r--resources/tools/testbed-setup/ansible/roles/common/tasks/main.yaml4
-rw-r--r--resources/tools/testbed-setup/ansible/roles/common/tasks/mellanox.yaml39
2 files changed, 43 insertions, 0 deletions
diff --git a/resources/tools/testbed-setup/ansible/roles/common/tasks/main.yaml b/resources/tools/testbed-setup/ansible/roles/common/tasks/main.yaml
index 915fc0bbd0..6bb4d4614e 100644
--- a/resources/tools/testbed-setup/ansible/roles/common/tasks/main.yaml
+++ b/resources/tools/testbed-setup/ansible/roles/common/tasks/main.yaml
@@ -97,4 +97,8 @@
- 'Reboot server'
tags: copy-grub
+- name: Mellanox Install - Driver
+ import_tasks: mellanox.yaml
+ tags: mellanox-install
+
- meta: flush_handlers
diff --git a/resources/tools/testbed-setup/ansible/roles/common/tasks/mellanox.yaml b/resources/tools/testbed-setup/ansible/roles/common/tasks/mellanox.yaml
new file mode 100644
index 0000000000..b8d14ad67c
--- /dev/null
+++ b/resources/tools/testbed-setup/ansible/roles/common/tasks/mellanox.yaml
@@ -0,0 +1,39 @@
+---
+# file: roles/common/tasks/mellanox.yaml
+
+- name: Mellanox Install - Check Presence of Mellanox Hardware
+ shell: "lspci | grep Mellanox | awk '{print $1}'"
+ register: mellanox_pcis
+ failed_when: no
+ changed_when: no
+ tags: install-mellanox
+
+- name: Mellanox Install - Get OFED
+ get_url:
+ url: 'http://content.mellanox.com/ofed/MLNX_OFED-{{ mellanox.version }}/MLNX_OFED_LINUX-{{ mellanox.version }}-{{ ansible_distribution|lower }}{{ ansible_distribution_version }}-{{ ansible_machine }}.tgz'
+ dest: '/opt/MLNX_OFED_LINUX-{{ mellanox.version }}-{{ ansible_distribution|lower }}{{ ansible_distribution_version }}-{{ ansible_machine }}.tgz'
+ mode: 0644
+ when: mellanox_pcis.stdout_lines | length > 0
+ tags: install-mellanox
+
+- name: Mellanox Install - Extract OFED
+ unarchive:
+ remote_src: true
+ src: '/opt/MLNX_OFED_LINUX-{{ mellanox.version }}-{{ ansible_distribution|lower }}{{ ansible_distribution_version }}-{{ ansible_machine }}.tgz'
+ dest: '/opt/'
+ creates: '/opt/MLNX_OFED_LINUX-{{ mellanox.version }}-{{ ansible_distribution|lower }}{{ ansible_distribution_version }}-{{ ansible_machine }}'
+ register: mellanox_firmware_extracted
+ when: mellanox_pcis.stdout_lines | length > 0
+ tags: install-mellanox
+
+- name: Mellanox Install - Install OFED
+ command: './mlnxofedinstall --with-mft --dpdk --force --upstream-libs'
+ args:
+ chdir: '/opt/MLNX_OFED_LINUX-{{ mellanox.version }}-{{ ansible_distribution|lower }}{{ ansible_distribution_version }}-{{ ansible_machine }}'
+ when: mellanox_pcis.stdout_lines | length > 0 and mellanox_firmware_extracted
+ tags: install-mellanox
+
+- name: Mellanox Install - Switch Infiniband to Ethernet
+ command: 'mlxconfig --yes --dev {{ item }} set LINK_TYPE_P1=2 LINK_TYPE_P2=2'
+ with_items: "{{ mellanox_pcis.stdout_lines }}"
+ tags: install-mellanox