diff options
Diffstat (limited to 'fdio.infra.ansible/roles/vagrant/tasks/main.yml')
-rw-r--r-- | fdio.infra.ansible/roles/vagrant/tasks/main.yml | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/fdio.infra.ansible/roles/vagrant/tasks/main.yml b/fdio.infra.ansible/roles/vagrant/tasks/main.yml new file mode 100644 index 0000000000..1716ebe0d5 --- /dev/null +++ b/fdio.infra.ansible/roles/vagrant/tasks/main.yml @@ -0,0 +1,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 |