From 5ee92067ff6bcf970a0418b235ca3daa6247ff05 Mon Sep 17 00:00:00 2001 From: Pawel Wieczorek Date: Fri, 26 Jul 2019 13:58:02 +0200 Subject: k8s: Remove repetition from provisioning scripts Issue-ID: SECCOM-235 Change-Id: If286ba074ee74c43705197a30c50322d5162e6fc Signed-off-by: Pawel Wieczorek --- test/security/k8s/vagrant/dublin/Vagrantfile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'test/security/k8s') 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' -- cgit 1.2.3-korg