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: Load Kernel Modules By Default
17 ansible.builtin.lineinfile:
25 - aws-load-kernel-modules
27 - name: Add Kernel Modules Options (igb_uio)
28 ansible.builtin.lineinfile:
29 path: "/etc/modprobe.d/igb_uio.conf"
34 - "options igb_uio wc_activate=1"
36 - aws-load-kernel-modules
38 - name: Add Kernel Modules Options (vfio-pci)
39 ansible.builtin.lineinfile:
40 path: "/etc/modprobe.d/vfio-noiommu.conf"
45 - "options vfio enable_unsafe_noiommu_mode=1"
47 - aws-load-kernel-modules
49 - name: Kernel Parameters
50 ansible.builtin.lineinfile:
51 path: "/etc/default/grub"
53 regexp: "^GRUB_CMDLINE_LINUX="
54 line: "GRUB_CMDLINE_LINUX=iommu=1 intel_iommu=on"
60 - meta: flush_handlers
62 - name: Disable Password Login
63 ansible.builtin.lineinfile:
64 dest: "/etc/ssh/sshd_config"
65 regexp: "^PasswordAuthentication yes"
66 line: "PasswordAuthentication no"
72 - name: Recursively Delete Other Configs
74 path: "/etc/ssh/sshd_config.d"
79 #- name: Get vfio-pci With WC Patcher
80 # ansible.builtin.get_url:
81 # url: "https://github.com/amzn/amzn-drivers/raw/master/userspace/dpdk/enav2-vfio-patch/get-vfio-with-wc.sh"
82 # dest: "/opt/get-vfio-with-wc.sh"
87 #- name: Create vfio-pci Patch Directory
88 # ansible.builtin.file:
89 # path: "/opt/patches/"
94 #- name: Get vfio-pci WC Patch
95 # ansible.builtin.get_url:
96 # url: "https://github.com/amzn/amzn-drivers/raw/master/userspace/dpdk/enav2-vfio-patch/patches/{{ item }}"
97 # dest: "/opt/patches/{{ item }}"
100 # - "linux-4.10-vfio-wc.patch"
101 # - "linux-5.8-vfio-wc.patch"
102 # - "linux-5.15-vfio-wc.patch"
106 #- name: Copy vfio-pci WC Patch
107 # ansible.builtin.copy:
108 # src: "files/get-vfio-with-wc.sh"
114 #- name: Compile vfio-pci With WC Patch
115 # ansible.builtin.shell: "/bin/bash /opt/get-vfio-with-wc.sh"
117 # DEBIAN_FRONTEND: "noninteractive"
122 - name: Adjust nr_hugepages
123 ansible.builtin.sysctl:
124 name: "vm.nr_hugepages"
127 sysctl_file: "/etc/sysctl.d/90-csit.conf"
132 - name: Shutdown host with delay
133 ansible.builtin.command: "/sbin/shutdown -P +720"
135 - aws-set-self-terminate