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

4

10

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.

Cliftonclim answered 22/5, 2014 at 16:53 Comment(1)
This is exactly what turned me away from DSC when I tried looking into using it. It seemed that the simple things for getting started are just not well supported or at least documented. To test out the technology one would want to manually push a configuration that depends on some custom resources to a target machine... How does one do this with DSC without having to manually copy the files into the powershell folder first? Use DSC to boostrap the resources themselves? If so some documentation or tutorial would go a long way on explaining this.Cinchonism
H
2

Keep an eye on the following

http://www.powershellgallery.com/

PowerShellGet in powershell v5

https://github.com/OneGet/oneget

Also here's some info about these http://www.systemcentercentral.com/day-14-finding-installing-modules-dsc-resources-powershellget/ and Installing a PowerShell Module

Hammertoe answered 18/10, 2014 at 6:27 Comment(1)
Things have changed since 2014 -- installing pre-reqs via Install-Module is my preferred way of handling this scenario now.Cliftonclim
H
3

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

Heise answered 22/5, 2014 at 17:14 Comment(2)
Is this the only way to accomplish this natively? For what I'm trying to accomplish, a pull server doesn't suit my needs.Cliftonclim
AFAIK, Yes. Two alternatives: 1: Push (file copy / manual installation) 2: Pull (pull-server).Heise
A
3

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

Acquire answered 22/5, 2014 at 20:18 Comment(3)
Correct me if I'm wrong, but then I still have to solve the problem of actually getting the files onto the target servers. This is in a no-domain environment, so I don't have the option to grab the files off of a SMB share.Cliftonclim
Yet another reason to go with pull server, where you don't need smb shares.Wershba
You can use SMB shares without a domain, you just have to specify the username(or have the same accountname and password on the remote computer), as long as they are on the same network and the firewalls are open.Heise
H
2

Keep an eye on the following

http://www.powershellgallery.com/

PowerShellGet in powershell v5

https://github.com/OneGet/oneget

Also here's some info about these http://www.systemcentercentral.com/day-14-finding-installing-modules-dsc-resources-powershellget/ and Installing a PowerShell Module

Hammertoe answered 18/10, 2014 at 6:27 Comment(1)
Things have changed since 2014 -- installing pre-reqs via Install-Module is my preferred way of handling this scenario now.Cliftonclim
C
1

Assuming you're using Windows Management Framework / PowerShell 5, you can use Install-Module to install the resource from a NuGet feed.

Cliftonclim answered 9/6, 2016 at 9:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.