SQL Server Desired State Configuration

At one of my clients, I've seen the benefits of using tools like Puppet to push configurations to servers. I've long tried to write idempotent configuration scripts for my servers. Those are scripts that can be run multiple times without changing the end result. They try to bring the server to the state that I want and only make changes when needed. A simple example is to only add the new database mail account when it doesn't exist.

I spent time testing Puppet, Chef, Ansible, Microsoft's own DSC tools. In the end I wasn't happy with any of them. And so I did what I often do in situations like this .... I wrote my own. I mean, how hard can it be? Right? 😎

My goal is to help you to define the state of your servers in version-controlled files and push that to your SQL Servers. That starts with a configuration files that looks something like this:

This example will:

  • Set the model database to SIMPLE recovery mode
  • Disable the sa login
  • Set the cost threshold for parallelism to 50

Applying these change to my local DEV box produces these results:

Running it a second time doesn't produce any changes.

You can download this from my corporate site at SQL Server Desired State Configuration utility page. I've already written extensive documentation to get you started. If you have any questions, please use my contact page to send me an email.

Show Comments