SlideShare a Scribd company logo
Windows PowerShell Desired State Configuration (DSC) for Veteran Chefs - ChefConf 2015
S T E V E N M U R A W S K I - @ S t e v e n M u r a w s k i
D A M I E N C A R O - @ d c a r o
A p r i l 2 , 2 0 1 5
• D SC C onfigur ation Syntax
Windows PowerShell Desired State Configuration (DSC) for Veteran Chefs - ChefConf 2015
PS DSC
Extension point
DSC is the built-in
configuration platform for
Microsoft
Windows PowerShell Desired State Configuration (DSC) for Veteran Chefs - ChefConf 2015
Windows PowerShell Desired State Configuration (DSC) for Veteran Chefs - ChefConf 2015
Windows PowerShell Desired State Configuration (DSC) for Veteran Chefs - ChefConf 2015
Feature DSC Chef
Configuration as Code Yes Yes
Domain Specific Language (DSL) Yes Yes
DSL embedded within Script Language Yes - PowerShell Yes – Ruby
“Resource” Concept Yes Yes
Configurable resource attributes Yes – “Property” Yes – “Attribute”
Idempotence of operations Yes Yes
Convergence Yes Yes
Client agent / tool Yes – LCM / Start-
DSCConfiguration
Yes – chef-client / chef-
client
Feature DSC Chef
Configuration as Code Yes Yes
Domain Specific Language (DSL) Yes Yes
DSL embedded within Script Language Yes - PowerShell Yes – Ruby
“Resource” Concept Yes Yes
Configurable resource attributes Yes – “Property” Yes – “Attribute”
Idempotence of operations Yes Yes
Convergence Yes Yes
Client agent / tool Yes – LCM / Start-
DSCConfiguration
Yes – chef-client / chef-
client
# Chef
env 'editor' do
key_name "EDITOR"
value "emacs"
end
# DSC
environment editor
{
Name = "EDITOR"
Value = "emacs"
}
Windows PowerShell Desired State Configuration (DSC) for Veteran Chefs - ChefConf 2015
dsc_script 'myexample1' do
code <<-EOH
File TestFile
{
Ensure = "Present"
DestinationPath= "c:demotest.txt"
Contents= "Hello World"
}
EOH
end
notification
dsc_resource 'myexample2' do
resource :windowsfeature
property :ensure, "Present"
property :name, "Web-Server"
end
file
Ensure
DestinationPath
Contents
dsc_resource do
file
ensure
destinationpath
contents
end
RefreshMode
Configuration LCMSettings {
Node localhost
{
Settings
{
RefreshMode = "Disabled"
}
}
}
Encrypted
databags
Chef
client
In memory, on the node
Secure
string
Powershell
http://bit.ly/c hefc onf_dsc
https ://s uper market.chef.io /
http://w w w.pow ershell.org
• STEVEN MURAWSKI - @StevenMurawski
• DAMIEN CARO - @dcaro
Windows PowerShell Desired State Configuration (DSC) for Veteran Chefs - ChefConf 2015
Windows PowerShell Desired State Configuration (DSC) for Veteran Chefs - ChefConf 2015
• Bookmark for more information on Microsoft and DevOps:
http://aka.ms/devops
• DevOps resources for Practitioners: http://aka.ms/devopsmva
• Key sessions to attend @ Chef
Date Title Speaker(s)
Wed @ 1:30-2:10p Microsoft Presents: Chef in Action on Azure Eugene Chigirinskiy;
Kundana Palagiri
Thurs @ 1:15-1:55p PowerShell from the Ground Up Jeffery Snover
Thurs @ 1:15-1:55p Automate what you can, document what you can’t and have
the wisdom to know the difference
Jessica DeVita
Thurs @ 2:10-2:5o Windows PowerShell Desired State Config (DSC) for
Veteran Chefs
Damien Caro; Steven
Murawski

More Related Content

