Chapter 2. DSC Architecture

 

"As an architect you design for the present, with an awareness of the past for a future which is essentially unknown."

 
 --Herman Foster

In the last chapter, we covered what PowerShell DSC is and how it fits into a continuous delivery and DevOps process. DSC uses PowerShell language extensions to define configuration files that express the expected state of a target node. We know that DSC uses DSC Resources to determine whether or not the current state of the target node matches the expected state and that these resources know how to change the current state to the expected state.

In this chapter, we will cover the following topics:

  • Push and pull management
  • General workflow
  • Local Configuration Manager
  • DSC Pull Server
  • Deployment considerations

Overview

We are in a precarious position in writing about DSC. In order to explain any one concept, we tend to have to explain a couple more before we get to it. We are going to start out here with some terms and examples of configuration files, DSC settings, and workflow models, but for the most part, the words and actions used will not be clear at first. They are explained in the chapters ahead in greater detail. Remember the previous chapter? Don't panic! If you find yourself getting confused about why something is important, it may become clear as we move from the explanation to putting it into practice. So, for now, look at them and get a feel for the flow of operations, and then come back to them as we touch each step in the operations process in later chapters.

DSC enables you to ensure that the components of your server environment have the correct state and configuration. It enables declarative, autonomous, and idempotent deployment, as well as configuration and conformance of standards-based managed elements.

By its simplest definition, DSC is a Windows service, a set of configuration files, and a set of PowerShell modules and scripts. Of course, there is more to it than that; there's push and pull modes, MOF compilation, and module packaging, but this is really all you need to describe DSC architecture at a high level.

At a lower level, DSC is much more complex. It has to be complex to handle all the different variations of operations you can throw at it. Something so flexible has to have some complicated inner workings. The beauty of DSC is that these complex inner workings are abstracted away from you most of the time, so you can focus on getting the job done. If you need to, you can also access the complex inner workings and tune them to your needs.

To ensure that we are all on the same page about the concepts we are going to cover, let's cover some terms that we have seen over the course of the last chapter, since we will be seeing them in this chapter as well. This won't be an exhaustive list, but it will be enough to get us started.

Term

Description

Idempotent

An operation that can be performed multiple times with the same result.

DSC configuration file

A PowerShell script file that contains the DSC DSL syntax and list of DSC Resources to execute.

DSC configuration data

A PowerShell data file or separate code block that defines data that can change on target nodes.

DSC Resource

A PowerShell module that contains idempotent functions that brings a target node to a desired state.

DSC Cmdlets

PowerShell Cmdlets specially made for DSC operations.

MOF file

Contains the machine-readable version of a DSC configuration file.

LCM

The DSC engine, which controls all execution of DSC configurations.

CM

The process of managing configuration on the servers in your environment.

Drift

A bucket term to indicate the difference between the desired state of a machine and the current state.

Compilation

Generally a programming term, in this case it refers to the process of turning a DSC configuration file into a MOF file.

Metadata

Data that describes other data. This summarizes basic information about other data in a machine-readable format.

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

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