Skip to content

Instantly share code, notes, and snippets.

@Tallmaris
Last active August 29, 2015 13:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tallmaris/10984414 to your computer and use it in GitHub Desktop.
Save Tallmaris/10984414 to your computer and use it in GitHub Desktop.
Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "Win7Dev2" # the name of the box, completed for you by vagrant init
# set some defaults
config.vm.guest = :windows
# this will require a restart:
config.vm.hostname = "#{ENV['USERNAME']}-Dev"
# forward RDP and WINRS ports
config.vm.network :forwarded_port, guest: 3389, host: 3377, id: "rdp", auto_correct: false
config.vm.network :forwarded_port, guest: 5985, host: 5985, id: "winrm", auto_correct: true
config.windows.set_work_network = true
config.winrm.max_tries = 10
# uncomment for a VM runnable from VBox straight away rather than remoting in
#config.vm.provider "virtualbox" do |v|
# v.gui = true
#end
# sync the folders you want (generally the SVN root)
config.vm.synced_folder "/Developments", "/developments"
# for provisioning we need:
# chocolatey:
config.vm.provision :shell, path: "Install-Chocolatey.ps1"
# ...in the path for all users:
config.vm.provision :shell, inline: '[Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\Chocolatey\bin", "Machine")'
# Puppet:
config.vm.provision :shell, path: "Install-Puppet.ps1"
# Enable remoting in, useless if you uncommented "v.gui = true" above
config.vm.provision :shell, path: "Enable-RDP.ps1"
config.vm.provision :puppet do |puppet|
puppet.facter = {
"hostuser" => ENV['USERNAME']
}
puppet.manifests_path = "manifests"
puppet.module_path = "modules"
puppet.manifest_file = "init.pp"
puppet.options = "--verbose --debug"
end
# Restart the machine having changed the hostname:
config.vm.provision :shell, inline: "Restart-Computer"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment