-
Notifications
You must be signed in to change notification settings - Fork 1
/
Vagrantfile
executable file
·63 lines (55 loc) · 2.14 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
51
52
53
54
55
56
57
58
59
60
61
62
63
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.provider :virtualbox do |v, o|
o.ssh.insert_key = false
v.customize ["modifyvm", :id, "--memory", 512]
end
config.vm.define "repo-cache" do |machine|
machine.vm.network :private_network, ip: "10.64.0.2",
:netmask => "255.255.0.0"
machine.vm.hostname = "repo-cache"
config.vm.provision "ansible" do |ansible|
ansible.playbook = "playbooks/repo-cache.yml"
end
end
config.vm.define "ubuntu" do |machine|
machine.vm.network :private_network, ip: "10.64.0.3",
:netmask => "255.255.0.0"
machine.vm.hostname = "ubuntu"
machine.vm.provider :virtualbox do |v, o|
o.vm.box = "ubuntu/trusty64"
o.vm.provision "shell", inline: %(
apt-get update; apt-get --yes install avahi-daemon
sed -i.bak 's/archive\.ubuntu\.com/repo-cache.local/g' /etc/apt/sources.list)
end
end
config.vm.define "debian" do |machine|
machine.vm.network :private_network, ip: "10.64.0.4",
:netmask => "255.255.0.0"
machine.vm.hostname = "debian"
machine.vm.provider :virtualbox do |v, o|
o.vm.box = "debian/jessie64"
o.vm.provision "shell", inline: %(
apt-get update; apt-get --yes install avahi-daemon
sed -i.bak 's/httpredir.debian.org/repo-cache.local/g' /etc/apt/sources.list)
end
end
config.vm.define "centos" do |machine|
machine.vm.network :private_network, ip: "10.64.0.5",
:netmask => "255.255.0.0"
machine.vm.hostname = "centos"
machine.vm.provider :virtualbox do |v, o|
o.vm.box = "centos/7"
o.vm.provision "shell", inline: %(
rpm -Uvh --replacepkgs http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm;
yum install avahi nss-mdns -y;
sed -i.bak 's/mirror\.centos\.org/repo-cache.local/g' /etc/yum.repos.d/*.repo;
sed -i.bak 's/^mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-Base.repo;
sed -i.bak 's/^#Baseurl/Baseurl/g' /etc/yum.repos.d/CentOS-Base.repo;
service avahi-daemon start)
end
end
end