Remove THIS tag and use unix endlines
[csit.git] / resources / tools / testbed-setup / ansible / roles / tg_sut / tasks / main.yaml
1 ---
2 # file: roles/tg_sut/tasks/main.yaml
3
4 - name: Ubuntu specific
5   import_tasks: ubuntu_x86_64.yaml
6   when: ansible_distribution|lower == 'ubuntu' and ansible_machine == 'x86_64'
7
8 - name: Copy interfaces file
9   template:
10     src: 'files/interfaces_physical'
11     dest: '/etc/network/interfaces'
12     owner: 'root'
13     group: 'root'
14     mode: '0644'
15   tags: copy-interface-file
16
17 - name: Copy sysctl file
18   template:
19     src: 'files/90-csit'
20     dest: '/etc/sysctl.d/90-csit.conf'
21     owner: 'root'
22     group: 'root'
23     mode: '0644'
24   tags: copy-90-csit
25
26 - name: Copy IRQ load balancing file
27   copy:
28     src: 'files/irqbalance'
29     dest: '/etc/default/irqbalance'
30     owner: 'root'
31     group: 'root'
32     mode: '0644'
33   tags: copy-irq
34
35 - name: Copy cpufrequtils file
36   copy:
37     src: 'files/cpufrequtils'
38     dest: '/etc/default/cpufrequtils'
39     owner: 'root'
40     group: 'root'
41     mode: '0644'
42   tags: copy-cpufrequtils
43
44 - name: Copy Python requirements file
45   copy:
46     src: 'files/requirements.txt'
47     dest: '/tmp/requirements.txt'
48   tags: copy-pip
49
50 - name: Set isolcpus and pstate parameter
51   lineinfile:
52     path: '/etc/default/grub'
53     state: 'present'
54     regexp: '^GRUB_CMDLINE_LINUX='
55     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"'
56   notify: ['Update GRUB']
57   tags: set-grub
58
59 - name: Set ondemand service to disable
60   service:
61     name: 'ondemand'
62     enabled: 'no'
63   tags: set-ondemand
64
65 - name: Install PIP requirements
66   pip:
67     requirements: '/tmp/requirements.txt'
68   tags: install-pip
69
70 - name: Load vfio-pci by default
71   lineinfile:
72     path: '/etc/modules'
73     state: 'present'
74     line: 'vfio-pci'
75   tags: load-vfio-pci
76
77 - name: Load msr by default
78   lineinfile:
79     path: '/etc/modules'
80     state: 'present'
81     line: 'msr'
82   tags: disable-turbo-boost
83
84 - name: Disable Turbo-Boost by service
85   copy:
86     src: 'files/disable-turbo-boost.service'
87     dest: '/etc/systemd/system/disable-turbo-boost.service'
88     owner: 'root'
89     group: 'root'
90     mode: '0644'
91   when: >
92         inventory_hostname in groups['skylake']
93   tags: disable-turbo-boost
94
95 - name: Disable Turbo-Boost by service on startup
96   service:
97     name: disable-turbo-boost
98     enabled: yes
99   when: >
100         inventory_hostname in groups['skylake']
101   tags: disable-turbo-boost