2 # file: roles/aws/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:
39 - aws-load-kernel-modules
41 - name: Add Kernel Modules Options (igb_uio)
42 ansible.builtin.lineinfile:
43 path: "/etc/modprobe.d/igb_uio.conf"
48 - "options igb_uio wc_activate=1"
52 - aws-load-kernel-modules
54 - name: Add Kernel Modules Options (vfio-pci)
55 ansible.builtin.lineinfile:
56 path: "/etc/modprobe.d/vfio-noiommu.conf"
61 - "options vfio enable_unsafe_noiommu_mode=1"
65 - aws-load-kernel-modules
67 - meta: flush_handlers
69 #- name: Get vfio-pci With WC Patcher
70 # ansible.builtin.get_url:
71 # url: "https://github.com/amzn/amzn-drivers/raw/master/userspace/dpdk/enav2-vfio-patch/get-vfio-with-wc.sh"
72 # dest: "/opt/get-vfio-with-wc.sh"
77 - name: Create vfio-pci Patch Directory
84 - name: Get vfio-pci WC Patch
85 ansible.builtin.get_url:
86 url: "https://github.com/amzn/amzn-drivers/raw/master/userspace/dpdk/enav2-vfio-patch/patches/{{ item }}"
87 dest: "/opt/patches/{{ item }}"
90 - "linux-4.10-vfio-wc.patch"
91 - "linux-5.8-vfio-wc.patch"
92 - "linux-5.15-vfio-wc.patch"
96 - name: Copy vfio-pci WC Patch
98 src: "files/get-vfio-with-wc.sh"
104 - name: Compile vfio-pci With WC Patch
105 ansible.builtin.shell: "/bin/bash /opt/get-vfio-with-wc.sh"
107 DEBIAN_FRONTEND: "noninteractive"
112 - name: Reload systemd-modules
113 ansible.builtin.systemd:
114 name: "systemd-modules-load"
117 - aws-reload-systemd-modules
119 - name: Adjust nr_hugepages
120 ansible.builtin.sysctl:
121 name: "vm.nr_hugepages"
124 sysctl_file: "/etc/sysctl.d/90-csit.conf"
129 - name: Shutdown host with delay
130 ansible.builtin.command: "/sbin/shutdown -P +720"
132 - aws-set-self-terminate