aboutsummaryrefslogtreecommitdiffstats
path: root/fdio.infra.ansible/roles/vagrant/tasks/main.yml
blob: 1716ebe0d52f11e8cebc850317ba7a9548c9cb8d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
---
# file: vagrant/tasks/main.yml

# General
- name: Adjust number of hugepages
  sysctl:
    name: "vm.nr_hugepages"
    value: "512"
    state: "present"
    sysctl_file: "/etc/sysctl.d/90-csit.conf"
    reload: true

- name: "Add user for running tests: {{ csit.test_user.name }}"
  user:
    name: "{{ csit.test_user.name }}"
    password: "{{ csit.test_user.password }}"
    home: "{{ csit.test_user.home }}"
    shell: "{{ csit.test_user.shell }}"

- name: Add vagrant user to docker group
  user:
    name: "vagrant"
    groups:
      - "docker"

- name: Reload groups for current session
  command: "/usr/bin/newgrp docker"

# Disabling CSIT repo cloning in the VM as the repo is synced from the host
# - name: Clone CSIT repository
#   become_user: vagrant
#   git:
#     repo: "{{ csit.repository.url }}"
#     dest: "{{ csit.home }}"
#     accept_hostkey: true
#     version: "{{ csit.repository.version }}"

- name: Load csit docker image from local path if exists (/vagrant/csit-sut.tar)
  shell: |
    if [ -z "$(docker images -q `cat {{ csit.home }}/VPP_DEVICE_IMAGE`)" ] && [ -e /vagrant/csit-sut.tar ]; then
      docker load -i /vagrant/csit-sut.tar;
    fi;
  ignore_errors: true