Ansible git move
[csit.git] / fdio.infra.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     - aws-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     - aws-vfio-patch
16
17 - name: Create vfio-pci Patch Directory
18   file:
19     path: "/opt/patches/"
20     state: "directory"
21   tags:
22     - aws-vfio-patch
23
24 - name: Get vfio-pci WC Patch >=4.10
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     - aws-vfio-patch
31
32 - name: Get vfio-pci WC Patch >=5.8
33   get_url:
34     url: "https://github.com/amzn/amzn-drivers/raw/master/userspace/dpdk/enav2-vfio-patch/patches/linux-5.8-vfio-wc.patch"
35     dest: "/opt/patches/linux-5.8-vfio-wc.patch"
36     mode: "744"
37   tags:
38     - aws-vfio-patch
39
40 - name: Compile vfio-pci With WC Patch
41   shell: "/bin/bash /opt/get-vfio-with-wc.sh"
42   tags:
43     - aws-vfio-patch
44
45 - name: Load Kernel Modules By Default
46   lineinfile:
47     path: "/etc/modules"
48     state: "present"
49     line: "{{ item }}"
50   with_items:
51     - "vfio-pci"
52     - "igb_uio"
53   tags:
54     - aws-load-kernel-modules
55
56 - name: Add Kernel Modules Options (igb_uio)
57   lineinfile:
58     path: "/etc/modprobe.d/igb_uio.conf"
59     state: "present"
60     line: "{{ item }}"
61     create: "yes"
62   with_items:
63     - "options igb_uio wc_activate=1"
64   tags:
65     - aws-load-kernel-modules
66
67 - name: Add Kernel Modules Options (vfio-pci)
68   lineinfile:
69     path: "/etc/modprobe.d/vfio-noiommu.conf"
70     state: "present"
71     line: "{{ item }}"
72     create: "yes"
73   with_items:
74     - "options vfio enable_unsafe_noiommu_mode=1"
75   tags:
76     - aws-load-kernel-modules
77
78 - name: Reload systemd-modules
79   systemd:
80     name: "systemd-modules-load"
81     state: "restarted"
82   tags:
83     - aws-reload-systemd-modules
84
85 - name: Performance Tuning - Adjust nr_hugepages
86   sysctl:
87     name: "vm.nr_hugepages"
88     value: "8192"
89     state: "present"
90     sysctl_file: "/etc/sysctl.d/90-csit.conf"
91     reload: "yes"
92   tags:
93     - aws-set-hugepages