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 |
| 55 | command: /etc/init.d/mlnx-en.d restart |
| 56 | changed_when: true |
| 57 | |
| 58 | - name: Remove Build Directory |
| 59 | become: yes |
| 60 | file: |
| 61 | path=/tmp/{{MLNX_PACK_VER}} |
| 62 | state=absent |
| 63 | |
| 64 | - name: Remove Build files |
| 65 | become: yes |
| 66 | file: |
| 67 | path=/tmp/{{MLNX_PACK_VER}}.tgz |
| 68 | state=absent |
| 69 | |
| 70 | - name: Remove Mellanox Service files |
| 71 | become: yes |
| 72 | file: |
| 73 | path=/etc/init/mlnx-en.conf |
| 74 | state=absent |
| 75 | |
| 76 | - name: Remove Mellanox Init Script |
| 77 | become: yes |
| 78 | file: |
| 79 | path=/etc/init.d/mlnx-en.d |
| 80 | state=absent |