aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/testbed-setup/ansible/roles/mellanox
diff options
context:
space:
mode:
authorvagrant <pmikus@cisco.com>2020-02-04 14:16:01 +0000
committerPeter Mikus <pmikus@cisco.com>2020-02-07 20:08:43 +0000
commit8605f3f406468f57bb9b2eac12a4421f65965300 (patch)
tree5eef32ff0298ab1c3ac593adced4a502d7c8ea17 /resources/tools/testbed-setup/ansible/roles/mellanox
parentd7e14a0a93e7e06047daeaf6a5575f227aeb925a (diff)
CSIT Azure integration
+ Terraform + Ansible Signed-off-by: Peter Mikus <pmikus@cisco.com> Change-Id: I353511c5ef39d8c8d43fedc61c8dbb30b4821e1b
Diffstat (limited to 'resources/tools/testbed-setup/ansible/roles/mellanox')
-rw-r--r--resources/tools/testbed-setup/ansible/roles/mellanox/defaults/main.yaml19
-rw-r--r--resources/tools/testbed-setup/ansible/roles/mellanox/tasks/main.yaml45
2 files changed, 64 insertions, 0 deletions
diff --git a/resources/tools/testbed-setup/ansible/roles/mellanox/defaults/main.yaml b/resources/tools/testbed-setup/ansible/roles/mellanox/defaults/main.yaml
new file mode 100644
index 0000000000..2b6d3a366e
--- /dev/null
+++ b/resources/tools/testbed-setup/ansible/roles/mellanox/defaults/main.yaml
@@ -0,0 +1,19 @@
+---
+# file: roles/mellanox/defaults/main.yaml
+
+packages: "{{ packages_base + packages_by_distro[ansible_distribution | lower] + packages_by_arch[ansible_machine] }}"
+
+packages_base:
+ - []
+
+packages_by_distro:
+ ubuntu:
+ - "build-essential"
+
+packages_by_arch:
+ aarch64:
+ - []
+ x86_64:
+ - []
+
+mellanox_version: "4.6-1.0.1.1"
diff --git a/resources/tools/testbed-setup/ansible/roles/mellanox/tasks/main.yaml b/resources/tools/testbed-setup/ansible/roles/mellanox/tasks/main.yaml
new file mode 100644
index 0000000000..0971a1a192
--- /dev/null
+++ b/resources/tools/testbed-setup/ansible/roles/mellanox/tasks/main.yaml
@@ -0,0 +1,45 @@
+---
+# file: roles/mellanox/tasks/main.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
+