Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Vagrant.configure("2") do |config|
- #config.vm.synced_folder ".", "/tmp/vagrant", type: "rsync"
- config.vm.box = 'vsphere'
- config.vm.box_url = 'vsphere.box'
- config.vm.guest = :windows
- config.vm.network :forwarded_port, guest: 3389, host: 3389
- config.vm.communicator = "winrm"
- config.vm.network :forwarded_port, guest: 5985, host: 5985, id: "winrm", auto_correct: true
- config.ssh.private_key_path = "./vagrant_rsa"
- config.windows.set_work_network = true
- config.winrm.username = 'vagrant'
- config.winrm.password = 'vagrant'
- config.vm.provider :vsphere do |vsphere|
- vsphere.host = '10.10.20.31'
- # when a name is not specified it is generated (according to docs), this triggers an exception
- vsphere.name = '[C] Win7x64TestTWO'
- #vsphere.linked_clone = true
- vsphere.clone_from_vm = true
- vsphere.template_name = '[B] windows_7_base'
- vsphere.user = 'root'
- vsphere.password = 'password'
- vsphere.insecure = true
- end
- config.vm.provision :shell, :path => "setup_requirements.cmd"
- config.vm.provision :shell, :path => "Install-Puppet.ps1"
- config.vm.provision :shell, :path => "checkpath.cmd"
- config.vm.provision :shell, inline: '[Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\ProgramData\chocolatey\bin;C:\Program Files\Puppet Labs\Puppet\bin", "Machine")'
- #config.vm.provision :shell, :path => "checkpath.cmd""
- config.vm.provision :shell, inline: "puppet module install --force rismoney/chocolatey"
- config.vm.provision :puppet do |puppet|
- puppet.manifests_path = ""
- puppet.manifest_file = "base.pp"
- end
- end
- cat checkpath.cmd
- @echo =====================================================================================================================================================
- set
- where puppet
- @echo =====================================================================================================================================================
- cat setup_requirements.cmd
- echo 'Ensuring .NET 4.0 is installed'
- @powershell -NoProfile -ExecutionPolicy Bypass -File "c:\vagrant\install_net4.ps1"
- echo 'Ensuring Chocolatey is Installed'
- @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
- cd
- set
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement