Hi,
We seem to have issues on a new Pull DSC server setup. (Running on Windows Server 2016 Core). We keep having the
“DSC Agent failed… The underlying error is: The attempt to register DSC Agent”
It works great for a day then we have issues nodes trying to register to the pull server. I’m wondering there is a bug or something.
Below is DSC Config
Configuration PullServer
{
param
(
[string[]]$NodeName = 'localhost',
[ValidateNotNullOrEmpty()]
[string] $certificateThumbPrint,
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[string] $RegistrationKey
)
Import-DSCResource -ModuleName "xPSDesiredStateConfiguration","WinTechDiskVolume","xWebAdministration","WinTechWinlogbeat", `
"WinTechFileBeat","WinTechTopbeat","WinTechOctopus"
Node $NodeName
{
$Features = "Web-ISAPI-Ext","Web-ISAPI-Filter","Web-Asp-Net45","Web-Net-Ext45",
"Web-Security","Web-Health","Web-Common-Http","Telnet-Client","Web-Mgmt-Service"
WindowsFeature Web_WebServer
{
Name = "Web-Server"
Ensure = "present"
}
foreach ($Feature in $Features)
{
WindowsFeature $Feature
{
Name = $Feature
Ensure = "present"
IncludeAllSubFeature = $true
}
}
Registry Enable_IIS_Remote
{
Ensure = "Present"
Key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WebManagement\Server'
ValueName = "EnableRemoteManagement"
ValueData = "1"
ValueType = "Dword"
}
Service WMSVC
{
Name = "WMSVC"
State = "Running"
StartUpType = "Automatic"
DependsOn = "[Registry]Enable_IIS_Remote"
}
WindowsFeature DSCServiceFeature
{
Ensure = 'Present'
Name = 'DSC-Service'
}
xDscWebService PSDSCPullServer
{
Ensure = 'Present'
EndpointName = 'PSDSCPullServer'
Port = 443
PhysicalPath = "$env:SystemDrive\inetpub\PSDSCPullServer"
CertificateThumbPrint = $certificateThumbPrint
ModulePath = "$env:PROGRAMFILES\WindowsPowerShell\DscService\Modules"
ConfigurationPath = "$env:PROGRAMFILES\WindowsPowerShell\DscService\Configuration"
State = 'Started'
UseSecurityBestPractices = $true
DependsOn = '[WindowsFeature]DSCServiceFeature'
}
File RegistrationKeyFile
{
Ensure = 'Present'
Type = 'File'
DestinationPath = "$env:ProgramFiles\WindowsPowerShell\DscService\RegistrationKeys.txt"
Contents = $RegistrationKey
}
DiskVolume Volume_D
{
DriveLetter = "D"
DiskNumber = 1
}
Winlogbeat WinlogbeatInstall
{
Version = "1.3.1.2"
Ensure = "Present"
EndPoint = "UK"
}
Service winlogbeat {
name = "winlogbeat"
state = "Running"
startuptype = "Automatic"
DependsOn = "[Winlogbeat]WinlogbeatInstall"
}
FileBeat FilebeatInstall {
Ensure = "Present"
Version = "1.3.1.9"
EndPoint = "UK"
}
Service FilebeatService {
Name = "filebeat"
State = "Running"
StartupType = "Automatic"
DependsOn = "[Filebeat]FilebeatInstall"
}
Topbeat TopbeatInstall {
Version = "1.3.1.2"
Ensure = "Present"
EndPoint = "UK"
}
Service Topbeat {
name = "Topbeat"
state = "Running"
startuptype = "Automatic"
DependsOn = "[Topbeat]TopbeatInstall"
}
file IISFolder {
DestinationPath = "D:\IISLogs"
Type = "Directory"
}
xIisLogging Logging
{
LogPath = 'D:\IISLogs'
Logflags = @('Date','Time','ClientIP','UserName','SiteName','ServerIP','Method','UriStem','UriQuery','HttpStatus','Win32Status','TimeTaken','ServerPort','UserAgent','Referer','HttpSubStatus')
LogPeriod = 'daily'
DependsOn = '[File]IISFolder'
}
OctopusTentacle OctopusInstall {
Name = "Tentacle"
Ensure = "present"
Environment = "Ops"
Roles = @("UK-DSC-01","dsc-pull-server")
OctopusServerURL = "http://octopus.wintech.eu"
ListenPort = 10933
Version = "3.4.11"
ApiKey = "API-HA4YFR4DX0BVT5JQMGVSMMKGW8"
DependsOn = "[DiskVolume]Volume_D"
}
}
}
I downloaded the xPSDesiredStateConfiguration from PowerShell Gallery. Wondering if there is a bug in there there. Also is there harm deleting edbXXXX.log as they do fill up quite quickly.