Skip to content

Commit

Permalink
Updating vagrant file for compatibility with cachier, to handle file …
Browse files Browse the repository at this point in the history
…permission setting on windows boxes.
  • Loading branch information
tizzo committed May 10, 2015
1 parent d4a8659 commit 544bb0e
Showing 1 changed file with 34 additions and 8 deletions.
42 changes: 34 additions & 8 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,24 +40,50 @@ Vagrant.configure('2') do |config|
# config directive, delete it to avoid confusing users.
config.vm.provision :shell, :inline => "/bin/sed -i '/templatedir=\(.*\)/d' /etc/puppet/puppet.conf"

config.librarian_puppet.placeholder_filename = 'README'
if Vagrant.has_plugin?("vagrant-librarian-puppet")
config.librarian_puppet.placeholder_filename = 'README'
elsif not File.exist?('modules/drupal_php/manifests/init.pp')
raise Vagrant::Errors::VagrantError.new, "You are not using vagrant-librarian-puppet and have not installed the dependencies."
end

# If vagrant-cachier is installed, use it!
if Vagrant.has_plugin?("vagrant-cachier")
config.cache.scope = :box
if not is_windows
# See https://github.com/fgrehm/vagrant-cachier for details.
config.cache.synced_folder_opts = {
type: :nfs,
mount_options: ['rw', 'vers=3', 'tcp', 'nolock']
}
end
end

# NFS sharing does not work on windows, so if this is windows don't try to start it.
vagrant_share_www = "false"
if not is_windows and params['sync_folder']
config.vm.synced_folder 'www', '/var/www', :nfs => true
vagrant_share_www = "true"
elsif params['sync_file_enabled_on_windows']
# This uses VirtualBox shared folders and symlinks will not work properly.
config.vm.synced_folder 'www', '/var/www'
vagrant_share_www = "true"
end


config.vm.provision :puppet do |puppet|
puppet.module_path = [
'modules',
'custom-modules'
]
puppet.facter = {
"vagrant" => "1",
"vagrant_share_www" => vagrant_share_www
}
puppet.manifests_path = 'manifests'
puppet.manifest_file = 'base.pp'
puppet.hiera_config_path = 'hiera/hiera.yaml'
puppet.working_directory = '/vagrant'
end


# NFS sharing does not work on windows, so if this is windows don't try to start it.
if not is_windows and params['sync_folder']
config.vm.synced_folder 'www', '/var/www', :nfs => true
elsif params['sync_file_enabled_on_windows']
# This uses VirtualBox shared folders and symlinks will not work properly.
config.vm.synced_folder 'www', '/var/www'
end
end

0 comments on commit 544bb0e

Please sign in to comment.