deca0670ec47e30ce63b7244156d04abbf0ea716
[csit.git] / resources / tools / testbed-setup / ansible / roles / aws / tasks / main.yaml
1 ---
2 # file: roles/aws/tasks/main.yaml
3
4 - name: Edit repositories
5   include_tasks: "{{ ansible_distribution|lower }}_{{ ansible_distribution_release }}.yaml"
6   tags:
7     - edit-repo
8
9 - name: Get vfio-pci With WC Patcher
10   get_url:
11     url: "https://github.com/amzn/amzn-drivers/raw/master/userspace/dpdk/enav2-vfio-patch/get-vfio-with-wc.sh"
12     dest: "/opt/get-vfio-with-wc.sh"
13     mode: "744"
14   tags:
15     - vfio-aws-patch
16
17 - name: Create vfio-pci Patch Directory
18   file:
19     path: "/opt/patches/"
20     state: "directory"
21   tags:
22     - vfio-aws-patch
23
24 - name: Get vfio-pci WC Patch
25   get_url:
26     url: "https://github.com/amzn/amzn-drivers/raw/master/userspace/dpdk/enav2-vfio-patch/patches/linux-4.10-vfio-wc.patch"
27     dest: "/opt/patches/linux-4.10-vfio-wc.patch"
28     mode: "744"
29   tags:
30     - vfio-aws-patch
31
32 - name: Compile vfio-pci With WC Patch
33   shell: "/bin/bash /opt/get-vfio-with-wc.sh"
34   tags:
35     - vfio-aws-patch
36
37 - name: Load Kernel Modules By Default
38   lineinfile:
39     path: "/etc/modules"
40     state: "present"
41     line: "{{ item }}"
42   with_items:
43     - "vfio-pci"
44     - "igb_uio"
45   tags:
46     - load-kernel-modules
47
48 - name: Add Kernel Modules Options (igb_uio)
49   lineinfile:
50     path: "/etc/modprobe.d/igb_uio.conf"
51     state: "present"
52     line: "{{ item }}"
53     create: "yes"
54   with_items:
55     - "options igb_uio wc_activate=1"
56   tags:
57     - load-kernel-modules
58
59 - name: Add Kernel Modules Options (vfio-pci)
60   lineinfile:
61     path: "/etc/modprobe.d/vfio-noiommu.conf"
62     state: "present"
63     line: "{{ item }}"
64     create: "yes"
65   with_items:
66     - "options vfio enable_unsafe_noiommu_mode=1"
67   tags:
68     - load-kernel-modules
69
70 - name: Reload systemd-modules
71   systemd:
72     name: "systemd-modules-load"
73     state: "restarted"
74   tags:
75     - reload-systemd-modules
76
77 - name: Performance Tuning - Adjust nr_hugepages
78   sysctl:
79     name: "vm.nr_hugepages"
80     value: "8192"
81     state: "present"
82     sysctl_file: "/etc/sysctl.d/90-csit.conf"
83     reload: "yes"
84   tags:
85     - set-sysctl