-
Notifications
You must be signed in to change notification settings - Fork 1
/
Vagrantfile
33 lines (27 loc) · 925 Bytes
/
Vagrantfile
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
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANT_DISABLE_VBOXSYMLINKCREATE=1
vms = {
'gcloud-client' => {'memory' => '1024', 'cpus' => 1, 'ip' => '200', 'box' => 'devopsbox/ubuntu-20.04', 'provision' => 'provision/ansible/gcloud-client.yaml'},
}
Vagrant.configure('2') do |config|
config.vm.box_check_update = false
if !(File.exists?('id_rsa'))
system("ssh-keygen -b 2048 -t rsa -f id_rsa -q -N ''")
end
vms.each do |name, conf|
config.vm.define "#{name}" do |k|
k.vm.box = "#{conf['box']}"
k.vm.hostname = "#{name}"
k.vm.network 'private_network', ip: "172.16.0.#{conf['ip']}"
k.vm.provider 'virtualbox' do |vb|
vb.memory = conf['memory']
vb.cpus = conf['cpus']
end
k.vm.provision 'ansible_local' do |ansible|
ansible.playbook = "#{conf['provision']}"
ansible.compatibility_mode = '2.0'
end
end
end
end