Ansible: Cascadelake include
[csit.git] / resources / tools / testbed-setup / ansible / roles / tg_sut / tasks / main.yaml
index ea779c0..a2d2c20 100644 (file)
@@ -1,20 +1,29 @@
 ---
 # 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: Install distribution - release - machine prerequisites
+  include_tasks: '{{ ansible_distribution|lower }}_{{ ansible_distribution_release }}.yaml'
+  tags: [ install-csit-dependencies, install-docker, install-kubernetes ]
 
-- name: Copy interfaces file
+- name: Machine specifics
+  include_tasks: '{{ ansible_machine }}.yaml'
+  tags: [ disable-turbo-boost, set-grub, install-pip ]
+
+- name: Turbo boost specific
+  import_tasks: turbo_boost.yaml
+  when: cpu_microarchitecture == "skylake" or cpu_microarchitecture == "cascadelake"
+  tags: [ install-msr, disable-turbo-boost ]
+
+- name: Copy netplan network config file
   template:
-    src: 'files/interfaces_physical'
-    dest: '/etc/network/interfaces'
+    src: 'files/netplan_config'
+    dest: '/etc/netplan/01-netcfg.yaml'
     owner: 'root'
     group: 'root'
     mode: '0644'
   tags: copy-interface-file
 
-- name: Copy sysctl file
+- name: Copy CSIT sysctl file
   template:
     src: 'files/90-csit'
     dest: '/etc/sysctl.d/90-csit.conf'
     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
+- name: Install VPP PIP requirements
   pip:
-    requirements: '/tmp/requirements.txt'
+    name:
+      - 'aenum==2.1.2'
   tags: install-pip
 
 - name: Load vfio-pci by default
     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