-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile
50 lines (47 loc) · 1.75 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# -*- mode: ruby -*-
# vi: set ft=ruby :
file_to_disk = './tmp/large_disk.vdi'
Vagrant.configure(2) do |config|
#config.vm.box = "http://www.tvollmer.de/xenial_with_LVM_extra_space.box"
#config.vm.box = "~/xenial_with_LVM_extra_space.box"
config.vm.box = "gbarbieru/xenial"
# Configuration deployment
config.vm.provision "preinstall", type: "shell", inline: "sudo apt-get -y install facter python"
config.vm.provision "ansible" do |ansible|
ansible.groups = {
"hypervisor" => ["visor"],
"monitoring" => ["monitor"],
"guest" => ["srv"],
"mailserver" => ["srv"],
"router" => ["rt2"]
}
ansible.playbook = "all.yml"
ansible.raw_arguments = [
"--vault-password-file=./password.txt",
"-b",
"--become-user=root"
]
end
config.vm.define 'visor' do |visor|
visor.vm.hostname = "visor.foto23.com"
visor.vm.network "private_network", ip: "192.168.33.10"
end
config.vm.define 'srv' do |srv|
srv.vm.hostname = "srv.foto23.com"
srv.vm.network "private_network", ip: "192.168.33.11"
end
config.vm.define 'rt2' do |rt2|
rt2.vm.hostname = "rt2.buero.tvollmer.de"
rt2.vm.network "private_network", ip: "192.168.33.12"
rt2.vm.provider "virtualbox" do |vb|
unless File.exist?(file_to_disk)
vb.customize ['createhd', '--filename', file_to_disk, '--variant', 'Fixed', '--size', 20 * 1024]
end
vb.customize ['storageattach', :id, '--storagectl', 'SATA', '--port', 1, '--device', 0, '--type', 'hdd', '--medium', file_to_disk]
end
rt2.vm.provision "preinstall",
type: "shell",
preserve_order: true,
inline: "sudo apt-get -y install facter python lvm2; pvdisplay /dev/sdb || ( pvcreate /dev/sdb; vgcreate default /dev/sdb )"
end
end