Way to approach DSC configurations

This topic contains 2 replies, has 2 voices, and was last updated by Profile photo of Caddell Robert Caddell Robert 11 months, 3 weeks ago.

  • Author
  • #31677
    Profile photo of Caddell Robert
    Caddell Robert

    I've been working with DSC for a few weeks and I'm looking for some basic guidance. I have created configurations for deploying websites, installing windows-features, using the script resource and some of the example scenarios provided from GitHub. The majority of examples I have come across are for deployment but with a pull sever setup, this just repeats the deployment process. So is it common practice to have a dsc configuration for deployment then a different post-deployment configuration that focuses on configuration drift prevention? I started working on this with the idea a single "catch-all" config but I'm not sure if I have the correct approach or even the right idea of what configuration management entails.

  • #31679
    Profile photo of Dave Wyatt
    Dave Wyatt

    You should just have a desired configuration for a server, regardless of whether it's being deployed for the first time, or whether it's checking for drift. All of those little pieces you've described would be combined into the overall configuration for a particular server (rather than applying each granular configuration one at a time.)

    In PowerShell v5, they added support for Partial Configurations, which can potentially give you a "best of both worlds" scenario. If you're still working with PowerShell v4, you'd need to compile a single MOF document for the server, though the configuration function that it's based on can have logic to determine which resources to apply. (You can see an example of this approach at https://msdn.microsoft.com/en-us/PowerShell/DSC/configData )

  • #31693
    Profile photo of Caddell Robert
    Caddell Robert

    Thank you for the response, this helped to clear up some confusion.

You must be logged in to reply to this topic.