From aab8a1ede3f6cd9843b7961db5a7c658e374f008 Mon Sep 17 00:00:00 2001 From: jgoutin Date: Mon, 22 Jul 2019 10:07:38 +0200 Subject: [PATCH] Fix Github limit and variable name. --- README.md | 23 +++++++++++++++++------ defaults/main.yml | 2 +- tasks/main.yml | 26 +++++++++----------------- 3 files changed, 27 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index d20db03..a7b1316 100644 --- a/README.md +++ b/README.md @@ -17,14 +17,25 @@ The role requires to be run as root on the target host. Role Variables -------------- -* **aws_fpga_allow_non_root**: If `true`, allow FPGA devices access to users in the group specified by *aws_fpga_sdk_group*. Default to `false`. -* **aws_fpga_sdk_group**: Name of the group of users that can access to FPGA devices. Default to `fpgauser`. No effect if *aws_fpga_allow_non_root* is `false`. -* **aws_fpga_sdk_override_group**: If true, do not raise error if the group specified by *aws_fpga_sdk_group* already exists. Default to `false`. No effect if *aws_fpga_allow_non_root* is `false`. +* **aws_fpga_version**: AWS FPGA version; If not specified, use latest version available. -* **fpga_driver**: FPGA driver name. If specified, install and enable the specified Linux kernel driver. See [AWS FPGA linux kernel drivers](https://github.com/aws/aws-fpga/tree/master/sdk/linux_kernel_drivers) for the list of available drivers. +* **aws_fpga_allow_non_root**: If `true`, allow FPGA devices access to users in the group specified by *aws_fpga_sdk_group*. + Default to `false`. +* **aws_fpga_sdk_group**: Name of the group of users that can access to FPGA devices. + Default to `fpgauser`. + No effect if *aws_fpga_allow_non_root* is `false`. +* **aws_fpga_sdk_override_group**: If true, do not raise error if the group specified by *aws_fpga_sdk_group* already exists. + Default to `false`. No effect if *aws_fpga_allow_non_root* is `false`. + +* **aws_fpga_xrt**: If `true`, also install Xilinx XRT. + Default to `true`. +* **xilinx_xrt_version**: If *aws_fpga_xrt* is `true`, Xilinx XRT version to install. + Default to `2018.3`. + +* **aws_fpga_driver**: FPGA driver name. If specified, install and enable the specified Linux kernel driver. + See [AWS FPGA linux kernel drivers](https://github.com/aws/aws-fpga/tree/master/sdk/linux_kernel_drivers) for the list of available drivers. + If *aws_fpga_xrt* is `true`, the XOCl driver shipped with XRT is installed. -* **aws_fpga_xrt**: If `true`, also install Xilinx XRT. Default to `true`. -* **xilinx_xrt_version**: If *aws_fpga_xrt* is `true`, Xilinx XRT version to install. Default to `2018.3`. Example Playbook ---------------- diff --git a/defaults/main.yml b/defaults/main.yml index f82a397..867c19f 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -8,4 +8,4 @@ aws_fpga_sdk_override_group: false aws_fpga_xrt: true # FPGA driver to install -fpga_driver: '' +aws_fpga_driver: '' diff --git a/tasks/main.yml b/tasks/main.yml index 9bcf603..20b9cd3 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -13,17 +13,6 @@ ternary('lib64','lib') }}/libfpga_mgmt.so" register: libfpga_mgmt -- name: Find AWS FPGA release information - uri: - url: "https://api.github.com/repos/aws/aws-fpga/releases/\ - {{ (fpga_driver_version is defined) | ternary('tags/','latest') }}\ - {{ fpga_driver_version | default('') }}" - return_content: true - register: aws_sdk_release - retries: 10 - delay: 1 - when: not libfpga_mgmt.stat.exists - - name: Create AWS FPGA source temporary directory tempfile: state: directory @@ -33,7 +22,8 @@ - name: Download and extract AWS FPGA release tarbal unarchive: - src: "{{ aws_sdk_release.json.tarball_url }}" + src: "https://api.github.com/repos/aws/aws-fpga/tarball/\ + {{ aws_fpga_version | default('') }}" dest: "{{ aws_fpga_src.path }}" remote_src: true extra_opts: ['--strip-components=1'] @@ -82,7 +72,7 @@ state: present retries: 10 delay: 1 - when: "fpga_driver != '' and ansible_os_family == 'RedHat' and + when: "aws_fpga_driver != '' and ansible_os_family == 'RedHat' and not libfpga_mgmt.stat.exists" - name: Ensure AWS FPGA driver build dependencies are present [Debian] @@ -93,20 +83,22 @@ state: present retries: 10 delay: 1 - when: "fpga_driver != '' and ansible_os_family == 'Debian' and + when: "aws_fpga_driver != '' and ansible_os_family == 'Debian' and not libfpga_mgmt.stat.exists" - name: Build and install AWS FPGA driver command: "{{ item }}" args: - chdir: "{{ aws_fpga_src.path }}/sdk/linux_kernel_drivers/{{ fpga_driver }}" + chdir: "{{ aws_fpga_src.path }}/sdk/linux_kernel_drivers/\ + {{ aws_fpga_driver }}" environment: + # Required for XOCL SDACCEL_DIR: "{{ aws_fpga_src.path }}/SDAccel" with_items: - /usr/bin/make -j - /usr/bin/make install - - "/usr/sbin/modprobe {{ fpga_driver }}" - when: fpga_driver != '' and not libfpga_mgmt.stat.exists + - "/usr/sbin/modprobe {{ aws_fpga_driver }}" + when: aws_fpga_driver != '' and not libfpga_mgmt.stat.exists - name: Clean up AWS FPGA temporary directory file: