-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVagrantfile
More file actions
26 lines (23 loc) · 876 Bytes
/
Vagrantfile
File metadata and controls
26 lines (23 loc) · 876 Bytes
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
# -*- mode: ruby -*-
# vi: set ft=ruby :
machines = {
"ansible-server" => {"memory" => "2048", "cpu" => "2", "ip" => "100", "image" => "ubuntu/bionic64"},
"db-server" => {"memory" => "1024", "cpu" => "2", "ip" => "120", "image" => "ubuntu/bionic64"},
}
Vagrant.configure("2") do |config|
machines.each do |name, conf|
config.vm.define "#{name}" do |machine|
machine.vm.box = "#{conf["image"]}"
machine.ssh.username = "vagrant"
machine.vm.hostname = "#{name}.ansible-example"
machine.vm.network "private_network", ip: "10.20.20.#{conf["ip"]}"
machine.vm.provider "virtualbox" do |vb|
vb.name = "#{name}"
vb.memory = conf["memory"]
vb.cpus = conf["cpu"]
vb.customize ["modifyvm", :id, "--groups", "/ANSIBLE-EXP"]
end
machine.vm.provision "shell", path: "provision.sh"
end
end
end