2 # file: csit/tasks/main.yml
5 - name: CentOS - Install epel repositories
10 - ansible_distribution|lower == 'centos'
12 - name: CentOS - Enable PowerTools
15 --set-enabled PowerTools
17 - ansible_distribution|lower == 'centos'
19 # NOTE: containerd.io >1.2.0-3 requirement disabled by RH
20 # Unable to install current docker version as of now
21 # Using docker-ce-3:18.09.1-3.el7
22 - name: CentOS - Add docker-ce repo
25 --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
27 - ansible_distribution|lower == 'centos'
29 - name: CentOS - Install docker-ce
32 - 'docker-ce-3:18.09.1-3.el7'
34 - ansible_distribution|lower == 'centos'
37 - name: Ubuntu - Add docker-ce GPG key
39 url: 'https://download.docker.com/linux/ubuntu/gpg'
41 - ansible_distribution|lower == 'ubuntu'
43 - name: Ubuntu - Add docker-ce repo
45 repo: 'deb https://download.docker.com/linux/ubuntu {{ ansible_distribution_release }} stable'
49 - ansible_distribution|lower == 'ubuntu'
51 - name: Ubuntu - Install docker-ce
58 - ansible_distribution|lower == 'ubuntu'
61 - name: Install required system tools and packages
63 name: "{{ csit_packages | join(',') }}"
66 - name: Adjust number of hugepages
68 name: 'vm.nr_hugepages'
71 sysctl_file: '/etc/sysctl.d/90-csit.conf'
74 - name: "Add user for running tests: {{ csit.test_user.name }}"
76 name: '{{ csit.test_user.name }}'
77 password: '{{ csit.test_user.password }}'
78 home: '{{ csit.test_user.home }}'
79 shell: '{{ csit.test_user.shell }}'
81 - name: "Allow passwordless sudo for user: {{ csit.test_user.name }}"
83 path: '/etc/sudoers.d/{{ csit.test_user.name }}'
84 line: '{{ csit.test_user.name }} ALL=(ALL) NOPASSWD:ALL'
88 - name: Add vagrant user to docker group
94 - name: Reload groups for current session
95 command: '/usr/bin/newgrp docker'
97 - name: Load required kernel modules
104 - name: Enable required kernel modules on boot
114 - name: Clone CSIT repository
117 repo: '{{ csit.repository.url }}'
118 dest: '{{ csit.home }}'
120 version: '{{ csit.repository.version }}'
122 - name: Prepare python virtual environmant for CSIT
124 command: '/usr/bin/virtualenv --python=/usr/bin/python3 {{ csit.home }}/env'
126 chdir: '{{ csit.home }}'
127 creates: '{{ csit.home }}/env/bin/activate'
129 - name: Install python dependencies (from {{ csit.home }}/requirements.txt)
132 source '{{ csit.home }}/env/bin/activate' &&
133 pip3 install --timeout 300 -r '{{ csit.home }}/requirements.txt'
135 executable: '/bin/bash'
137 - name: Load csit docker image from local drive if it exists (/vagrant/csit-sut.tar)
139 if [ -z "$(docker images -q `cat {{ csit.home }}/VPP_DEVICE_IMAGE`)" ] && [ -e /vagrant/csit-sut.tar ]; then
140 docker load -i /vagrant/csit-sut.tar;