2017-05-15 18:56:41 +00:00
|
|
|
# -*- mode: ruby -*-
|
|
|
|
# vi: set ft=ruby :
|
|
|
|
|
|
|
|
Vagrant.configure(2) do |config|
|
|
|
|
|
2020-06-17 10:22:24 +00:00
|
|
|
config.vm.box = "ubuntu/bionic64"
|
2017-05-15 18:56:41 +00:00
|
|
|
config.vm.provision "shell", inline: <<-SHELL
|
|
|
|
|
|
|
|
cd /tmp
|
|
|
|
|
2017-11-17 20:22:21 +00:00
|
|
|
PACKERVERSION=1.1.2
|
2017-05-15 18:56:41 +00:00
|
|
|
PACKERDOWNLOAD=https://releases.hashicorp.com/packer/${PACKERVERSION}/packer_${PACKERVERSION}_linux_amd64.zip
|
2017-11-17 22:26:27 +00:00
|
|
|
TERRAFORMVERSION=0.11.0
|
2017-05-15 18:56:41 +00:00
|
|
|
TERRAFORMDOWNLOAD=https://releases.hashicorp.com/terraform/${TERRAFORMVERSION}/terraform_${TERRAFORMVERSION}_linux_amd64.zip
|
|
|
|
|
|
|
|
echo "Dependencies..."
|
2020-06-17 10:22:24 +00:00
|
|
|
sudo apt-get install -y \
|
|
|
|
apt-transport-https \
|
|
|
|
ca-certificates \
|
|
|
|
curl \
|
|
|
|
gnupg \
|
|
|
|
gnupg-agent \
|
|
|
|
lsb-release \
|
|
|
|
software-properties-common \
|
|
|
|
unzip
|
2017-05-15 18:56:41 +00:00
|
|
|
|
2017-11-15 19:31:46 +00:00
|
|
|
# Azure CLI
|
2020-06-17 10:22:24 +00:00
|
|
|
curl -sL https://packages.microsoft.com/keys/microsoft.asc |
|
|
|
|
gpg --dearmor |
|
|
|
|
sudo tee /etc/apt/trusted.gpg.d/microsoft.asc.gpg > /dev/null
|
|
|
|
AZ_REPO=$(lsb_release -cs)
|
|
|
|
echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $AZ_REPO main" |
|
|
|
|
sudo tee /etc/apt/sources.list.d/azure-cli.list
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install azure-cli
|
2017-11-15 19:31:46 +00:00
|
|
|
|
2017-05-15 18:56:41 +00:00
|
|
|
# Disable the firewall
|
|
|
|
sudo ufw disable
|
|
|
|
|
|
|
|
## Packer
|
|
|
|
echo Fetching Packer...
|
2020-06-17 10:22:24 +00:00
|
|
|
curl -s -L $PACKERDOWNLOAD > packer.zip
|
2017-05-15 18:56:41 +00:00
|
|
|
echo Installing Packer...
|
|
|
|
unzip packer.zip -d /usr/local/bin
|
|
|
|
chmod 0755 /usr/local/bin/packer
|
|
|
|
chown root:root /usr/local/bin/packer
|
|
|
|
|
|
|
|
## Terraform
|
|
|
|
echo Fetching Terraform...
|
2020-06-17 10:22:24 +00:00
|
|
|
curl -s -L $TERRAFORMDOWNLOAD > terraform.zip
|
2017-05-15 18:56:41 +00:00
|
|
|
echo Installing Terraform...
|
|
|
|
unzip terraform.zip -d /usr/local/bin
|
|
|
|
chmod 0755 /usr/local/bin/terraform
|
|
|
|
chown root:root /usr/local/bin/terraform
|
|
|
|
|
2020-06-17 10:22:24 +00:00
|
|
|
# Download and install Docker.
|
|
|
|
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
|
|
|
|
add-apt-repository \
|
|
|
|
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
|
|
|
|
$(lsb_release -cs) \
|
|
|
|
stable"
|
|
|
|
apt-get update
|
|
|
|
apt-get install -y \
|
|
|
|
docker-ce \
|
|
|
|
docker-ce-cli \
|
|
|
|
containerd.io
|
|
|
|
usermod -aG docker vagrant
|
2017-05-15 18:56:41 +00:00
|
|
|
|
|
|
|
SHELL
|
|
|
|
|
2017-11-15 19:31:46 +00:00
|
|
|
config.vm.synced_folder "aws/", "/home/vagrant/aws", owner: "vagrant", group: "vagrant"
|
|
|
|
config.vm.synced_folder "azure/", "/home/vagrant/azure", owner: "vagrant", group: "vagrant"
|
|
|
|
config.vm.synced_folder "shared/", "/home/vagrant/shared", owner: "vagrant", group: "vagrant"
|
|
|
|
config.vm.synced_folder "examples/", "/home/vagrant/examples", owner: "vagrant", group: "vagrant"
|
2017-05-15 18:56:41 +00:00
|
|
|
|
2017-06-24 23:24:24 +00:00
|
|
|
config.vm.provider "virtualbox" do |vb|
|
|
|
|
vb.memory = "2048"
|
|
|
|
vb.cpus = 2
|
|
|
|
end
|
2017-05-15 18:56:41 +00:00
|
|
|
|
|
|
|
end
|