2 # file: tasks/main.yaml
4 - name: Edit repositories
5 include_tasks: "{{ ansible_distribution|lower }}_{{ ansible_distribution_release }}.yaml"
10 ansible.builtin.package:
11 name: "{{ packages | flatten(levels=1) }}"
14 - aws-inst-prerequisites
16 - name: Switch Kernel At Boot
17 ansible.builtin.lineinfile:
18 path: "/etc/default/grub"
20 line: "GRUB_DEFAULT=\"1>2\""
26 - meta: flush_handlers
28 - name: Load Kernel Modules By Default
29 ansible.builtin.lineinfile:
37 - aws-load-kernel-modules
39 - name: Add Kernel Modules Options (igb_uio)
40 ansible.builtin.lineinfile:
41 path: "/etc/modprobe.d/igb_uio.conf"
46 - "options igb_uio wc_activate=1"
48 - aws-load-kernel-modules
50 - name: Add Kernel Modules Options (vfio-pci)
51 ansible.builtin.lineinfile:
52 path: "/etc/modprobe.d/vfio-noiommu.conf"
57 - "options vfio enable_unsafe_noiommu_mode=1"
59 - aws-load-kernel-modules
61 #- name: Get vfio-pci With WC Patcher
62 # ansible.builtin.get_url:
63 # url: "https://github.com/amzn/amzn-drivers/raw/master/userspace/dpdk/enav2-vfio-patch/get-vfio-with-wc.sh"
64 # dest: "/opt/get-vfio-with-wc.sh"
69 - name: Create vfio-pci Patch Directory
76 - name: Get vfio-pci WC Patch
77 ansible.builtin.get_url:
78 url: "https://github.com/amzn/amzn-drivers/raw/master/userspace/dpdk/enav2-vfio-patch/patches/{{ item }}"
79 dest: "/opt/patches/{{ item }}"
82 - "linux-4.10-vfio-wc.patch"
83 - "linux-5.8-vfio-wc.patch"
84 - "linux-5.15-vfio-wc.patch"
88 - name: Copy vfio-pci WC Patch
90 src: "files/get-vfio-with-wc.sh"
96 - name: Compile vfio-pci With WC Patch
97 ansible.builtin.shell: "/bin/bash /opt/get-vfio-with-wc.sh"
99 DEBIAN_FRONTEND: "noninteractive"
104 - name: Reload systemd-modules
105 ansible.builtin.systemd:
106 name: "systemd-modules-load"
109 - aws-reload-systemd-modules
111 - name: Adjust nr_hugepages
112 ansible.builtin.sysctl:
113 name: "vm.nr_hugepages"
116 sysctl_file: "/etc/sysctl.d/90-csit.conf"
121 - name: Shutdown host with delay
122 ansible.builtin.command: "/sbin/shutdown -P +720"
124 - aws-set-self-terminate