/
vagrantfile
36 lines (29 loc) · 1.04 KB
/
vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Set variables
Node = "DSCPSCore6"
MOFfolder = "C:\\tmp\\MOF"
CopySource = "D:\\VagrantDemo\\DSC\\SourceFiles"
CopyDestination = "C:\\tmp\\SourceFiles"
Vagrant.configure("2") do |config|
config.vm.box = "gusztavvargadr/w16s"
config.vm.communicator = "winrm"
# Set vagrant machine name
config.vm.hostname = Node
# Configure network
config.vm.network "forwarded_port", host: 33389, guest: 3389
config.vm.network "forwarded_port", host: 8080, guest: 80
config.vm.network "forwarded_port", host: 4443, guest: 443
# Perform file copy from Local machine to Vagrant box
config.vm.provision "file",
source: CopySource,
destination: CopyDestination
# Create MOF
config.vm.provision "shell",
path: 'D:\VagrantDemo\DSC\Config\PS6TestServer.ps1',
args: [Node, MOFfolder]
# Invoke MOF file
config.vm.provision "shell",
inline: "Start-DSCConfiguration -Path $Args[0] -Force -Wait -Verbose",
args: [MOFfolder]
end