-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathVagrantfile
More file actions
52 lines (35 loc) · 1.55 KB
/
Copy pathVagrantfile
File metadata and controls
52 lines (35 loc) · 1.55 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
Vagrant.configure("2") do |config|
# Set up some box defaults. We're going to use the Puppet Labs
# CentOS 6.5 x86_64 base box, and give it 1GB RAM
config.vm.box = 'puppetlabs/centos-6.6-64-puppet'
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--memory", "1024"]
end
config.vm.provider 'vmware_fusion' do |v,override|
v.vmx["memsize"] = "1024"
end
# Private networking lets us reach this box on its own address.
# The network will not be accessible outside of this machine.
config.vm.network :private_network, ip: "10.8.8.10"
# Set up some Puppet "facts". These will be available to the
# puppet manifests when they run.
puppet_facts = {
"vagrant" => "1",
"roles" => [ 'webserver', 'database' ]
}
# Some magic to make sure we use a local package mirror if one is
# available - so that demoing doesn't require a network connection
# that works properly.
if File.exists?( File.join( ENV['HOME'], 'mirror', 'CentOS', '6' ) )
config.vm.synced_folder "#{ENV['HOME']}/mirror", "/mirror"
puppet_facts["has_local_package_mirror"] = "1"
end
# Provide a symlink to relocated facter
config.vm.provision "shell", inline: "ln -s /opt/puppetlabs/facter /etc/puppetlabs/facter"
# Provision the Vagrant box using Puppet.
config.vm.provision "puppet" do |puppet|
puppet.environment_path = "puppet/environments"
puppet.environment = "vagrant"
puppet.facter = puppet_facts
end
end