  # -*- mode: ruby -*-
  # vi: set ft=ruby :

  VAGRANTFILE_API_VERSION = "2"

  Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "trusty32"
  config.vm.box_url = "https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-i386-vagrant-disk1.box"

  config.vm.hostname = "training.plone.org"
  config.vm.network :forwarded_port, guest: 8080, host: 8080

  # Allow the creation of symbolic links in the shared folder.
  # This is needed for some builds with cmmi and for omelette to work.
  # 'v-root' is the default-name for the primary volume.
  config.vm.provider :virtualbox do |vb|
    vb.customize  ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-root", "1"]
    vb.customize  ["modifyvm", :id, "--natdnshostresolver1", "on"]
    vb.customize  ["modifyvm", :id, "--natdnsproxy1", "on"]
  end

  # A workaround for missing symbolic links on windows:
  # config.vm.synced_folder "eggs/", "/home/vagrant/buildout-cache/eggs/"


  # Run apt-get update as a separate step in order to avoid
  # package install errors
  config.vm.provision :puppet do |puppet|
      puppet.manifests_path = "manifests"
      puppet.manifest_file  = "aptgetupdate.pp"
  end

  # ensure we have the packages we need
  config.vm.provision :puppet do |puppet|
      puppet.manifests_path = "manifests"
      puppet.manifest_file  = "packages.pp"
  end

  # Create a Putty-style keyfile for Windows users
  config.vm.provision :shell do |shell|
      shell.path = "manifests/host_setup.sh"
      shell.args = RUBY_PLATFORM
  end

  # install plone
  config.vm.provision :puppet do |puppet|
      puppet.manifests_path = "manifests"
      puppet.manifest_file  = "plone.pp"
  end


end
