forked from Jahaja/psdash
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile
64 lines (56 loc) · 1.76 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
64
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
boxes = [
{
:name => "ubuntu-1204",
:box => "opscode-ubuntu-12.04",
:url => "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-12.04_chef-provisionerless.box",
:cpu => "50",
:ram => "256",
:ip => '10.0.1.10'
},
{
:name => "debian-720",
:box => "opscode-debian-7.2.0",
:url => "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_debian_7.2.0_chef-provisionerless.box",
:cpu => "50",
:ram => "256",
:ip => '10.0.1.11'
},
{
:name => "centos-6.5",
:box => "chef/centos-6.5",
:url => "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-6.5_chef-provisionerless.box",
:cpu => "50",
:ram => "256",
:ip => '10.0.1.12'
}
]
# let's use one box at a time, defaulting to CentOS 6.5
box = boxes[2]
require 'rbconfig'
include RbConfig
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.define box[:name] do |config|
config.vm.box = box[:box]
config.vm.box_url = box[:url]
config.vm.hostname = "%s" % box[:name]
config.vm.provider "virtualbox" do |v|
v.customize ["modifyvm", :id, "--cpuexecutioncap", box[:cpu]]
v.customize ["modifyvm", :id, "--memory", box[:ram]]
end
config.vm.network :private_network, ip: box[:ip]
case CONFIG['host_os']
when /mswin|windows|mingw32/i
config.vm.provision "shell", path: "vagrant.sh"
else
config.vm.provision :ansible do |ansible|
ansible.playbook = "psdash.yml"
ansible.limit = "%s" % box[:name]
# ansible.verbose = "vvvv"
ansible.host_key_checking = false
end
end
end
end