-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile.terraform.erb
47 lines (43 loc) · 1.48 KB
/
Vagrantfile.terraform.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# -*- mode: ruby -*-
# vi: set ft=ruby :
$script = <<SCRIPT
# Run terraform templates
#cd /vagrant && sudo terraform init
# Create a plan and save it to the local file tfplan.
#sudo terraform plan -out nginx.tfplan
# Apply the plan stored in the file tfplan.
#sudo terraform apply -auto-approve nginx.tfplan
#sudo docker ps -a
echo "terraform-sandbox up && running"
SCRIPT
Vagrant.configure(2) do |config|
config.vm.box_check_update = false
config.vm.box = "bento/ubuntu-19.10"
# config.vm.hostname = "terraformsandbox01"
# config.vm.network "private_network", ip: "192.168.45.10"
# config.vm.network "forwarded_port", guest: 80, host: 80
# vbox template for all vagranth instances
config.vm.provider "virtualbox" do |vb|
vb.gui = false
# vb.name = "terraformsandbox01"
vb.memory = "4916"
vb.cpus = 2
end
# customize vagrant instance
config.vm.define "terraformsandbox01" do |webtier|
webtier.vm.provider "virtualbox" do |vb|
vb.name = "terraformsandbox01"
end
#webtier.vm.provision "shell", inline: $script, privileged: false
webtier.vm.provision :shell, path: "provisioning/bootstrap.sh"
end
# customize vagrant instance
config.vm.define "terraformsandbox02" do |webtier|
webtier.vm.box = "bento/ubuntu-20.04"
webtier.vm.provider "virtualbox" do |vb|
vb.name = "terraformsandbox02"
end
#webtier.vm.provision "shell", inline: $script, privileged: false
webtier.vm.provision :shell, path: "provisioning/bootstrap.sh"
end
end