Idempotent

It is up to you to uphold the tenets of idempotency that we have been learning over the course of this book in each DSC resource you author. The DSC resource is the last stop in the line of executions that determines whether the current state of the target node is the desired state we described in the DSC configuration script. You must write the code that tests and sets this state in a way that will change the state of the target node only once: the time when the system is not in the desired state.

Significant care must be taken when accomplishing this. You must not change the state of the system if it is in the state we desire. Users of PowerShell DSC expect to be able to run DSC as many times as they want and receive no unintended side-effects from doing so. This is accomplished by running near-obsessive testing of the current state to ensure we are changing things when we have to.

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

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