-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
59 lines (48 loc) · 1.42 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
require 'yaml'
# Check for missing plugins
required_plugins = %w(vagrant-triggers vagrant-bindfs)
plugin_installed = false
required_plugins.each do |plugin|
unless Vagrant.has_plugin?(plugin)
system "vagrant plugin install #{plugin}"
plugin_installed = true
end
end
# If new plugins installed, restart Vagrant process
if plugin_installed === true
exec "vagrant #{ARGV.join' '}"
end
settings = YAML.load_file 'settings.yaml'
# Configurable variables
image = settings['image']
ip_address = settings['ip_address']
hostname = settings['hostname']
vbname = settings['vbname']
vbmem = settings['vbmem']
vbcpu = settings['vbcpu']
user = settings['user']
# Main vagrant configuration
Vagrant.configure(2) do |config|
config.vm.box = image
config.vm.network 'private_network', ip: ip_address
config.vm.hostname = hostname
# Virtualbox name and assigned resources
config.vm.provider 'virtualbox' do |vb|
vb.name = vbname
vb.memory = vbmem
vb.cpus = vbcpu
end
config.vm.synced_folder 'C:\code', '/code'
config.vm.synced_folder 'C:\pd', '/pd'
# Puppet configuration
config.vm.provision 'puppet' do |puppet|
puppet.manifests_path = 'puppet'
puppet.manifest_file = 'site.pp'
puppet.module_path = [ 'puppet/modules' ]
puppet.hiera_config_path = 'puppet/hiera.yaml'
puppet.working_directory = '/vagrant'
#puppet.options = '--debug'
end
end