Advertisement
Guest User

vagrant

a guest
May 28th, 2015
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.36 KB | None | 0 0
  1. Vagrant.configure("2") do |config|
  2.  
  3. #config.vm.synced_folder ".", "/tmp/vagrant", type: "rsync"
  4. config.vm.box = 'vsphere'
  5. config.vm.box_url = 'vsphere.box'
  6. config.vm.guest = :windows
  7. config.vm.network :forwarded_port, guest: 3389, host: 3389
  8. config.vm.communicator = "winrm"
  9. config.vm.network :forwarded_port, guest: 5985, host: 5985, id: "winrm", auto_correct: true
  10. config.ssh.private_key_path = "./vagrant_rsa"
  11. config.windows.set_work_network = true
  12. config.winrm.username = 'vagrant'
  13. config.winrm.password = 'vagrant'
  14.  
  15. config.vm.provider :vsphere do |vsphere|
  16. vsphere.host = '10.10.20.31'
  17. # when a name is not specified it is generated (according to docs), this triggers an exception
  18. vsphere.name = '[C] Win7x64TestTWO'
  19. #vsphere.linked_clone = true
  20. vsphere.clone_from_vm = true
  21. vsphere.template_name = '[B] windows_7_base'
  22. vsphere.user = 'root'
  23. vsphere.password = 'password'
  24. vsphere.insecure = true
  25. end
  26. config.vm.provision :shell, :path => "setup_requirements.cmd"
  27. config.vm.provision :shell, :path => "Install-Puppet.ps1"
  28. config.vm.provision :shell, :path => "checkpath.cmd"
  29. config.vm.provision :shell, inline: '[Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\ProgramData\chocolatey\bin;C:\Program Files\Puppet Labs\Puppet\bin", "Machine")'
  30. #config.vm.provision :shell, :path => "checkpath.cmd""
  31. config.vm.provision :shell, inline: "puppet module install --force rismoney/chocolatey"
  32. config.vm.provision :puppet do |puppet|
  33. puppet.manifests_path = ""
  34. puppet.manifest_file = "base.pp"
  35. end
  36. end
  37.  
  38.  
  39. cat checkpath.cmd
  40. @echo =====================================================================================================================================================
  41. set
  42. where puppet
  43. @echo =====================================================================================================================================================
  44.  
  45.  
  46.  
  47. cat setup_requirements.cmd
  48. echo 'Ensuring .NET 4.0 is installed'
  49. @powershell -NoProfile -ExecutionPolicy Bypass -File "c:\vagrant\install_net4.ps1"
  50.  
  51. echo 'Ensuring Chocolatey is Installed'
  52. @powershell -NoProfile -ExecutionPolicy unrestricted -Command "(iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))) >$null 2>&1" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
  53.  
  54. cd
  55. set
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement