Re-compile vfio-pci and igb_uio for AWS in ansible scripts.
[csit.git] / resources / tools / testbed-setup / ansible / roles / aws / tasks / main.yaml
1 ---
2 # file: roles/aws/tasks/main.yaml
3
4 - name: AWS - Edit repositories
5   include_tasks: '{{ ansible_distribution|lower }}_{{ ansible_distribution_release }}.yaml'
6   tags: edit-repo
7
8 - name: AWS - Get vfio-pci Patcher Script
9   get_url:
10     url: "https://github.com/amzn/amzn-drivers/raw/master/userspace/dpdk/enav2-vfio-patch/vfio-wc-patch.sh"
11     dest: "/opt/vfio-wc-patch.sh"
12     mode: "744"
13   register: "vfio_patch_downloaded"
14   tags:
15     - vfio-aws-patch
16
17 - name: AWS - Patch vfio-pci
18   shell: "/bin/bash /opt/vfio-wc-patch.sh"
19   when: "vfio_patch_downloaded"
20   tags:
21     - vfio-aws-patch
22
23 - name: AWS - Load Kernel Modules By Default
24   lineinfile:
25     path: "/etc/modules"
26     state: "present"
27     line: "{{ item }}"
28   with_items:
29     - "vfio-pci"
30     - "igb_uio"
31   register: "modules_added"
32   tags:
33     - load-kernel-modules
34
35 - name: AWS - Add Kernel Modules Options
36   lineinfile:
37     path: "/etc/modprobe.d/igb_uio.conf"
38     state: "present"
39     line: "{{ item }}"
40     create: "yes"
41   with_items:
42     - "options igb_uio wc_activate=1"
43   when: "modules_added"
44   register: "modules_added"
45   tags:
46     - load-kernel-modules
47
48 - name: AWS - Reload systemd-modules
49   systemd:
50     name: "systemd-modules-load"
51     state: "restarted"
52   when: "modules_added"
53   tags:
54     - reload-systemd-modules
55
56 - name: AWS - Performance Tuning - Adjust nr_hugepages
57   sysctl:
58     name: "vm.nr_hugepages"
59     value: "8192"
60     state: "present"
61     sysctl_file: "/etc/sysctl.d/90-csit.conf"
62     reload: "yes"
63   tags:
64     - set-sysctl