aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/main.yaml
blob: ea779c07da000a21066b373687a9da7e27c65b88 (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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
---
# file: roles/tg_sut/tasks/main.yaml

- name: Ubuntu specific
  import_tasks: ubuntu_x86_64.yaml
  when: ansible_distribution|lower == 'ubuntu' and ansible_machine == 'x86_64'

- name: Copy interfaces file
  template:
    src: 'files/interfaces_physical'
    dest: '/etc/network/interfaces'
    owner: 'root'
    group: 'root'
    mode: '0644'
  tags: copy-interface-file

- name: Copy sysctl file
  template:
    src: 'files/90-csit'
    dest: '/etc/sysctl.d/90-csit.conf'
    owner: 'root'
    group: 'root'
    mode: '0644'
  tags: copy-90-csit

- name: Copy IRQ load balancing file
  copy:
    src: 'files/irqbalance'
    dest: '/etc/default/irqbalance'
    owner: 'root'
    group: 'root'
    mode: '0644'
  tags: copy-irq

- name: Copy cpufrequtils file
  copy:
    src: 'files/cpufrequtils'
    dest: '/etc/default/cpufrequtils'
    owner: 'root'
    group: 'root'
    mode: '0644'
  tags: copy-cpufrequtils

- name: Copy Python requirements file
  copy:
    src: 'files/requirements.txt'
    dest: '/tmp/requirements.txt'
  tags: copy-pip

- name: Set isolcpus and pstate parameter
  lineinfile:
    path: '/etc/default/grub'
    state: 'present'
    regexp: '^GRUB_CMDLINE_LINUX='
    line: 'GRUB_CMDLINE_LINUX="isolcpus={{ isolcpus }} nohz_full={{ isolcpus }} rcu_nocbs={{ isolcpus }} numa_balancing=disable intel_pstate=disable intel_iommu=on iommu=pt nmi_watchdog=0 audit=0 nosoftlockup processor.max_cstate=1 intel_idle.max_cstate=1 hpet=disable tsc=reliable mce=off"'
  notify: ['Update GRUB']
  tags: set-grub

- name: Set ondemand service to disable
  service:
    name: 'ondemand'
    enabled: 'no'
  tags: set-ondemand

- name: Install PIP requirements
  pip:
    requirements: '/tmp/requirements.txt'
  tags: install-pip

- name: Load vfio-pci by default
  lineinfile:
    path: '/etc/modules'
    state: 'present'
    line: 'vfio-pci'
  tags: load-vfio-pci

- name: Load msr by default
  lineinfile:
    path: '/etc/modules'
    state: 'present'
    line: 'msr'
  tags: disable-turbo-boost

- name: Disable Turbo-Boost by service
  copy:
    src: 'files/disable-turbo-boost.service'
    dest: '/etc/systemd/system/disable-turbo-boost.service'
    owner: 'root'
    group: 'root'
    mode: '0644'
  when: >
        inventory_hostname in groups['skylake']
  tags: disable-turbo-boost

- name: Disable Turbo-Boost by service on startup
  service:
    name: disable-turbo-boost
    enabled: yes
  when: >
        inventory_hostname in groups['skylake']
  tags: disable-turbo-boost