This repository has been archived by the owner on Jan 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Vagrantfile
56 lines (49 loc) · 1.87 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
unless Vagrant.has_plugin?('vagrant-berkshelf')
puts "Please install vagrant plugin vagrant-berkshelfs first\n"
puts " vagrant plugin install vagrant-berkshelf\n\n"
puts "Exit vagrant\n\n"
abort
end
Vagrant.require_version '~> 2.0.0'
chef_version = '12.9.41'
Vagrant.configure(2) do |config|
domain = 'dkdeploy-php.dev'
domain_second = 'second-dkdeploy-php.dev'
ip_address = '192.168.156.181'
config.vm.box = 'ubuntu/trusty64'
config.vm.box_check_update = false
config.berkshelf.enabled = true
config.vm.define('dkdeploy-php', primary: true) do |master_config|
master_config.vm.network 'private_network', ip: ip_address
# Chef settings
master_config.vm.provision :chef_solo do |chef|
chef.version = chef_version
chef.install = true
chef.channel = 'stable'
chef.log_level = :info
chef.add_recipe 'dkdeploy-php'
chef.json = {}
end
# Memory limit and name of VirtualBox
master_config.vm.provider 'virtualbox' do |virtualbox|
virtualbox.name = domain
virtualbox.gui = ENV['ENABLE_GUI_MODE'] && (ENV['ENABLE_GUI_MODE'] =~ /^(true|yes|y|1)$/i ? true : false)
virtualbox.customize [
'modifyvm', :id,
'--natdnsproxy1', 'off',
'--natdnshostresolver1', 'on',
'--memory', '1024',
'--name', 'dkdeploy-php'
]
end
end
if Vagrant.has_plugin?('landrush')
config.landrush.enabled = true
config.landrush.guest_redirect_dns = false
config.landrush.tld = 'dev'
config.landrush.host domain, ip_address
config.landrush.host domain_second, ip_address
else
config.vm.post_up_message = "Either install Vagrant plugin 'landrush' or add this entry to your host file: #{ip_address} #{domain} #{domain_second}"
end
end