aboutsummaryrefslogtreecommitdiffstats
path: root/resources
diff options
context:
space:
mode:
authorTomas Alexy <tomas.alexy@pantheon.tech>2020-08-28 15:34:54 +0200
committerPeter Mikus <pmikus@cisco.com>2020-09-04 05:55:15 +0000
commit04df3394c9b69c22fcbdb993566e548cec58a492 (patch)
tree75e814840c0795d096f836d858f06c629dc8c3a6 /resources
parentcfc2e75640a44fcf0f70a8c9b6d95dffb9b5c9c8 (diff)
Fix local CSIT deployment
Change-Id: I6ccf3cc11b4343ebcf02f30a01eddb9204ba53ee Signed-off-by: Tomas Alexy <tomas.alexy@pantheon.tech>
Diffstat (limited to 'resources')
-rw-r--r--resources/tools/vagrant/Vagrantfile6
-rw-r--r--resources/tools/vagrant/ansible/roles/csit/defaults/main.yml1
-rw-r--r--resources/tools/vagrant/ansible/roles/csit/tasks/main.yml75
3 files changed, 53 insertions, 29 deletions
diff --git a/resources/tools/vagrant/Vagrantfile b/resources/tools/vagrant/Vagrantfile
index 3771fea7cb..1c3071931c 100644
--- a/resources/tools/vagrant/Vagrantfile
+++ b/resources/tools/vagrant/Vagrantfile
@@ -85,9 +85,9 @@ Vagrant.configure("2") do |config|
config.vm.define "centos8", autostart: false do |centos8|
# Base box definition, currently using
- # Unofficial Centos8 (as currently there is no offical build)
- centos8.vm.box = "geerlingguy/centos8"
- centos8.vm.box_version = "1.0.2"
+ # Official CentOS8 v1905.1
+ centos8.vm.box = "centos/8"
+ centos8.vm.box_version = "1905.1"
centos8.vm.box_check_update = false
# Virtualbox machine configuration
diff --git a/resources/tools/vagrant/ansible/roles/csit/defaults/main.yml b/resources/tools/vagrant/ansible/roles/csit/defaults/main.yml
index e390adb6b4..7a8999c4cb 100644
--- a/resources/tools/vagrant/ansible/roles/csit/defaults/main.yml
+++ b/resources/tools/vagrant/ansible/roles/csit/defaults/main.yml
@@ -21,6 +21,7 @@ csit_packages_by_distro:
- 'gcc'
- 'gcc-c++'
- 'gdb'
+ - 'git'
- 'glibc-devel'
- 'libpcap-devel'
- 'libtool'
diff --git a/resources/tools/vagrant/ansible/roles/csit/tasks/main.yml b/resources/tools/vagrant/ansible/roles/csit/tasks/main.yml
index 64a4872777..6f226fd54d 100644
--- a/resources/tools/vagrant/ansible/roles/csit/tasks/main.yml
+++ b/resources/tools/vagrant/ansible/roles/csit/tasks/main.yml
@@ -1,30 +1,63 @@
---
# file: csit/tasks/main.yml
-# TODO: Temporarily disabling due to Centos8 not having netplan.
-# Finding better solution via udev requires some work and testing.
-#- name: Upload config to rename network interfaces
-# copy:
-# src: 'files/99-vppdevice.yaml'
-# dest: '/etc/netplan/99-vppdevice.yaml'
-# owner: 'root'
-# group: 'root'
-# mode: 0644
-#- name: Apply network config changes
-# command: '/usr/sbin/netplan apply'
-
-- name: Centos8 install epel repositories
+# CentOS 8 specific
+- name: CentOS - Install epel repositories
dnf:
name:
- 'epel-release'
when:
- ansible_distribution|lower == 'centos'
-- name: Centos8 enable epel repositories
- command: 'dnf config-manager --set-enabled PowerTools'
+- name: CentOS - Enable PowerTools
+ command: >
+ dnf config-manager
+ --set-enabled PowerTools
when:
- ansible_distribution|lower == 'centos'
+# NOTE: containerd.io >1.2.0-3 requirement disabled by RH
+# Unable to install current docker version as of now
+# Using docker-ce-3:18.09.1-3.el7
+- name: CentOS - Add docker-ce repo
+ command: >
+ dnf config-manager
+ --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
+ when:
+ - ansible_distribution|lower == 'centos'
+
+- name: CentOS - Install docker-ce
+ dnf:
+ name:
+ - 'docker-ce-3:18.09.1-3.el7'
+ when:
+ - ansible_distribution|lower == 'centos'
+
+# Ubuntu specific
+- name: Ubuntu - Add docker-ce GPG key
+ apt_key:
+ url: 'https://download.docker.com/linux/ubuntu/gpg'
+ when:
+ - ansible_distribution|lower == 'ubuntu'
+
+- name: Ubuntu - Add docker-ce repo
+ apt_repository:
+ repo: 'deb https://download.docker.com/linux/ubuntu {{ ansible_distribution_release }} stable'
+ filename: 'docker'
+ mode: 644
+ when:
+ - ansible_distribution|lower == 'ubuntu'
+
+- name: Ubuntu - Install docker-ce
+ apt:
+ name:
+ - 'docker-ce'
+ - 'containerd.io'
+ - 'docker-ce-cli'
+ when:
+ - ansible_distribution|lower == 'ubuntu'
+
+# General
- name: Install required system tools and packages
package:
name: "{{ csit_packages | join(',') }}"
@@ -39,11 +72,6 @@
sysctl_file: '/etc/sysctl.d/90-csit.conf'
reload: 'yes'
-- name: Install docker-ce
- command: |
- curl -fsSL https://get.docker.com -o get-docker.sh &&
- sudo sh get-docker.sh
-
- name: "Add user for running tests: {{ csit.test_user.name }}"
user:
name: '{{ csit.test_user.name }}'
@@ -56,6 +84,7 @@
path: '/etc/sudoers.d/{{ csit.test_user.name }}'
line: '{{ csit.test_user.name }} ALL=(ALL) NOPASSWD:ALL'
create: 'yes'
+ mode: 660
- name: Add vagrant user to docker group
user:
@@ -91,12 +120,6 @@
accept_hostkey: yes
version: '{{ csit.repository.version }}'
-- name: Install and update pip and virtualenv
- pip:
- name:
- - 'virtualenv'
- state: 'latest'
-
- name: Prepare python virtual environmant for CSIT
become_user: vagrant
command: '/usr/bin/virtualenv --python=/usr/bin/python3 {{ csit.home }}/env'