---
# file: roles/aws/tasks/main.yaml
+- name: AWS - Edit repositories
+ include_tasks: '{{ ansible_distribution|lower }}_{{ ansible_distribution_release }}.yaml'
+ tags: edit-repo
+
+- name: AWS - Get vfio-pci Patcher Script
+ get_url:
+ url: "https://github.com/amzn/amzn-drivers/raw/master/userspace/dpdk/enav2-vfio-patch/vfio-wc-patch.sh"
+ dest: "/opt/vfio-wc-patch.sh"
+ mode: "744"
+ register: "vfio_patch_downloaded"
+ tags:
+ - vfio-aws-patch
+
+- name: AWS - Patch vfio-pci
+ shell: "/bin/bash /opt/vfio-wc-patch.sh"
+ when: "vfio_patch_downloaded"
+ tags:
+ - vfio-aws-patch
+
- name: AWS - Load Kernel Modules By Default
lineinfile:
path: "/etc/modules"
line: "{{ item }}"
with_items:
- "vfio-pci"
+ - "igb_uio"
+ register: "modules_added"
+ tags:
+ - load-kernel-modules
+
+- name: AWS - Add Kernel Modules Options
+ lineinfile:
+ path: "/etc/modprobe.d/igb_uio.conf"
+ state: "present"
+ line: "{{ item }}"
+ create: "yes"
+ with_items:
+ - "options igb_uio wc_activate=1"
+ when: "modules_added"
+ register: "modules_added"
tags:
- load-kernel-modules
-- name: Performance Tuning - Adjust nr_hugepages
- # change the minimum size of the hugepage pool.
- # 2G VPP, 4GB per VNF/CNF, 2G reserve
+- name: AWS - Reload systemd-modules
+ systemd:
+ name: "systemd-modules-load"
+ state: "restarted"
+ when: "modules_added"
+ tags:
+ - reload-systemd-modules
+
+- name: AWS - Performance Tuning - Adjust nr_hugepages
sysctl:
name: "vm.nr_hugepages"
value: "8192"
become: yes
command: "make install T={{ dpdk_build_targets[ansible_machine] }}-linux-gcc DESTDIR={{ dpdk_target_dir }}/dpdk-stable-{{ dpdk_version }} chdir={{ dpdk_target_dir }}/dpdk-stable-{{ dpdk_version }}"
when: "linux__dpdk_extracted"
+ register: "linux__dpdk_compiled"
tags:
- install-dpdk
+
+- name: Link igb_uio module
+ shell: "ln -fs {{ dpdk_target_dir }}/dpdk-stable-{{ dpdk_version }}/{{ dpdk_build_targets[ansible_machine] }}-linux-gcc/kmod/igb_uio.ko /lib/modules/`uname -r`/igb_uio.ko && depmod -a"
+ ignore_errors: "yes"
+ when: "linux__dpdk_compiled"
+ tags:
+ - link-igb_uio-module