aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorPawel Wieczorek <p.wieczorek2@samsung.com>2019-07-26 13:58:02 +0200
committerPawel Wieczorek <p.wieczorek2@samsung.com>2019-07-26 13:58:07 +0200
commit5ee92067ff6bcf970a0418b235ca3daa6247ff05 (patch)
treea987265fe34b2a07951b3f7947f5d7f8b3ae8445 /test
parent9cf6f59f7a8993b1dd9402d6e96d863196b29b0a (diff)
k8s: Remove repetition from provisioning scripts
Issue-ID: SECCOM-235 Change-Id: If286ba074ee74c43705197a30c50322d5162e6fc Signed-off-by: Pawel Wieczorek <p.wieczorek2@samsung.com>
Diffstat (limited to 'test')
-rw-r--r--test/security/k8s/vagrant/dublin/Vagrantfile9
1 files changed, 7 insertions, 2 deletions
diff --git a/test/security/k8s/vagrant/dublin/Vagrantfile b/test/security/k8s/vagrant/dublin/Vagrantfile
index d91a8228c..36f433f18 100644
--- a/test/security/k8s/vagrant/dublin/Vagrantfile
+++ b/test/security/k8s/vagrant/dublin/Vagrantfile
@@ -18,6 +18,11 @@ cluster = [
all = cluster.dup << operation
+$add_to_docker_group = <<-SCRIPT
+ USER="$1"
+ usermod -aG docker "$USER"
+SCRIPT
+
$deploy_key = <<-SCRIPT
KEY="$1"
USER="$2"
@@ -59,12 +64,12 @@ Vagrant.configure('2') do |config|
if machine[:name] == 'control'
config.vm.provision :shell, path: "../../tools/dublin/imported/openstack-k8s-controlnode.sh"
- config.vm.provision :shell, inline: "usermod -aG docker vagrant" # script above adds "ubuntu" user only
+ config.vm.provision :shell, inline: $add_to_docker_group, args: vagrant_user
end
if machine[:name] == 'worker'
config.vm.provision :shell, path: "../../tools/dublin/imported/openstack-k8s-workernode.sh"
- config.vm.provision :shell, inline: "usermod -aG docker vagrant" # script above adds "ubuntu" user only
+ config.vm.provision :shell, inline: $add_to_docker_group, args: vagrant_user
end
if machine[:name] == 'operator'