I have a configuration data file like data.psd1
@{
AllNodes = @(
@{
NodeName = "*"
LogPath = "C:\Logs"
},
@{
NodeName = "machine1";
Roles = @( "SmtpRole", "WebRole" )
},
@{
NodeName = "machine2";
Roles = @( "SmtpRole" )
}
)
}
I have a configuration like FarmConfiguration.ps1
Configuration FarmConfiguration {
Import-DscResource -ModuleName 'PSDesiredStateConfiguration'
Import-DscResource -ModuleName 'MyCustomDsc'
Node $AllNodes.NodeName
{
SimpleTcpIpConfiguration SimpleTcpIp
{
}
}
Node $AllNodes.Where{$_.Roles -contains "WebRole"}.NodeName
{
WebConfiguration Web
{
}
}
Node $AllNodes.Where{$_.Roles -contains "SmtpRole"}.NodeName
{
SmtpConfiguration Smtp
{
}
}
}
I know if I add "FarmConfiguration-ConfigurationData data.psd1" to the bottom of my FarmConfiguration.ps1 file then everything works fine.
But this is a big problem I don't want my FarmConfiguration to know about the data file at all, it's check into source control.
I want to be able to creates MOFs based on various different data files how can I do this? Thanks.