-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathVagrantfile
More file actions
65 lines (58 loc) · 2.01 KB
/
Vagrantfile
File metadata and controls
65 lines (58 loc) · 2.01 KB
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
64
65
Vagrant.require_version '!= 1.8.5' # OpenBSD can't be halted in 1.8.5
Vagrant.configure('2') do |config|
# don't mess with keys
config.ssh.insert_key = false
# doesn't make sense to check updates for local boxes
config.vm.box_check_update = false
# there are no guest additions
config.vm.provider 'virtualbox' do |vb|
vb.check_guest_additions = false
vb.customize ['modifyvm', :id, '--groups', '/image_optim']
end
# handle manually using rsync
config.vm.synced_folder '.', '/vagrant', disabled: true
{
'linux-x86_64' => 'boxes/centos-amd64.box',
'linux-i686' => 'boxes/centos-i386.box',
'freebsd-amd64' => 'boxes/freebsd-amd64.box',
'freebsd-i386' => 'boxes/freebsd-i386.box',
'openbsd-amd64' => 'boxes/openbsd-amd64.box',
'openbsd-i386' => 'boxes/openbsd-i386.box',
}.each do |name, location|
config.vm.define name do |machine|
machine.vm.hostname = name.gsub('_', '-')
machine.vm.box = location
machine.vm.provision :shell, inline: case name
when /^linux/
<<-SH
set -ex
if command -v apt-get; then
apt-get update
apt-get -y install rsync ntpdate make wget gcc g++ chrpath perl pkg-config autoconf automake libtool nasm
else
yum -y install rsync ntpdate make wget gcc gcc-c++ chrpath perl pkg-config autoconf automake libtool nasm
fi
SH
when /^freebsd/
<<-SH
set -ex
pkg install -y rsync gmake wget gcc chrpath perl5 pkgconf autoconf automake libtool nasm
SH
when /^openbsd/
<<-SH
set -ex
pkg_add -z rsync-- ntp gmake gtar-- wget g++-4.8.2p2 autoconf-2.69 automake-1.14.1 libtool nasm
path=/home/vagrant/shared
mkdir -p $path
chown vagrant:vagrant $path
ln -nfs $path /vagrant
SH
end
machine.vm.provision :shell, inline: <<-SH
set -ex
mkdir -p /vagrant
chown vagrant:vagrant /vagrant
SH
end
end
end