Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you automatically distribute Desired State Configuration custom resources as part of a deployment?

Tags:

powershell

dsc

I'm working on leveraging Microsoft's DSC Resource Kit (specifically, XWebAdministration, at least for starters). I'm relatively familiar with DSC, so no worries on the script's actual functionality... it does what it's supposed to, or at least I'm pretty sure it does.

The problem is that when I execute the script from my orchestration box, the servers I'm targeting return this error:

The PowerShell provider xWebAdministration does not exist at the PowerShell module 
path nor is it registered as a WMI provider.
    + CategoryInfo          : InvalidOperation: (root/Microsoft/...gurationManager 
   :String) [], CimException
    + FullyQualifiedErrorId : ModuleNameNotFound
    + PSComputerName        : [redacted]

The reason why it's happening is obvious: I didn't install the xWebAdministration module on those machines. The question is: What's the proper method for automatically distributing custom resources as part of a deployment? It's onerous to manually install custom resources on dozens or hundreds of boxes, so there has to be a way, I just don't see any documentation on the subject anywhere.

like image 982
Daniel Mann Avatar asked May 22 '14 16:05

Daniel Mann


People also ask

How do I enable desired state configuration?

To allow DSC to run, Windows needs to be configured to receive PowerShell remote commands even when you're running a localhost configuration. To easily configure your environment correctly, just run Set-WsManQuickConfig -Force in an elevated PowerShell Terminal.

What is Azure automation desired state configuration?

Azure Automation State Configuration is an Azure configuration management service that allows you to write, manage, and compile PowerShell Desired State Configuration (DSC) configurations for nodes in any cloud or on-premises datacenter.

What is desired state in Ansible?

Desired State Configuration, or DSC, is a tool built into PowerShell that can be used to define a Windows host setup through code. The overall purpose of DSC is the same as Ansible, it is just executed in a different manner.

How should you complete the DSC configuration file?

How should you complete the Desired State Configuration (DSC) configuration script? To answer, drag the appropriate values to the correct locations. Each value may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.


2 Answers

You could configure a centralized pull-server for DSC that clients can get configuration and resources from. Check out:

  • How to Deploy and Discover Windows PowerShell Desired State Configuration Resources
  • Building a Desired State Configuration Pull Server
like image 159
Frode F. Avatar answered Oct 10 '22 22:10

Frode F.


If you don't want to use a Pull Server, the only other option you have is to manually Push the resources out, either doing it by using the File Resource in your Configuration (and using Depends On) or copying them out manually somewhere else.

I highly recommend the PowerShell.org E-Book on DSC. It walks you through this scenario and many others. https://onedrive.live.com/?cid=7f868aa697b937fe&id=7F868AA697B937FE%21107

like image 42
Jacob Benson Avatar answered Oct 10 '22 23:10

Jacob Benson