Windows PowerShell Desired State Configuration (DSC) for Veteran Chefs - ChefConf 2015

  • 2. S T E V E N M U R A W S K I - @ S t e v e n M u r a w s k i D A M I E N C A R O - @ d c a r o A p r i l 2 , 2 0 1 5
  • 3. • D SC C onfigur ation Syntax
  • 5. PS DSC Extension point DSC is the built-in configuration platform for Microsoft
  • 9. Feature DSC Chef Configuration as Code Yes Yes Domain Specific Language (DSL) Yes Yes DSL embedded within Script Language Yes - PowerShell Yes – Ruby “Resource” Concept Yes Yes Configurable resource attributes Yes – “Property” Yes – “Attribute” Idempotence of operations Yes Yes Convergence Yes Yes Client agent / tool Yes – LCM / Start- DSCConfiguration Yes – chef-client / chef- client
  • 10. Feature DSC Chef Configuration as Code Yes Yes Domain Specific Language (DSL) Yes Yes DSL embedded within Script Language Yes - PowerShell Yes – Ruby “Resource” Concept Yes Yes Configurable resource attributes Yes – “Property” Yes – “Attribute” Idempotence of operations Yes Yes Convergence Yes Yes Client agent / tool Yes – LCM / Start- DSCConfiguration Yes – chef-client / chef- client
  • 11. # Chef env 'editor' do key_name "EDITOR" value "emacs" end # DSC environment editor { Name = "EDITOR" Value = "emacs" }
  • 13. dsc_script 'myexample1' do code <<-EOH File TestFile { Ensure = "Present" DestinationPath= "c:demotest.txt" Contents= "Hello World" } EOH end
  • 14. notification dsc_resource 'myexample2' do resource :windowsfeature property :ensure, "Present" property :name, "Web-Server" end
  • 16. RefreshMode Configuration LCMSettings { Node localhost { Settings { RefreshMode = "Disabled" } } }
  • 17. Encrypted databags Chef client In memory, on the node Secure string Powershell
  • 18. http://bit.ly/c hefc onf_dsc https ://s uper market.chef.io / http://w w w.pow ershell.org • STEVEN MURAWSKI - @StevenMurawski • DAMIEN CARO - @dcaro
  • 21. • Bookmark for more information on Microsoft and DevOps: http://aka.ms/devops • DevOps resources for Practitioners: http://aka.ms/devopsmva • Key sessions to attend @ Chef Date Title Speaker(s) Wed @ 1:30-2:10p Microsoft Presents: Chef in Action on Azure Eugene Chigirinskiy; Kundana Palagiri Thurs @ 1:15-1:55p PowerShell from the Ground Up Jeffery Snover Thurs @ 1:15-1:55p Automate what you can, document what you can’t and have the wisdom to know the difference Jessica DeVita Thurs @ 2:10-2:5o Windows PowerShell Desired State Config (DSC) for Veteran Chefs Damien Caro; Steven Murawski

Editor's Notes

  1. Reference: https://technet.microsoft.com/en-us/library/dn249912.aspx DSC is a new management platform in Windows PowerShell that enables deploying and managing configuration data for software services and managing the environment in which these services run. DSC provides a set of Windows PowerShell language extensions, new Windows PowerShell cmdlets, and resources that you can use to declaratively specify how you want your software environment to be configured. It also provides a means to maintain and manage existing configurations.
  2. Additional references: - http://blogs.msdn.com/b/powershell/archive/2015/02/27/invoking-dsc-resource-methods-directly-from-powershell-cim-apis.aspx - https://technet.microsoft.com/en-us/library/dn249922.aspx
  3. Powershell instrospect Get-DSCResource Convert to JSON
  4. Additional reading: https://docs.chef.io/resource_dsc_resource.html
  5. Additional references: - http://blogs.msdn.com/b/powershell/archive/2015/02/27/invoking-dsc-resource-methods-directly-from-powershell-cim-apis.aspx - https://technet.microsoft.com/en-us/library/dn249922.aspx