2 # file: csit/tasks/main.yml
4 - name: Upload config to rename network interfaces
6 src: 'files/99-vppdevice.yaml'
7 dest: '/etc/netplan/99-vppdevice.yaml'
12 - name: Apply network config changes
13 command: '/usr/sbin/netplan apply'
15 - name: Install required system tools and packages
23 - 'python3-cffi-backend'
26 - 'python3-setuptools'
30 cache_valid_time: 3600
32 - name: Adjust number of hugepages
34 name: 'vm.nr_hugepages'
37 sysctl_file: '/etc/sysctl.d/90-csit.conf'
40 - name: Add an Apt signing key, for docker-ce repository
42 url: 'https://download.docker.com/linux/ubuntu/gpg'
45 - name: Add docker-ce apt repository if not present
47 repo: 'deb https://download.docker.com/linux/ubuntu {{ ansible_distribution_release }} stable'
50 - name: Install docker-ce if it's not already installed
54 cache_valid_time: 3600
56 - name: "Add user for running tests: {{ csit.test_user.name }}"
58 name: '{{ csit.test_user.name }}'
59 password: '{{ csit.test_user.password }}'
60 home: '{{ csit.test_user.home }}'
61 shell: '{{ csit.test_user.shell }}'
63 - name: "Allow passwordless sudo for user: {{ csit.test_user.name }}"
65 path: '/etc/sudoers.d/{{ csit.test_user.name }}'
66 line: '{{ csit.test_user.name }} ALL=(ALL) NOPASSWD:ALL'
69 - name: Add vagrant user to docker group
75 - name: Reload groups for current session
76 command: '/usr/bin/newgrp docker'
78 - name: Load required kernel modules
85 - name: Enable required kernel modules on boot
94 - name: Clone CSIT repository
97 repo: '{{ csit.repository.url }}'
98 dest: '{{ csit.home }}'
100 version: '{{ csit.repository.version }}'
102 - name: Install and update pip and virtualenv
109 - name: Prepare python virtual environmant for CSIT
111 command: '/usr/bin/virtualenv --python=/usr/bin/python3 {{ csit.home }}/env'
113 chdir: '{{ csit.home }}'
114 creates: '{{ csit.home }}/env/bin/activate'
116 - name: Install python dependencies (from {{ csit.home }}/requirements.txt)
119 source '{{ csit.home }}/env/bin/activate' &&
120 pip3 install --timeout 300 -r '{{ csit.home }}/requirements.txt'
122 executable: '/bin/bash'
124 - name: Load csit docker image from local drive if it exists (/vagrant/csit-sut.tar)
126 if [ -z "$(docker images -q `cat {{ csit.home }}/VPP_DEVICE_IMAGE`)" ] && [ -e /vagrant/csit-sut.tar ]; then
127 docker load -i /vagrant/csit-sut.tar;