Author Posts

June 6, 2017 at 1:21 pm

I've looked at partials and using configuration data but it seems a bit complex for what I'm doing. We have only three types of servers, generic base build, sql, and IIS. I have the basebuild config complete and now I add the role if required.

I can push a separate configuration after the base build is complete but wondering if there is any reason to avoid scripting inside the node block? Something like this..


Configuration Basebuild {

Node $ComputerName {

file requiredfiles{}

registry regitems{}

if($role -eq 'iis'){

WindowsFeature IIS 
    { 
      Ensure = “Present” 
      Name = “Web-Server” 
    } 
}

}

}

June 8, 2017 at 4:23 pm

Nope. No reason at all. It's one of the modularization techniques we discuss in "The DSC Book," in fact.

June 9, 2017 at 6:32 pm

I'll have to read it a third time:)