Amir Zeidner | 34380a5 | 2017-04-26 10:48:44 +0300 | [diff] [blame] | 1 | --- |
| 2 | - name: Mellanox Constants |
| 3 | set_fact: |
| 4 | MLNX_PACK_VER: "mlnx-en-4.0-2.0.0.1-ubuntu14.04-x86_64" |
| 5 | MLNX_URL_PATH: "MLNX_EN-4.0-2.0.0.1" |
| 6 | MD5_MLNX: "b1581e2445c7832ec096b367e78303aa" |
| 7 | |
| 8 | - name: Install Prerequesites |
| 9 | become: yes |
| 10 | apt: name={{ item }} state=installed |
| 11 | with_items: |
| 12 | - debhelper |
| 13 | - autotools-dev |
| 14 | - dkms |
| 15 | - zlib1g-dev |
| 16 | - make |
| 17 | - python-libxml2 |
| 18 | - m4 |
| 19 | - automake |
| 20 | - autoconf |
| 21 | - libltdl-dev |
| 22 | - chrpath |
| 23 | - swig |
| 24 | - quilt |
| 25 | - graphviz |
| 26 | - dpatch |
| 27 | - gcc |
| 28 | |
| 29 | - name: Check Mellanox install package |
| 30 | become: yes |
| 31 | stat: |
| 32 | path: "{{ playbook_dir }}/roles/compute-node/files/{{MLNX_PACK_VER}}.tgz" |
| 33 | register: mlnx_package_exists |
| 34 | |
| 35 | - name: Download mlnx driver package |
| 36 | become: yes |
| 37 | local_action: > |
| 38 | get_url url="http://www.mellanox.com/downloads/ofed/{{MLNX_URL_PATH}}/{{MLNX_PACK_VER}}.tgz" |
| 39 | dest="{{ playbook_dir }}/roles/compute-node/files" |
| 40 | checksum="md5:{{MD5_MLNX}}" |
| 41 | when: mlnx_package_exists.stat.exists == False |
| 42 | |
| 43 | - name: Unarchive mlnx driver package |
| 44 | unarchive: |
| 45 | copy=yes |
| 46 | src="{{ playbook_dir }}/roles/compute-node/files/{{MLNX_PACK_VER}}.tgz" |
| 47 | dest=/tmp |
| 48 | |
| 49 | - name: Install mlnx driver |
| 50 | become: yes |
| 51 | command: /tmp/{{MLNX_PACK_VER}}/install --force |
| 52 | changed_when: true |
| 53 | |
| 54 | - name: Load mlnx Driver |
David K. Bainbridge | a826906 | 2017-05-18 11:43:56 -0700 | [diff] [blame] | 55 | become: yes |
Amir Zeidner | 34380a5 | 2017-04-26 10:48:44 +0300 | [diff] [blame] | 56 | command: /etc/init.d/mlnx-en.d restart |
| 57 | changed_when: true |
| 58 | |
| 59 | - name: Remove Build Directory |
| 60 | become: yes |
| 61 | file: |
| 62 | path=/tmp/{{MLNX_PACK_VER}} |
| 63 | state=absent |
| 64 | |
| 65 | - name: Remove Build files |
| 66 | become: yes |
| 67 | file: |
| 68 | path=/tmp/{{MLNX_PACK_VER}}.tgz |
| 69 | state=absent |
| 70 | |
| 71 | - name: Remove Mellanox Service files |
| 72 | become: yes |
| 73 | file: |
| 74 | path=/etc/init/mlnx-en.conf |
| 75 | state=absent |
| 76 | |
| 77 | - name: Remove Mellanox Init Script |
| 78 | become: yes |
| 79 | file: |
| 80 | path=/etc/init.d/mlnx-en.d |
| 81 | state=absent |