dsc_and_chef - chef-boneyard/chef-summit-2014 GitHub Wiki

DSC

Studio, Wednesday, 10:30

  • Adam Edwards, richard lavey
  • Scott Russell

Participants

Summary of Discussions

Chef

DSL display by Adam

env "EDITOR" DO
   value "emacs"
end

DSC

Configuration "myconfig"
{
   environment "editor"
   {
      name "EDITOR"
      value "emacs"
  }  
}

Microsoft have released 7 waves of resources, currently around 80 resources these are conceptually similar to chef resources.

New resources released, called dsc_script - take a snippet of dsc, declare one or more resources, not the most native experience yet, but it is workable, support down to 2003r2, focus on areas not already covered.

This can be done in chef today, using powershell 4.

 dsc_script "editor" do
   code <<~EOH
    Archive "somezip"
    {
    path "file.zip"
    destination "c:\archive"
   } 
  EOH
 end

Most resources will be powershell based. ps_desired stated configuration c:\program files\resource

get-dsc resource - enumerates the locations of the resources

Powershell introduces classes as a way to write resources.

Currently can setup a pull server, powershell 5 introduces a powershell get, that will help, but not yet released.

MOF Managed Object framework. At the end it gives a definitive list of what needs to be checked on the system, local config manager does, this, but does not do the same as chef-client.

Module version is very specific, config manager will stop, if version number is not avaialbe.

longer term ps-get is the way to go, powershell 5, but will be backported to powershell 3, probably.

Prototype cookbook, called dsc on supermarket. https://supermarket.getchef.com/cookbooks?utf8=%E2%9C%93&q=dsc

This is avaialble now, and you can do something like this...

 dsc_resource "editor" do
   resource :recycle:   
   property :name, 'EDITOR'
   PROPERTY :value, 'vi'
 end
 Configuration
 {
   environment "EDITOR"
   {
     name = 'EDITOR'
     value = 'vi'
  }
 }

Micosoft docs are not so great on dsc or powershell currently, powershell team blog is more useful currently.

Puppet's approach means that you have to know the DSC resources,

Windows cookbook is pretty good, or should it be replaced by dsc cookbook, but think the windows cookbook will survive for some time, but dsc has better debugging, and a big push on to make building these things easier, and big push to add these resources within microsoft. Can seamlessly pick these things up in chef, very often using powershell to shell out, but if you consume dsc resources there are less instances where this has to happen.

local configuration manager is the daemon in the background doing the dsc work, chef-client hands this off, but also checks this has happened properly, some bug fixes on this, but fundamentally working.

DSC is an api, primarily, ecosystem building around it, but not as much as chef, so putting chef on top allows you to tap into this rich community. It is like builing on top of the win32 api.

Starting automation on a Windows environments, it seems to be a scale issue. THis can be done incementally, find something that is painful, and do something with that, like page files, so you don't have to change everything at once. Deploy to UAT, on amazon, Ops guys know it is coming etc.

Use AMI, image, then use chef to update the application and then move that AMI along the pipeline.

using cruisecontrol, updates aritfacts, zip binaries, and put on amazon, and

What will we do now? What needs to happen next?

⚠️ **GitHub.com Fallback** ⚠️