CSIT-1070 Update Ansible structure
[csit.git] / resources / tools / testbed-setup / ansible / roles / tg_sut / tasks / main.yaml
diff --git a/resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/main.yaml b/resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/main.yaml
new file mode 100644 (file)
index 0000000..c8454f5
--- /dev/null
@@ -0,0 +1,68 @@
+---\r
+# file: roles/tg_sut/tasks/main.yaml\r
+\r
+- name: Ubuntu specific\r
+  import_tasks: ubuntu_x86_64.yaml\r
+  when: ansible_distribution|lower == 'ubuntu' and ansible_machine == 'x86_64'\r
+\r
+- name: Copy interfaces file\r
+  template:\r
+    src: 'files/interfaces_physical'\r
+    dest: '/etc/network/interfaces'\r
+    owner: 'root'\r
+    group: 'root'\r
+    mode: '0644'\r
+  tags: copy-interface-file\r
+\r
+- name: Copy sysctl file\r
+  template:\r
+    src: 'files/90-csit'\r
+    dest: '/etc/sysctl.d/90-csit.conf'\r
+    owner: 'root'\r
+    group: 'root'\r
+    mode: '0644'\r
+  tags: copy-90-csit\r
+\r
+- name: Copy IRQ load balancing file\r
+  copy:\r
+    src: 'files/irqbalance'\r
+    dest: '/etc/default/irqbalance'\r
+    owner: 'root'\r
+    group: 'root'\r
+    mode: '0644'\r
+  tags: copy-irq\r
+\r
+- name: Copy cpufrequtils file\r
+  copy:\r
+    src: 'files/cpufrequtils'\r
+    dest: '/etc/default/cpufrequtils'\r
+    owner: 'root'\r
+    group: 'root'\r
+    mode: '0644'\r
+  tags: copy-cpufrequtils\r
+\r
+- name: Copy Python requirements file\r
+  copy:\r
+    src: 'files/requirements.txt'\r
+    dest: '/tmp/requirements.txt'\r
+  tags: copy-pip\r
+\r
+- name: Set isolcpus and pstate parameter\r
+  lineinfile:\r
+    path: '/etc/default/grub'\r
+    state: 'present'\r
+    regexp: '^GRUB_CMDLINE_LINUX='\r
+    line: 'GRUB_CMDLINE_LINUX="isolcpus={{ isolcpus }} nohz_full={{ isolcpus }} rcu_nocbs={{ isolcpus }} intel_pstate=disable"'\r
+  notify: ['Update GRUB']\r
+  tags: set-grub\r
+\r
+- name: Set ondemand service to disable\r
+  service:\r
+    name: 'ondemand'\r
+    enabled: 'no'\r
+  tags: set-ondemand\r
+\r
+- name: Install PIP requirements\r
+  pip:\r
+    requirements: '/tmp/requirements.txt'\r
+  tags: install-pip\r