Chapter 5. Pushing DSC Configurations

We have covered everything there is to know about DSC and its internals at this point, but we have not fully explained the different ways DSC configurations actually get to the target nodes. In the first chapters of the book, we learned that there are two models to DSC: a push and a pull model. In this chapter, we will be covering the push model. We will first define what the push model is and then move on to how to use it with DSC configurations. We'll take an example configuration and apply it to a local target node and a remote target node.

In this chapter, we will cover the following topics:

  • Tooling
  • Setting things up
  • Locally pushing DSC configurations
  • Remotely pushing DSC configurations

Tooling

DSC supports applying DSC configurations locally and remotely using the Start-DscConfiguration Cmdlet. This Cmdlet handles both copying the MOF file to the target node and telling DSC to execute the MOF on the target node.

Start-DscConfiguration can be invoked interactively as well as run in the background. Interactive executions are run as we are watching and are able to show us verbose output as each step in the DSC configuration happens. Background executions are PowerShell jobs that do not block your shell, so that you can do other things while the job runs. This means you can use this Cmdlet to push a DSC configuration and then walk away or continue to use your current PowerShell console session to do other things as it executes on the target node.

All output from the DSC configuration execution is logged by DSC, and the Start-DscConfiguration Cmdlet can show this information, if configured. By default, it only displays error and completion information, but it can be configured to yield verbose output by using the Verbose parameter.

It is important to note that Start-DscConfiguration does not perform the execution itself; the DSC service does this on the target node. This means nothing is tied to you, your shell, or your session. Your current console session could stop or go away and the execution would still run. This allows a "set it and forget it" workflow where you push a configuration and walk away to do other things while it runs, and then come back and find the results of the execution ready and waiting for you.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset