diff options
Diffstat (limited to 'fdio.infra.ansible/roles/vagrant/tasks')
-rw-r--r-- | fdio.infra.ansible/roles/vagrant/tasks/main.yml | 42 |
1 files changed, 42 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..fa4ab4af9a --- /dev/null +++ b/fdio.infra.ansible/roles/vagrant/tasks/main.yml @@ -0,0 +1,42 @@ +--- +# 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: yes + +- 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" + +- name: Clone CSIT repository + become_user: vagrant + git: + repo: "{{ csit.repository.url }}" + dest: "{{ csit.home }}" + accept_hostkey: yes + version: "{{ csit.repository.version }}" + +- name: Load csit docker image from local drive if it 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: yes |