X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Ftools%2Ftestbed-setup%2Fansible%2Froles%2Fmellanox%2Ftasks%2Fmain.yaml;fp=resources%2Ftools%2Ftestbed-setup%2Fansible%2Froles%2Fmellanox%2Ftasks%2Fmain.yaml;h=030cf59b665ec6924b5aacd14bc6f8c42a954612;hp=0000000000000000000000000000000000000000;hb=048a9ca3484a06e54f48dc80e7ab24dbfebe406f;hpb=d7aec8ee052468f55e2e9bd27de1dedd918c8a37 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..030cf59b66 --- /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 +