Ansible testbed setup for Taishan testbed
[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.yaml
6   when: ansible_distribution|lower == 'ubuntu'
7
8 - name: x86 specific
9   import_tasks: x86_64.yaml
10   when: ansible_machine == 'x86_64'
11
12 - name: skylake specific
13   import_tasks: skylake.yaml
14   when: ("skylake" in groups) and inventory_hostname in groups['skylake']
15
16 - name: aarch specific
17   import_tasks: aarch64.yaml
18   when: ansible_machine == 'aarch64'
19
20 - name: Copy netplan network config file
21   template:
22     src: 'files/netplan_config'
23     dest: '/etc/netplan/01-netcfg.yaml'
24     owner: 'root'
25     group: 'root'
26     mode: '0644'
27   tags: copy-interface-file
28
29 - name: Copy CSIT sysctl file
30   template:
31     src: 'files/90-csit'
32     dest: '/etc/sysctl.d/90-csit.conf'
33     owner: 'root'
34     group: 'root'
35     mode: '0644'
36   tags: copy-90-csit
37
38 - name: Copy IRQ load balancing file
39   copy:
40     src: 'files/irqbalance'
41     dest: '/etc/default/irqbalance'
42     owner: 'root'
43     group: 'root'
44     mode: '0644'
45   tags: copy-irq
46
47 - name: Copy cpufrequtils file
48   copy:
49     src: 'files/cpufrequtils'
50     dest: '/etc/default/cpufrequtils'
51     owner: 'root'
52     group: 'root'
53     mode: '0644'
54   tags: copy-cpufrequtils
55
56 - name: Copy Python requirements file
57   copy:
58     src: 'files/requirements.txt'
59     dest: '/tmp/requirements.txt'
60   tags: copy-pip
61
62 - name: Set ondemand service to disable
63   service:
64     name: 'ondemand'
65     enabled: 'no'
66   tags: set-ondemand
67
68 - name: Install PIP requirements
69   pip:
70     requirements: '/tmp/requirements.txt'
71   tags: install-pip
72
73 - name: Load vfio-pci by default
74   lineinfile:
75     path: '/etc/modules'
76     state: 'present'
77     line: 'vfio-pci'
78   tags: load-vfio-pci