Quantcast
Channel: /r/powershell – How to Code .NET
Viewing all articles
Browse latest Browse all 8793

How-The-Heck-To: Cross-File / Nested Partial Pull DSC Configurations, with LCM abstraction?

$
0
0

Environment is WMF5, Server 2012 R2 Pull Server and DSC clients. I’m trying (and failing) to devise a DSC pull configuration environment to meet a few criteria. I can achieve either of these two “requirements” independently, but not together:

  • Configure the Local Configuration Manager to pull a single configuration from the Pull Server
  • Write a configuration that pulls in components from multiple files – sort of like a server-side compilation of sorts (for the sake of argument, the following):
    • SNMP Configuration using cSNMP
    • Power Plan using a Script resource (because it seems that the WMI classes for Power Plans aren’t deployed to Server Core)
    • Teaming using cLBFOTeam
    • Hyper-V stuff using xHyper-V

Now I could easily write a single named configuration that has all the resources and configuration items:

Configuration HyperV_Full { Import-DscResource -Module cSNMP Import-DscResource -Module cLBFOTeam Import-DscResource -Module xHyper-V Script PowerPlan { ... } cLBFOTeam Converged { ... } cSNMPManager Manager { ... } cSNMPCommunity Private { ... } xVMSwitch vSwitch0 { ... } } 

The LCM just needs that one configuration. No drama.

ConfigurationRepositoryWeb DC0_PullServer { ConfigurationNames = @("HyperV_Full") } 

I could define a set of PartialConfigurations for each piece of environment, but then I think I have to have the LCM define them all at that level:

ConfigurationRepositoryWeb DC0_PullServer { ConfigurationNames = @("HyperV_Host","SNMP_Client","PowerPlan_HighPerf") } PartialConfiguration HyperV_Host { ... } PartialConfiguration SNMP_Client { ... } PartialConfiguration PowerPlan_HighPerf { ... } 

How on $Deity’s blue-green Earth do you combine them? There seems to be no way to define a Partial that depends on other Partials on the same configuration source?

I suppose what I really want is this LCM configuration:

ConfigurationRepositoryWeb DC0_PullServer { # ConfigurationNames = @("HyperV_Full") } 

with this server-side/pull server setup:

Configuration HyperV_Full { ... PartialConfiguration HyperV_Role { ... } PartialConfiguration SNMP_Client { ... } PartialConfiguration PowerPlan_HighPerf { ... } } 

The necessary syntax escapes me. Can’t do PartialConfigurations without tagging the whole configuration as DscLocalConfigurationManager(), and even then can’t figure out the syntax for inclusion and dependency management. Suggestions welcomed (along with comments like “You’re an idiot, you can’t do this” or “You’re an idiot, it’s simple, use this syntax”).

submitted by /u/VTi-R
[link] [comments]

The post How-The-Heck-To: Cross-File / Nested Partial Pull DSC Configurations, with LCM abstraction? appeared first on How to Code .NET.


Viewing all articles
Browse latest Browse all 8793

Trending Articles