[chef] Re: Chef + Custom DSC Resources


Chronological Thread 
  • From: Steven Murawski < >
  • To: , Curtis Stewart < >
  • Subject: [chef] Re: Chef + Custom DSC Resources
  • Date: Sun, 19 Apr 2015 11:53:37 -0500

Hey Curtis, 

With DSC resources you have two options (depending on what version of Chef you are running and what version of the Windows Management Framework or WMF).

Chef 11.16.0 introduced dsc_script which works with WMF 4 or greater.  dsc_script can either embed a bit of DSC configuration syntax or point to an existing dsc configuration script.


dsc_resource is newer and relies on WMF 5 (February preview).  That is a more natural use of DSC from Chef, but relies on newer features that aren't as far downlevel yet (2012 or 2012 R2).


Take a look at the github repo from my ChefConf demo: http://bit.ly/chefconf_dsc or my talk: http://bit.ly/chefconf2015_dsc_video

There are examples of dsc_script, dsc_resource, an equivalent recipe with just powershell_script, and the DSC configuration equivalent. 

As far as custom resources themselves, you are responsible for getting the resources on the node.  You could use remote_file, chocolatey, PowerShellGet, PSGet or any other method you can think of to stage the resources.

With some of the changes in WMF5, we may be able to also use a pull server to distribute resources, but I have to test that yet.

Steve

-- 
Steven Murawski
Community Software Development Engineer @ Chef
Microsoft MVP - PowerShell
http://stevenmurawski.com



On April 16, 2015 at 2:39:18 PM, Curtis Stewart ( "> ) wrote:

Ohai Chef Community!


I'm planning on designing a cookbook that uses some custom DSC resources.  Matt Wrock has an excellent example (https://github.com/mwrock/dsc_nugetserver) using dsc_* Chef resources, but the actual DSC resources all come from the DSC Resource Kit.


I'm looking for a few things in particular when it comes to using custom DSC resources:

  1. ​Do I need both Chef Server (host cookbooks) + DSC Pull Server (host custom DSC resources)?
  2. Is the use of a *.ps1 configuration file required when using DSC resources in cookbooks?
  3. Is it fair to draw comparisons of developing a DSC resource to developing an LWRP?
    1. If so, how are dependent DSC resources pulled in to a recipe for use?  LWRPs have the advantage of either being part of the cookbook itself or dependent cookbooks.

Thanks for any help/suggestions/support!

- Curtis






Archive powered by MHonArc 2.6.16.

§