aboutsummaryrefslogtreecommitdiffstats
path: root/fdio.infra.ansible/roles/vagrant
diff options
context:
space:
mode:
Diffstat (limited to 'fdio.infra.ansible/roles/vagrant')
-rw-r--r--fdio.infra.ansible/roles/vagrant/defaults/main.yml14
-rw-r--r--fdio.infra.ansible/roles/vagrant/files/99-vppdevice.yaml28
-rw-r--r--fdio.infra.ansible/roles/vagrant/tasks/main.yml42
3 files changed, 84 insertions, 0 deletions
diff --git a/fdio.infra.ansible/roles/vagrant/defaults/main.yml b/fdio.infra.ansible/roles/vagrant/defaults/main.yml
new file mode 100644
index 0000000000..caa3339bb0
--- /dev/null
+++ b/fdio.infra.ansible/roles/vagrant/defaults/main.yml
@@ -0,0 +1,14 @@
+---
+# file: vagrant/defaults/main.yml
+
+# Settings for VPP Device host group
+csit:
+ home: "/home/vagrant/csit"
+ test_user:
+ name: "testuser"
+ password: "$6$/mAr/JDJc0u6/i$sLBptji85Xo/vdAv43bP4NpTaAfSBY8p3G7Uj9p4fKysrvs7XF8.FmlC56j4AzOun6nnf7PA.elytvfWoEHCL1"
+ home: "/home/testuser"
+ shell: "/bin/bash"
+ repository:
+ url: "https://gerrit.fd.io/r/csit"
+ version: "HEAD"
diff --git a/fdio.infra.ansible/roles/vagrant/files/99-vppdevice.yaml b/fdio.infra.ansible/roles/vagrant/files/99-vppdevice.yaml
new file mode 100644
index 0000000000..bcaa67099d
--- /dev/null
+++ b/fdio.infra.ansible/roles/vagrant/files/99-vppdevice.yaml
@@ -0,0 +1,28 @@
+network:
+ version: 2
+ renderer: networkd
+ ethernets:
+ enp0s8:
+ match:
+ macaddress: 08:00:27:0f:e0:4d
+ set-name: enpTGa
+ enp0s9:
+ match:
+ macaddress: 08:00:27:61:f7:ad
+ set-name: enpTGb
+ enp0s17:
+ match:
+ macaddress: 08:00:27:dc:5d:a4
+ set-name: enpTGc
+ enp0s10:
+ match:
+ macaddress: 08:00:27:38:5e:58
+ set-name: enpSUTa
+ enp0s16:
+ match:
+ macaddress: 08:00:27:e3:f5:42
+ set-name: enpSUTb
+ enp0s18:
+ match:
+ macaddress: 08:00:27:4f:7c:63
+ set-name: enpSUTc
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