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
25 - name: Adjust number of hugepages
30 sysctl_file: /etc/sysctl.d/90-csit.conf
33 - name: Add an Apt signing key, for docker-ce repository
35 url: https://download.docker.com/linux/ubuntu/gpg
38 - name: Add docker-ce apt repository if not present
40 repo: "deb https://download.docker.com/linux/ubuntu {{ ansible_distribution_release }} stable"
43 - name: Install docker-ce if it's not already installed
48 - name: "Add user for running tests: {{ csit.test_user.name }}"
50 name: "{{ csit.test_user.name }}"
51 password: "{{ csit.test_user.password }}"
52 home: "{{ csit.test_user.home }}"
53 shell: "{{ csit.test_user.shell }}"
55 - name: "Allow passwordless sudo for user: {{ csit.test_user.name }}"
57 path: "/etc/sudoers.d/{{ csit.test_user.name }}"
58 line: "{{ csit.test_user.name }} ALL=(ALL) NOPASSWD:ALL"
61 - name: Add vagrant user to docker group
67 - name: Reload groups for current session
68 command: /usr/bin/newgrp docker
70 - name: Load required kernel modules
77 - 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
102 - name: Prepare python virtual environmant for CSIT
104 command: "/usr/bin/virtualenv {{ csit.home }}/env"
106 chdir: "{{ csit.home }}"
107 creates: "{{ csit.home }}/env/bin/activate"
109 - name: Install python dependencies (from {{ csit.home }}/requirements.txt)
111 shell: source {{ csit.home }}/env/bin/activate && pip 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;