Just some thoughts I’d like to share with the community regarding writing a DSC resource for Windows:
DSC is all the rage regarding config management on Windows. It’s not a product but a technology part of the Windows Management framework stack on newer OSes (the same stack where PowerShell sits). Several of the players in the “traditional” linxus-based config mgmt space are looking to DSC for windows-based config management, and with good reason: it’s a kick-ass technologi in need of a product.
Now that we have started on Windows support in Ansible it is my feeling that DSC naturally belongs among the win_ - modules.
A DSC config document comes in the form of a MOF file. This mof file can easily be generated using PowerShell (this is how most folks do it). This PowerShell file can be run with dynamic parameters in order to support multiple computers. The configuration takes dependency on one or more “DSC-enabled” PowerShell modules, which need to be present on the computer before the mof file is executed.
So, all Ansible needs to support DSC is some structuring around where to pick up these modules and DSC files. I was thinking of a folder structure like this:
webservers/
files/
templates/
tasks/
handlers/
vars/
meta/
win_dsc/
dsc_modules/
dsc_configurations/
The modules (which would be subfolders inside dsc_modules) would just be copied onto the target node when the role is executed.
In addition we’d need a “win_dsc” module (or something), which would execute a given file inside the dsc_configurations folder. the win_dsc module would look something like:
win_dsc: src=webserversDSC.ps1 params=(json object containing the variables, this will vary from dsc file to dsc file)
I’d be happy to write the DSC “plumbing”, but I’d need some help getting the module to pick up the modules and config files from the correct role directories.
Here’s a DSC intro from a recent Chef meetup:
http://www.youtube.com/watch?v=mXaAIawzNic