----\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 }} 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"'\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
-\r
-- name: Load vfio-pci by default\r
- lineinfile:\r
- path: '/etc/modules'\r
- state: 'present'\r
- line: 'vfio-pci'\r
- tags: load-vfio-pci\r
-\r
-- name: Load msr by default\r
- lineinfile:\r
- path: '/etc/modules'\r
- state: 'present'\r
- line: 'msr'\r
- tags: disable-turbo-boost\r
-\r
-- name: Disable Turbo-Boost by service\r
- copy:\r
- src: 'files/disable-turbo-boost.service'\r
- dest: '/etc/systemd/system/disable-turbo-boost.service'\r
- owner: 'root'\r
- group: 'root'\r
- mode: '0644'\r
- when: >\r
- inventory_hostname in groups['skylake']\r
- tags: disable-turbo-boost\r
-\r
-- name: Disable Turbo-Boost by service on startup\r
- service:\r
- name: disable-turbo-boost\r
- enabled: yes\r
- when: >\r
- inventory_hostname in groups['skylake']\r
- tags: disable-turbo-boost\r
+---
+# file: roles/tg_sut/tasks/main.yaml
+
+- name: Install distribution - release - machine prerequisites
+ include_tasks: '{{ ansible_distribution|lower }}_{{ ansible_distribution_release }}.yaml'
+
+- name: Machine specifics
+ include_tasks: '{{ ansible_machine }}.yaml'
+
+- name: skylake specific
+ import_tasks: skylake.yaml
+ when: ("skylake" in groups) and inventory_hostname in groups['skylake']
+
+- name: Copy netplan network config file
+ template:
+ src: 'files/netplan_config'
+ dest: '/etc/netplan/01-netcfg.yaml'
+ owner: 'root'
+ group: 'root'
+ mode: '0644'
+ tags: copy-interface-file
+
+- name: Copy CSIT 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: Set ondemand service to disable
+ service:
+ name: 'ondemand'
+ enabled: 'no'
+ tags: set-ondemand
+
+- name: Install CSIT PIP requirements
+ pip:
+ name:
+ - 'docopt==0.6.2'
+ - 'ecdsa==0.13'
+ - 'enum34==1.1.2'
+ - 'ipaddress==1.0.16'
+ - 'paramiko==1.16.0'
+ - 'pexpect==4.6.0'
+ - 'pycrypto==2.6.1'
+ - 'pykwalify==1.5.0'
+ - 'pypcap==1.1.5'
+ - 'python-dateutil==2.4.2'
+ - 'PyYAML==3.11'
+ - 'requests==2.9.1'
+ - 'robotframework==2.9.2'
+ - 'scapy==2.3.1'
+ - 'scp==0.10.2'
+ - 'six==1.12.0'
+ - 'dill==0.2.8.2'
+ - 'numpy==1.14.5'
+ - 'scipy==1.1.0'
+ tags: install-pip
+
+- name: Install VPP PIP requirements
+ pip:
+ name:
+ - 'aenum==2.1.2'
+ tags: install-pip
+
+- name: Load vfio-pci by default
+ lineinfile:
+ path: '/etc/modules'
+ state: 'present'
+ line: 'vfio-pci'
+ tags: load-vfio-pci