From f33ecc1091ebcc00ebfc0434ad883122a70423a7 Mon Sep 17 00:00:00 2001 From: Ganesh Maharaj Mahalingam Date: Mon, 28 Jan 2019 21:42:16 -0800 Subject: [PATCH] Switch vagrant boxes Switching boxes to the one maintained by Antonio at https://github.com/AntonioMeireles/ClearLinux-packer. They now support libvirt and will eventually be part of the clearlinux tree. Signed-off-by: Ganesh Maharaj Mahalingam --- clr-k8s-examples/Vagrantfile | 6 ++---- clr-k8s-examples/setup_system.sh | 4 ++++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/clr-k8s-examples/Vagrantfile b/clr-k8s-examples/Vagrantfile index e24bd7d..e7b8ab4 100644 --- a/clr-k8s-examples/Vagrantfile +++ b/clr-k8s-examples/Vagrantfile @@ -11,7 +11,7 @@ $cpus = (ENV['CPUS'] || 2).to_i $memory = (ENV['MEMORY'] || 4096).to_i $disks = 2 $disk_size = "10G" -$box = "gmmaha/clearlinux" +$box = "AntonioMeireles/ClearLinux" $loader = File.join(File.dirname(__FILE__), "OVMF.fd") $vm_name_prefix = "clr" base_ip = IPAddr.new("192.52.100.10") @@ -45,7 +45,7 @@ Vagrant.configure("2") do |config| # Mount the current dir at home folder instead of default config.vm.synced_folder './', '/vagrant', disabled: true - config.vm.synced_folder './', '/home/vagrant/' + File.basename(Dir.getwd), type: 'rsync' + config.vm.synced_folder './', '/home/clear/' + File.basename(Dir.getwd), type: 'rsync' #Setup proxies for all machines (1..$num_instances).each do |i| base_ip = base_ip.succ @@ -75,8 +75,6 @@ Vagrant.configure("2") do |config| c.proxy.https = (ENV['https_proxy']||ENV['HTTPS_PROXY']) c.proxy.no_proxy = (ENV['no_proxy']+"#{proxy_ip_list}" || ENV['NO_PROXY']+"#{proxy_ip_list}" || "localhost,127.0.0.1,172.16.10.10#{proxy_ip_list}") end - # Bad hack for the vagrant libvirt boxes. WIll be removed once they are fixed. - c.vm.provision "shell", privileged: false, inline: "sudo usermod --password vagrant root" c.vm.provision "shell", privileged: false, path: "setup_system.sh" c.vm.provision "shell", privileged: false, path: "setup_kata_firecracker.sh" # Include shells bundle to get bash completion and add kubectl's commands to vagrant's shell diff --git a/clr-k8s-examples/setup_system.sh b/clr-k8s-examples/setup_system.sh index a77cd30..79c5451 100755 --- a/clr-k8s-examples/setup_system.sh +++ b/clr-k8s-examples/setup_system.sh @@ -33,6 +33,10 @@ vhost_vsock overlay EOT +# Make sure /etc/hosts file exists +if [ ! -f /etc/hosts ]; then + sudo touch /etc/hosts +fi hostcount=$(grep '127.0.0.1 localhost' /etc/hosts | wc -l) if [ "$hostcount" == "0" ]; then echo "127.0.0.1 localhost $(hostname)" | sudo bash -c "cat >> /etc/hosts"