Last active
July 28, 2022 03:35
-
-
Save shinitiandrei/138e34a5123391328a8cd37549fb4c1f to your computer and use it in GitHub Desktop.
Default Vagrant for a Developer's box
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure("2") do |config| | |
config.vm.box = "boxcutter/ubuntu1804-desktop" | |
config.vm.box_version = "17.0907.1" | |
config.disksize.size = '15GB' | |
config.vm.provider "virtualbox" do |vb| | |
vb.name = "base_box_development" | |
vb.gui = true | |
vb.cpus = 2 | |
vb.memory = "4096" | |
vb.customize ["modifyvm", :id, "--vram", "128"] | |
vb.customize ["modifyvm", :id, "--accelerate3d", "on"] | |
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] | |
vb.customize ["modifyvm", :id, "--natdnsproxy1", "on"] | |
end | |
$script = <<-SCRIPT | |
sudo apt-get update | |
sudo apt-get upgrade -y | |
# source ~/.rvm/scripts/rvm | |
# echo "source ~/.rvm/scripts/rvm" >> ~/.zshrc | |
# rvm install 2.4 | |
cd /tmp | |
mkdir /github /opt/terraform | |
# sudo add-apt-repository ppa:webupd8team/atom | |
# sudo add-apt-repository ppa:gophers/archive | |
sudo apt-get update | |
sudo apt-get install -y git megatools python3-pip npm | |
# sudo gem install bundler | |
# sudo gem install knife-block | |
pip install awscli saws s3cmd | |
# apm install language-terraform linter language-powershell intentions busy-signal tree-view-git-status | |
# wget https://packages.chef.io/files/stable/chefdk/2.3.4/ubuntu/16.04/chefdk_2.3.4-1_amd64.deb | |
# wget https://releases.hashicorp.com/terraform/0.10.7/terraform_0.10.7_linux_amd64.zip | |
# curl -sL https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh -o install_nvm.sh | |
# bash install_nvm.sh | |
source ~/.profile | |
# nvm install #{NPM_VERSION} | |
# nvm use #{NPM_VERSION} | |
# npm install serverless -g | |
# sudo unzip /tmp/terraform_0.10.7_linux_amd64.zip -d /opt/terraform/ | |
# sudo dpkg -i chefdk_2.3.4-1_amd64.deb | |
# git config credential.helper store | |
# git config --global push.default simple | |
# git config --global user.name "USERNAME" | |
# git config --global user.email "$1" | |
# git config --global user.password "$2" | |
# ssh-keygen -t rsa -b 2048 -f ~/.ssh/id_rsa | |
# cat ~/.ssh/id_rsa.pub | |
# printf "$3\n$4\n$5\n" | aws configure | |
# sudo chown -R vagrant:vagrant /github | |
# sudo rm /tmp/terraform_0.10.7_linux_amd64.zip /tmp/install_nvm.sh /tmp/chefdk_2.3.4-1_amd64.deb | |
SCRIPT | |
$bash_profile = <<-SCRIPT | |
export TERRAFORM=/opt/terraform\n | |
export PATH=$TERRAFORM:$PATH\n | |
# export GOPATH=/usr/lib/go-1.9/bin\n | |
export TF_LOG=1\n | |
alias github="cd /github"\n | |
export TF_LOG=info\n | |
export TF_LOG_PATH=/github/terraform.log\n | |
export EDITOR=vim' >> ~/.profile | |
source ~/.profile | |
SCRIPT | |
config.vm.provision "shell" do |s| | |
s.privileged = false | |
s.inline = "#$script \n #$bash_profile" | |
# s.args = "#{ENV['GITHUB_EMAIL']} #{ENV['GITHUB_PASSWORD']} #{ENV['AWS_ACCESS_KEY_ID']} #{ENV['AWS_SECRET_ACCESS_KEY']} #{ENV['AWS_REGION']}" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just before executing this file, please run:
vagrant plugin install vagrant-disksize
Also provide the Environment Variables described at "s.args" in your machine.