diff options
author | pmikus <pmikus@cisco.com> | 2021-04-09 07:04:27 +0000 |
---|---|---|
committer | Peter Mikus <pmikus@cisco.com> | 2021-04-21 12:55:28 +0000 |
commit | c6103c8482d1acbc0d1c3bc71ad0de8903b73a3c (patch) | |
tree | 134113578b7286894972e1f824f3ee50e38d5f8a /fdio.infra.ansible/roles/vagrant/tasks | |
parent | 1e5030b987404fb1cf1dfabe31a150092ff84a3d (diff) |
Infra: Vagrant upgrade to focal
+ Upgradfe to focal
+ Move to better place
+ Integrate with ansible library
Signed-off-by: pmikus <pmikus@cisco.com>
Change-Id: Ibddea33efa2c3587251f9f03921282fb47ffee31
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 |