diff --git a/sampleNetDeploy/ConfigurationData.SIMPLENET.psd1 b/sampleNetDeploy/ConfigurationData.SIMPLENET.psd1 new file mode 100644 index 0000000..4377184 --- /dev/null +++ b/sampleNetDeploy/ConfigurationData.SIMPLENET.psd1 @@ -0,0 +1,36 @@ +@{ + AllNodes = @( + @{ + NodeName = '*'; + InterfaceAlias = 'Ethernet'; + AddressFamily = 'IPv4'; + Lability_SwitchName = "test-hyperv-switch"; + Lability_Media = 'WIN10_x64_Enterprise_EN_Eval'; + Lability_ProcessorCount = 1; + Lability_StartupMemory = 2GB; + PSDscAllowPlainTextPassword = $true; + } + @{ + NodeName = 'CLIENT1'; + Role = 'CLIENT'; + IPAddress = '10.0.0.1/24'; + } + @{ + NodeName = 'CLIENT2'; + Role = 'CLIENT'; + IPAddress = '10.0.0.2/24'; + } + ); + NonNodeData = @{ + Lability = @{ + EnvironmentPrefix = 'SIMPLENET-'; + Network = @( + @{ Name = 'CORP'; Type = 'Private'; } + ) + DSCResource = @( + @{ Name = 'xComputerManagement'; RequiredVersion = '4.1.0.0'; } + @{ Name = 'xNetworking'; RequiredVersion = '5.7.0.0'; } + ); + }; + }; +}; \ No newline at end of file diff --git a/sampleNetDeploy/Configure.SIMPLENET.ps1 b/sampleNetDeploy/Configure.SIMPLENET.ps1 new file mode 100644 index 0000000..9f67dd5 --- /dev/null +++ b/sampleNetDeploy/Configure.SIMPLENET.ps1 @@ -0,0 +1,50 @@ +Configuration SimpleExpandedConfig { + param () + + Import-DscResource -Module PSDesiredStateConfiguration + + Import-DscResource -Module xComputerManagement -ModuleVersion 4.1.0.0 + Import-DscResource -Module xNetworking -ModuleVersion 5.7.0.0 + + # Common configuration for all nodes + node $AllNodes.Where({$_.Role -in 'CLIENT'}).NodeName { + + LocalConfigurationManager { + RebootNodeIfNeeded = $true; + AllowModuleOverwrite = $true; + ConfigurationMode = 'ApplyOnly'; + } + + xFirewall 'FPS-ICMP4-ERQ-In' { + Name = 'FPS-ICMP4-ERQ-In'; + DisplayName = 'File and Printer Sharing (Echo Request - ICMPv4-In)'; + Description = 'Echo request messages are sent as ping requests to other nodes.'; + Direction = 'Inbound'; + Action = 'Allow'; + Enabled = 'True'; + Profile = 'Any'; + } + + xFirewall 'FPS-ICMP6-ERQ-In' { + Name = 'FPS-ICMP6-ERQ-In'; + DisplayName = 'File and Printer Sharing (Echo Request - ICMPv6-In)'; + Description = 'Echo request messages are sent as ping requests to other nodes.'; + Direction = 'Inbound'; + Action = 'Allow'; + Enabled = 'True'; + Profile = 'Any'; + } + + xIPAddress 'PrimaryIPAddress' { + IPAddress = $node.IPAddress + InterfaceAlias = $node.InterfaceAlias + AddressFamily = $node.AddressFamily + } + + xComputer 'Hostname' { + Name = $node.NodeName; + } + + } + +} \ No newline at end of file diff --git a/sampleNetDeploy/Deploy-SIMPLENET.ps1 b/sampleNetDeploy/Deploy-SIMPLENET.ps1 new file mode 100644 index 0000000..76ce7a6 --- /dev/null +++ b/sampleNetDeploy/Deploy-SIMPLENET.ps1 @@ -0,0 +1,12 @@ +[CmdletBinding()] Param() + +$ErrorActionPreference = "Stop" + +$configData = "$PSScriptRoot\ConfigurationData.SIMPLENET.psd1" +. $PSScriptRoot\Configure.SIMPLENET.ps1 +& SimpleExpandedConfig -ConfigurationData $configData -OutputPath $env:LabilityConfigurationPath -Verbose + +$adminPassword = Read-Host -AsSecureString -Prompt "Admin password" +$adminCred = New-Object -TypeName PSCredential -ArgumentList @("IgnoredUsername", $adminPassword) +Start-LabConfiguration -ConfigurationData $configData -Path $env:LabilityConfigurationPath -Verbose -Credential $adminCred -IgnorePendingReboot +Start-Lab -ConfigurationData $configData -Verbose \ No newline at end of file