How to apply partial DSC configurations to deployment targets accordingly to their roles?

We provision (Azure) set of fresh VMs to become deployment Environment. All VMs get Octopus VM extension, become tentacles, get assigned to Octopus Environment and take one or more deployment roles. For each role we have Powershell DSC configuration to configure VMs for particular role.

The question: how to make Octopus apply to each deployment target DSC configurations corresponding to its roles?

Hi Konstantine,

It sounds to me like you need a Deployment Project which can run your DSC using PowerShell script steps, which uses a trigger on the event Machine becomes available for deployment Event group, or maybe just the Machine created event.

You could bundle all your different roles’ DSC code into one Deployment project, and target to the separate roles accordingly - only the code related to a given role will be deployed. I’ve included a couple of screenshots from my lab environment which might make it clearer - it includes three separate DSC blocks in a project, which triggers when a machine becomes available.

Of course, the great thing about DSC is you can run it over and over again with the same result, so you can safely trigger this project on multiple events.

Hope this helps