Role configuration.

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” 
    } 
}

}

}

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

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