aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/testbed-setup/ansible/roles/aws/tasks/main.yaml
blob: 7b7a7fbb1a1554c1d4095157b5c0d88e5e5a36b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
---
# file: roles/aws/tasks/main.yaml

- name: AWS - Edit repositories
  include_tasks: '{{ ansible_distribution|lower }}_{{ ansible_distribution_release }}.yaml'
  tags: edit-repo

- name: AWS - Get vfio-pci Patcher Script
  get_url:
    url: "https://github.com/amzn/amzn-drivers/raw/master/userspace/dpdk/enav2-vfio-patch/vfio-wc-patch.sh"
    dest: "/opt/vfio-wc-patch.sh"
    mode: "744"
  register: "vfio_patch_downloaded"
  tags:
    - vfio-aws-patch

- name: AWS - Patch vfio-pci
  shell: "/bin/bash /opt/vfio-wc-patch.sh"
  when: "vfio_patch_downloaded"
  tags:
    - vfio-aws-patch

- name: AWS - Load Kernel Modules By Default
  lineinfile:
    path: "/etc/modules"
    state: "present"
    line: "{{ item }}"
  with_items:
    - "vfio-pci"
    - "igb_uio"
  register: "modules_added"
  tags:
    - load-kernel-modules

- name: AWS - Add Kernel Modules Options
  lineinfile:
    path: "/etc/modprobe.d/igb_uio.conf"
    state: "present"
    line: "{{ item }}"
    create: "yes"
  with_items:
    - "options igb_uio wc_activate=1"
  when: "modules_added"
  register: "modules_added"
  tags:
    - load-kernel-modules

- name: AWS - Reload systemd-modules
  systemd:
    name: "systemd-modules-load"
    state: "restarted"
  when: "modules_added"
  tags:
    - reload-systemd-modules

- name: AWS - Performance Tuning - Adjust nr_hugepages
  sysctl:
    name: "vm.nr_hugepages"
    value: "8192"
    state: "present"
    sysctl_file: "/etc/sysctl.d/90-csit.conf"
    reload: "yes"
  tags:
    - set-sysctl