2 # file: csit/tasks/main.yml
4 # TODO: Temporarily disabling due to Centos8 not having netplan.
5 # Finding better solution via udev requires some work and testing.
6 #- name: Upload config to rename network interfaces
8 # src: 'files/99-vppdevice.yaml'
9 # dest: '/etc/netplan/99-vppdevice.yaml'
13 #- name: Apply network config changes
14 # command: '/usr/sbin/netplan apply'
16 - name: Centos8 install epel repositories
21 - ansible_distribution|lower == 'centos'
23 - name: Centos8 enable epel repositories
24 command: 'dnf config-manager --set-enabled PowerTools'
26 - ansible_distribution|lower == 'centos'
28 - name: Install required system tools and packages
30 name: "{{ csit_packages | join(',') }}"
34 - name: Adjust number of hugepages
36 name: 'vm.nr_hugepages'
39 sysctl_file: '/etc/sysctl.d/90-csit.conf'
42 - name: Install docker-ce
44 curl -fsSL https://get.docker.com -o get-docker.sh &&
47 - name: "Add user for running tests: {{ csit.test_user.name }}"
49 name: '{{ csit.test_user.name }}'
50 password: '{{ csit.test_user.password }}'
51 home: '{{ csit.test_user.home }}'
52 shell: '{{ csit.test_user.shell }}'
54 - name: "Allow passwordless sudo for user: {{ csit.test_user.name }}"
56 path: '/etc/sudoers.d/{{ csit.test_user.name }}'
57 line: '{{ csit.test_user.name }} ALL=(ALL) NOPASSWD:ALL'
60 - name: Add vagrant user to docker group
66 - name: Reload groups for current session
67 command: '/usr/bin/newgrp docker'
69 - name: Load required kernel modules
76 - name: Enable required kernel modules on boot
86 - name: Clone CSIT repository
89 repo: '{{ csit.repository.url }}'
90 dest: '{{ csit.home }}'
92 version: '{{ csit.repository.version }}'
94 - name: Install and update pip and virtualenv
100 - name: Prepare python virtual environmant for CSIT
102 command: '/usr/bin/virtualenv --python=/usr/bin/python3 {{ csit.home }}/env'
104 chdir: '{{ csit.home }}'
105 creates: '{{ csit.home }}/env/bin/activate'
107 - name: Install python dependencies (from {{ csit.home }}/requirements.txt)
110 source '{{ csit.home }}/env/bin/activate' &&
111 pip3 install --timeout 300 -r '{{ csit.home }}/requirements.txt'
113 executable: '/bin/bash'
115 - name: Load csit docker image from local drive if it exists (/vagrant/csit-sut.tar)
117 if [ -z "$(docker images -q `cat {{ csit.home }}/VPP_DEVICE_IMAGE`)" ] && [ -e /vagrant/csit-sut.tar ]; then
118 docker load -i /vagrant/csit-sut.tar;