Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Install Vagrant Boxes
#!/bin/bash
RECORDS="centos-6:bento/centos-6.7 centos-7:centos/7 debian-7:debian/wheezy64 debian-8:debian/jessie64 ubuntu-14:ubuntu/trusty64 ubuntu-16:ubuntu/xenial64"
for record in $RECORDS; do
box=$(echo $record | cut -d: -f2)
vagrant box add --provider virtualbox $box
done
mkdir ~/vagrant
cd ~/vagrant
for record in $RECORDS; do
folder=$(echo $record | cut -d: -f1)
box=$(echo $record | cut -d: -f2)
mkdir $folder
VAGRANT_FILE="$folder/Vagratfile"
echo "Vagrant.configure(\"2\") do |config|" > $VAGRANT_FILE
echo " config.vm.box = \"$box\"" >> $VAGRANT_FILE
echo "" >> $VAGRANT_FILE
echo " config.vm.network \"public_network\", bridge: \"wlan1\"" >> $VAGRANT_FILE
echo "" >> $VAGRANT_FILE
echo " config.vm.provider \"virtualbox\" do |vb|" >> $VAGRANT_FILE
echo " vb.memory = \"2048\"" >> $VAGRANT_FILE
echo " end" >> $VAGRANT_FILE
find_distro=$(echo $folder | egrep "ubuntu|debian")
if [ -n "$find_distro" ]; then
echo "" >> $VAGRANT_FILE
echo "config.vm.provision \"shell\", inline: <<-SHELL" >> $VAGRANT_FILE
echo " sudo locale-gen pt_BR.UTF-8" >> $VAGRANT_FILE
echo "SHELL" >> $VAGRANT_FILE
fi
echo "end" >> $VAGRANT_FILE
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.