SlideShare a Scribd company logo
1 of 37
Cooking with Chef on
Microsoft Windows
Julian C. Dunn
Senior Consultant, Chef Software, Inc.
jdunn@getchef.com
Chef and Windows Timeline
• May 2011 – Knife plugin for Windows announced
• Oct 2011 – PowerShell, IIS, SQL Server, and Windows cookbooks
• Dec 2011 – Chef Client Installer MSI for Microsoft Windows
• Feb 2012 – Integration of the registry_key resource into core Chef from the
Windows cookbook
• Aug 2013 – Chef 11.6.0 release. PowerShell and Batch scripting integrated into
core Chef. Chef Client released as Windows service
• Aug 2013 - PowerShell Desired State Configuration support announced (for
delivery in 2014)
Challenges to Chef on Windows
• No real package manager
• COTS vendors don’t understand automation
• UAC
• WinRM Quotas
• Win32 Redirector
• Not all preferences/state stored in registry
Windows < 2012?
• WinRM Memory Quota Hotfix required:
• http://support.microsoft.com/kb/2842230
Automating a .NET App on
Windows
Automating a .NET App on Windows
• The app: nopCommerce Shopping
Cart solution (
www.nopcommerce.com)
• ASP.NET with SQL Server backend
• Available through WebPI
• WebPI install assumes a lot,
however
• Full-featured app suitable to show
off Chef resources on Windows
Resources Automated in Demo
• Installing Windows Features and Roles
• IIS app pool
• IIS site
• IIS app
• Registry settings
• Deploying files onto the system
• Unzipping files
• Windows filesystem rights management
Provisioning with Chef
• Azure plugin for Knife
• Request new VM from Azure API
• Bootstrap it over WinRM
• Install and start Chef
• Register with Chef server
• Run through the “run list”
• Instant infrastructure with one
command
Video
The Recipe Code
nopCommerce Recipe Code: Install
IIS, ASP.NET 4.5
::Chef::Recipe.send(:include, Windows::Helper)
windows_feature 'IIS-WebServerRole' do
action :install
end
# Pre-requisite features for IIS-ASPNET45 that need to be installed first, in this order.
%w{IIS-ISAPIFilter IIS-ISAPIExtensions NetFx3ServerFeatures NetFx4Extended-ASPNET45 IISNetFxExtensibility45}.each do |f|
windows_feature f do
action :install
end
end
windows_feature 'IIS-ASPNET45' do
action :install
end
service "iis" do
service_name "W3SVC"
action :nothing
end
include_recipe "iis::remove_default_site"
nopCommerce Recipe Code: Install
nopCommerce
windows_zipfile node['nopcommerce']['approot'] do
source node['nopcommerce']['dist']
action :unzip
not_if {::File.exists?(::File.join(node['nopcommerce']['approot'], "nopCommerce"))}
end

%w{App_Data bin Content ContentImages ContentImagesThumbs ContentImagesUploaded
ContentfilesExportImport Plugins Pluginsbin}.each do |d|
directory win_friendly_path(::File.join(node['nopcommerce']['approot'], 'nopCommerce', d)) do
rights :modify, 'IIS_IUSRS'
end
end
%w{Global.asax web.config}.each do |f|
file win_friendly_path(::File.join(node['nopcommerce']['approot'], 'nopCommerce', f)) do
rights :modify, 'IIS_IUSRS'
end
end
Set up IIS Pool, App, etc.
iis_pool node['nopcommerce']['poolname'] do
runtime_version "4.0"
action :add
end
directory node['nopcommerce']['siteroot'] do
rights :read, 'IIS_IUSRS'
recursive true
action :create
end
iis_site 'nopCommerce' do
protocol :http
port 80
path node['nopcommerce']['siteroot']
application_pool node['nopcommerce']['poolname']
action [:add,:start]
end
iis_app 'nopCommerce' do
application_pool node['nopcommerce']['poolname']
path node['nopcommerce']['apppath']
physical_path "#{node['nopcommerce']['approot']}nopCommerce"
action :add
end
Other Code You Might Have Noticed
system32_path = node['kernel']['machine'] == 'x86_64' ? 'C:WindowsSysnative' : 'C:WindowsSystem32'
cookbook_file "#{system32_path}oemlogo.bmp" do
source node['windowshacks']['oeminfo']['logofile']
rights :read, "Everyone"
action :create
end
registry_key 'HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionOEMInformation' do
values [{:name => 'Logo', :type => :string, :data => 'C:WindowsSystem32oemlogo.bmp'},
{:name => 'Manufacturer', :type => :string, :data => node['windowshacks']['oeminfo']
['manufacturer']},
{:name => 'SupportHours', :type => :string, :data => node['windowshacks']['oeminfo']
['supporthours']},
{:name => 'SupportPhone', :type => :string, :data => node['windowshacks']['oeminfo']
['supportphone']},
{:name => 'SupportURL', :type => :string, :data => node['windowshacks']['oeminfo']['supporturl']}]
action :create
end
64
The Result
Overview of Chef
Resources on Windows
Same as UNIX/Linux
• file, remote_file, cookbook_file, template
• directory, remote_directory
• user, group
• mount (can take CIFS paths)
• env
• service
• execute
• ruby_block
• many others...
Unique to Windows
• registry_key (new in Chef 11.0.0)
• powershell_script (new in Chef 11.6.0)
• batch (new in Chef 11.6.0)
• Automatic architecture handling (:i386
vs. :x86_64)
• Automatic Windows filesystem redirector
handling (Wow64)
• Long-term roadmap: move more
resources to core and out of ‘windows’
cookbook
Windows-Only Cookbooks
• By Chef:
• 7-zip
• iis
• powershell
• sql_server
• webpi
• windows
• wix
Windows Community Cookbooks
• ms_dotnet2 / 4 / 45
• windows_ad (by TAMU)
• msoffice
• azure
registry_key example
# Set system’s proxy settings to be the same as used for Chef
proxy = URI.parse(Chef::Config[:http_proxy])
registry_key 'HKCUSoftwareMicrosoftWindowsCurrentVersionInternet Settings'
do
values [{:name => 'ProxyEnable', :type => :reg_dword, :data => 1},
{:name => 'ProxyServer', :data => "#{proxy.host}:#{proxy.port}"},
{:name => 'ProxyOverride', :type => :reg_string, :data => '<local>'}]
action :create
end
powershell_script example
powershell_script "rename hostname" do
code <<-EOH
$computer_name = Get-Content env:computername
$new_name = 'test-hostname'
$sysInfo = Get-WmiObject -Class Win32_ComputerSystem
$sysInfo.Rename($new_name)
EOH
end
Registry Helpers
• Resources like powershell_script are not idempotent by default
• We provide some helpers for checking the registry:
• registry_data_exists?
• registry_get_subkeys
• registry_get_values
• registry_has_subkeys?
• registry_key_exists?
• registry_value_exists?
Version Helpers
:windows_8_1?
:windows_server_2012_r2?
:windows_8?
:windows_server_2012?
etc.
:marketing_name
:cluster?
:core?
:datacenter?

• Methods on Chef::ReservedNames::Win32
Example Usage
require 'chef/win32/version'
windows_version = Chef::ReservedNames::Win32::Version.new
if (windows_version.windows_server_2008_r2? || windows_version.windows_7?) &&
windows_version.core?
# Server 2008 R2 Core does not come with .NET or Powershell 2.0 enabled
# ... install Powershell 2.0 here
end

• https://github.com/juliandunn/ms_dotnet2/blob/master/re
Special File/Directory Handling
• Parameters that don’t make sense
are ignored
• DOMAINuser, DOMAINgroup work
• Filesystem ACLs are different on
Windows
• mode parameter semantics
• rights parameter only for
Windows
The ‘windows’ Cookbook
• The windows cookbook includes a number of resources
and providers, and helper libraries.
• See https://github.com/opscode-cookbooks/windows for a
full list
• Highlights:
• windows_auto_run
• windows_feature
• windows_package
• windows_path
• windows_reboot
• windows_zipfile
• Other: windows_printer, windows_printer_port,
windows_task
Windows Report Handlers
• Windows cookbook:
• WindowsRebootHandler
• windows_reboot resource
• windows::reboot_handler recipe
• Eventlog cookbook:
• Send Chef output to Windows
Event Log
Desired State Configuration (DSC)

•New in Windows 2012R2 / WMF4
•“Chef-like” declarative system
•Compiles to intermediate format (MOF)
•Provides reliable automation hooks into Windows
Potential DSC Integration
dsc_resource 'IIS' do
name 'Webserver'
resource :component
action :install
end

• 1:1 mapping DSC resources to Chef resources
• Challenges: DSC transactional, Chef is not
• Thoughts? See me after
Windows Roadmap 2014
• Moar resources in core chef-client
• Package (e.g. msi), feature, reboot, etc.
• PowerShell DSC resource integration
• Easy WinRM setup, bootstrap
• Cookbooks: WSUS, AD, Group Policy, etc.
• Miscellaneus: Anonymous Resource RFC
• http://tinyurl.com/anonymous-resource-rfc
Testing on Windows
As a Host
• Berkshelf, Test-Kitchen, ChefSpec work on Windows
• You need Git Bash or a UNIX-like environment
As a Guest
• vagrant-windows
• Monkeypatch to Vagrant to support WinRM
• Works adequately, but fragile
• Packer images to generate Windows VMs
• https://github.com/misheska/basebox-packer
• ServerSpec supports Windows, but limited assertions
Questions?
• Much more than what’s shown here!
• Questions?

• Thank you!

• E: jdunn@getchef.com
• W: www.getchef.com
• T: @julian_dunn
• G: github.com/juliandunn
Cooking with Chef on Windows

More Related Content

What's hot

Orchestration? You Don't Need Orchestration. What You Want is Choreography.
Orchestration? You Don't Need Orchestration. What You Want is Choreography.Orchestration? You Don't Need Orchestration. What You Want is Choreography.
Orchestration? You Don't Need Orchestration. What You Want is Choreography.Julian Dunn
 
Test-Driven Infrastructure with Chef
Test-Driven Infrastructure with ChefTest-Driven Infrastructure with Chef
Test-Driven Infrastructure with ChefMichael Lihs
 
Infrastructure Automation with Chef & Ansible
Infrastructure Automation with Chef & AnsibleInfrastructure Automation with Chef & Ansible
Infrastructure Automation with Chef & Ansiblewajrcs
 
Automated Deployments with Ansible
Automated Deployments with AnsibleAutomated Deployments with Ansible
Automated Deployments with AnsibleMartin Etmajer
 
Chef Fundamentals Training Series Module 1: Overview of Chef
Chef Fundamentals Training Series Module 1: Overview of ChefChef Fundamentals Training Series Module 1: Overview of Chef
Chef Fundamentals Training Series Module 1: Overview of ChefChef Software, Inc.
 
Ansible Introduction
Ansible Introduction Ansible Introduction
Ansible Introduction Robert Reiz
 
Chef Fundamentals Training Series Module 2: Workstation Setup
Chef Fundamentals Training Series Module 2: Workstation SetupChef Fundamentals Training Series Module 2: Workstation Setup
Chef Fundamentals Training Series Module 2: Workstation SetupChef Software, Inc.
 
Introduction to Chef
Introduction to ChefIntroduction to Chef
Introduction to ChefKnoldus Inc.
 
Server Installation and Configuration with Chef
Server Installation and Configuration with ChefServer Installation and Configuration with Chef
Server Installation and Configuration with ChefRaimonds Simanovskis
 
Chef vs Puppet vs Ansible vs SaltStack | Configuration Management Tools Compa...
Chef vs Puppet vs Ansible vs SaltStack | Configuration Management Tools Compa...Chef vs Puppet vs Ansible vs SaltStack | Configuration Management Tools Compa...
Chef vs Puppet vs Ansible vs SaltStack | Configuration Management Tools Compa...Edureka!
 
Community Cookbooks & further resources - Fundamentals Webinar Series Part 6
Community Cookbooks & further resources - Fundamentals Webinar Series Part 6Community Cookbooks & further resources - Fundamentals Webinar Series Part 6
Community Cookbooks & further resources - Fundamentals Webinar Series Part 6Chef
 
Ansible introduction - XX Betabeers Galicia
Ansible introduction - XX Betabeers GaliciaAnsible introduction - XX Betabeers Galicia
Ansible introduction - XX Betabeers GaliciaJuan Diego Pereiro Arean
 
Ansible new paradigms for orchestration
Ansible new paradigms for orchestrationAnsible new paradigms for orchestration
Ansible new paradigms for orchestrationPaolo Tonin
 
Opscode Webinar: Managing Your VMware Infrastructure with Chef
Opscode Webinar: Managing Your VMware Infrastructure with ChefOpscode Webinar: Managing Your VMware Infrastructure with Chef
Opscode Webinar: Managing Your VMware Infrastructure with ChefChef Software, Inc.
 
Chef, Devops, and You
Chef, Devops, and YouChef, Devops, and You
Chef, Devops, and YouBryan Berry
 
Powerhsell dsc for chef veterans
Powerhsell dsc for chef veteransPowerhsell dsc for chef veterans
Powerhsell dsc for chef veteransDamien Caro
 
Play Framework: Intro & High-Level Overview
Play Framework: Intro & High-Level OverviewPlay Framework: Intro & High-Level Overview
Play Framework: Intro & High-Level OverviewJosh Padnick
 

What's hot (20)

Orchestration? You Don't Need Orchestration. What You Want is Choreography.
Orchestration? You Don't Need Orchestration. What You Want is Choreography.Orchestration? You Don't Need Orchestration. What You Want is Choreography.
Orchestration? You Don't Need Orchestration. What You Want is Choreography.
 
Test-Driven Infrastructure with Chef
Test-Driven Infrastructure with ChefTest-Driven Infrastructure with Chef
Test-Driven Infrastructure with Chef
 
Infrastructure Automation with Chef & Ansible
Infrastructure Automation with Chef & AnsibleInfrastructure Automation with Chef & Ansible
Infrastructure Automation with Chef & Ansible
 
Automated Deployments with Ansible
Automated Deployments with AnsibleAutomated Deployments with Ansible
Automated Deployments with Ansible
 
Chef Fundamentals Training Series Module 1: Overview of Chef
Chef Fundamentals Training Series Module 1: Overview of ChefChef Fundamentals Training Series Module 1: Overview of Chef
Chef Fundamentals Training Series Module 1: Overview of Chef
 
Ansible Introduction
Ansible Introduction Ansible Introduction
Ansible Introduction
 
Chef Fundamentals Training Series Module 2: Workstation Setup
Chef Fundamentals Training Series Module 2: Workstation SetupChef Fundamentals Training Series Module 2: Workstation Setup
Chef Fundamentals Training Series Module 2: Workstation Setup
 
Introduction to Chef
Introduction to ChefIntroduction to Chef
Introduction to Chef
 
Server Installation and Configuration with Chef
Server Installation and Configuration with ChefServer Installation and Configuration with Chef
Server Installation and Configuration with Chef
 
Chef vs Puppet vs Ansible vs SaltStack | Configuration Management Tools Compa...
Chef vs Puppet vs Ansible vs SaltStack | Configuration Management Tools Compa...Chef vs Puppet vs Ansible vs SaltStack | Configuration Management Tools Compa...
Chef vs Puppet vs Ansible vs SaltStack | Configuration Management Tools Compa...
 
Chef introduction
Chef introductionChef introduction
Chef introduction
 
Community Cookbooks & further resources - Fundamentals Webinar Series Part 6
Community Cookbooks & further resources - Fundamentals Webinar Series Part 6Community Cookbooks & further resources - Fundamentals Webinar Series Part 6
Community Cookbooks & further resources - Fundamentals Webinar Series Part 6
 
Ansible introduction - XX Betabeers Galicia
Ansible introduction - XX Betabeers GaliciaAnsible introduction - XX Betabeers Galicia
Ansible introduction - XX Betabeers Galicia
 
Learning chef
Learning chefLearning chef
Learning chef
 
Ansible new paradigms for orchestration
Ansible new paradigms for orchestrationAnsible new paradigms for orchestration
Ansible new paradigms for orchestration
 
Opscode Webinar: Managing Your VMware Infrastructure with Chef
Opscode Webinar: Managing Your VMware Infrastructure with ChefOpscode Webinar: Managing Your VMware Infrastructure with Chef
Opscode Webinar: Managing Your VMware Infrastructure with Chef
 
Chef, Devops, and You
Chef, Devops, and YouChef, Devops, and You
Chef, Devops, and You
 
Powerhsell dsc for chef veterans
Powerhsell dsc for chef veteransPowerhsell dsc for chef veterans
Powerhsell dsc for chef veterans
 
Chef Cookbook Workflow
Chef Cookbook WorkflowChef Cookbook Workflow
Chef Cookbook Workflow
 
Play Framework: Intro & High-Level Overview
Play Framework: Intro & High-Level OverviewPlay Framework: Intro & High-Level Overview
Play Framework: Intro & High-Level Overview
 

Similar to Cooking with Chef on Windows

Sim, a Microsoft usa Open Source em DevOps
Sim, a Microsoft usa Open Source em DevOpsSim, a Microsoft usa Open Source em DevOps
Sim, a Microsoft usa Open Source em DevOpsDanilo Bordini
 
Chef Automate - Azure Sydney User Group
Chef Automate - Azure Sydney User GroupChef Automate - Azure Sydney User Group
Chef Automate - Azure Sydney User GroupMatt Ray
 
IBM InterConnect 2015 - IIB in the Cloud
IBM InterConnect 2015 - IIB in the CloudIBM InterConnect 2015 - IIB in the Cloud
IBM InterConnect 2015 - IIB in the CloudAndrew Coleman
 
Node object and roles - Fundamentals Webinar Series Part 3
Node object and roles - Fundamentals Webinar Series Part 3Node object and roles - Fundamentals Webinar Series Part 3
Node object and roles - Fundamentals Webinar Series Part 3Chef
 
A tale of two pizzas: Developer tools at AWS
A tale of two pizzas: Developer tools at AWSA tale of two pizzas: Developer tools at AWS
A tale of two pizzas: Developer tools at AWSAmazon Web Services
 
Configuration Management in the Cloud - AWS Online Tech Talks
Configuration Management in the Cloud - AWS Online Tech TalksConfiguration Management in the Cloud - AWS Online Tech Talks
Configuration Management in the Cloud - AWS Online Tech TalksAmazon Web Services
 
Overview of Chef - Fundamentals Webinar Series Part 1
Overview of Chef - Fundamentals Webinar Series Part 1Overview of Chef - Fundamentals Webinar Series Part 1
Overview of Chef - Fundamentals Webinar Series Part 1Chef
 
Unleashing the Power: A Lap Around PowerShell 3.0
Unleashing the Power: A Lap Around PowerShell 3.0Unleashing the Power: A Lap Around PowerShell 3.0
Unleashing the Power: A Lap Around PowerShell 3.0Sarah Dutkiewicz
 
Introduction to Chef - April 22 2015
Introduction to Chef - April 22 2015Introduction to Chef - April 22 2015
Introduction to Chef - April 22 2015Jennifer Davis
 
Introduction to Infrastructure as Code & Automation / Introduction to Chef
Introduction to Infrastructure as Code & Automation / Introduction to ChefIntroduction to Infrastructure as Code & Automation / Introduction to Chef
Introduction to Infrastructure as Code & Automation / Introduction to ChefNathen Harvey
 
Php Performance On Windows
Php Performance On WindowsPhp Performance On Windows
Php Performance On Windowsruslany
 
Chef, Microsoft, and Community
Chef, Microsoft, and CommunityChef, Microsoft, and Community
Chef, Microsoft, and CommunityChef
 
CHEF - by Scott Russel
CHEF - by Scott RusselCHEF - by Scott Russel
CHEF - by Scott RusselKangaroot
 
A Lap Around PowerShell 3.0
A Lap Around PowerShell 3.0A Lap Around PowerShell 3.0
A Lap Around PowerShell 3.0Sarah Dutkiewicz
 
AWS re:Invent 2016: Configuration Management in the Cloud (DEV305)
AWS re:Invent 2016: Configuration Management in the Cloud (DEV305)AWS re:Invent 2016: Configuration Management in the Cloud (DEV305)
AWS re:Invent 2016: Configuration Management in the Cloud (DEV305)Amazon Web Services
 
Azure handsonlab
Azure handsonlabAzure handsonlab
Azure handsonlabChef
 
Extending WordPress as a pro
Extending WordPress as a proExtending WordPress as a pro
Extending WordPress as a proMarko Heijnen
 

Similar to Cooking with Chef on Windows (20)

Sim a Microsoft Utiliza OpenSource em DevOps!
Sim a Microsoft Utiliza OpenSource em DevOps!Sim a Microsoft Utiliza OpenSource em DevOps!
Sim a Microsoft Utiliza OpenSource em DevOps!
 
Sim, a Microsoft usa Open Source em DevOps
Sim, a Microsoft usa Open Source em DevOpsSim, a Microsoft usa Open Source em DevOps
Sim, a Microsoft usa Open Source em DevOps
 
Chef Automate - Azure Sydney User Group
Chef Automate - Azure Sydney User GroupChef Automate - Azure Sydney User Group
Chef Automate - Azure Sydney User Group
 
IBM InterConnect 2015 - IIB in the Cloud
IBM InterConnect 2015 - IIB in the CloudIBM InterConnect 2015 - IIB in the Cloud
IBM InterConnect 2015 - IIB in the Cloud
 
ITB2017 - Keynote
ITB2017 - KeynoteITB2017 - Keynote
ITB2017 - Keynote
 
Node object and roles - Fundamentals Webinar Series Part 3
Node object and roles - Fundamentals Webinar Series Part 3Node object and roles - Fundamentals Webinar Series Part 3
Node object and roles - Fundamentals Webinar Series Part 3
 
A tale of two pizzas: Developer tools at AWS
A tale of two pizzas: Developer tools at AWSA tale of two pizzas: Developer tools at AWS
A tale of two pizzas: Developer tools at AWS
 
Configuration Management in the Cloud - AWS Online Tech Talks
Configuration Management in the Cloud - AWS Online Tech TalksConfiguration Management in the Cloud - AWS Online Tech Talks
Configuration Management in the Cloud - AWS Online Tech Talks
 
Overview of Chef - Fundamentals Webinar Series Part 1
Overview of Chef - Fundamentals Webinar Series Part 1Overview of Chef - Fundamentals Webinar Series Part 1
Overview of Chef - Fundamentals Webinar Series Part 1
 
Unleashing the Power: A Lap Around PowerShell 3.0
Unleashing the Power: A Lap Around PowerShell 3.0Unleashing the Power: A Lap Around PowerShell 3.0
Unleashing the Power: A Lap Around PowerShell 3.0
 
Introduction to Chef - April 22 2015
Introduction to Chef - April 22 2015Introduction to Chef - April 22 2015
Introduction to Chef - April 22 2015
 
Introduction to Infrastructure as Code & Automation / Introduction to Chef
Introduction to Infrastructure as Code & Automation / Introduction to ChefIntroduction to Infrastructure as Code & Automation / Introduction to Chef
Introduction to Infrastructure as Code & Automation / Introduction to Chef
 
Php Performance On Windows
Php Performance On WindowsPhp Performance On Windows
Php Performance On Windows
 
Chef, Microsoft, and Community
Chef, Microsoft, and CommunityChef, Microsoft, and Community
Chef, Microsoft, and Community
 
CHEF - by Scott Russel
CHEF - by Scott RusselCHEF - by Scott Russel
CHEF - by Scott Russel
 
A Lap Around PowerShell 3.0
A Lap Around PowerShell 3.0A Lap Around PowerShell 3.0
A Lap Around PowerShell 3.0
 
AWS re:Invent 2016: Configuration Management in the Cloud (DEV305)
AWS re:Invent 2016: Configuration Management in the Cloud (DEV305)AWS re:Invent 2016: Configuration Management in the Cloud (DEV305)
AWS re:Invent 2016: Configuration Management in the Cloud (DEV305)
 
Azure handsonlab
Azure handsonlabAzure handsonlab
Azure handsonlab
 
Extending WordPress as a pro
Extending WordPress as a proExtending WordPress as a pro
Extending WordPress as a pro
 
IIS Cookbook
IIS CookbookIIS Cookbook
IIS Cookbook
 

More from Julian Dunn

Technical Careers Beyond DevOps
Technical Careers Beyond DevOpsTechnical Careers Beyond DevOps
Technical Careers Beyond DevOpsJulian Dunn
 
Pull, Don't Push! Sensu Summit 2018 Talk
Pull, Don't Push! Sensu Summit 2018 TalkPull, Don't Push! Sensu Summit 2018 Talk
Pull, Don't Push! Sensu Summit 2018 TalkJulian Dunn
 
Now That I Have Choreography, What Do I Do With It?
Now That I Have Choreography, What Do I Do With It?Now That I Have Choreography, What Do I Do With It?
Now That I Have Choreography, What Do I Do With It?Julian Dunn
 
Distributed systems are hard; distributed systems of people are harder
Distributed systems are hard; distributed systems of people are harderDistributed systems are hard; distributed systems of people are harder
Distributed systems are hard; distributed systems of people are harderJulian Dunn
 
Chef-NYC Announcements July 2014
Chef-NYC Announcements July 2014Chef-NYC Announcements July 2014
Chef-NYC Announcements July 2014Julian Dunn
 
Chef NYC Users' Group - Announcements for June 2014
Chef NYC Users' Group - Announcements for June 2014Chef NYC Users' Group - Announcements for June 2014
Chef NYC Users' Group - Announcements for June 2014Julian Dunn
 
Improving Your Mac Productivity
Improving Your Mac ProductivityImproving Your Mac Productivity
Improving Your Mac ProductivityJulian Dunn
 
Chef Cookbook Governance BoF at ChefConf
Chef Cookbook Governance BoF at ChefConfChef Cookbook Governance BoF at ChefConf
Chef Cookbook Governance BoF at ChefConfJulian Dunn
 
What Makes a Good Cookbook?
What Makes a Good Cookbook?What Makes a Good Cookbook?
What Makes a Good Cookbook?Julian Dunn
 
Configuration Management Isn't Everything
Configuration Management Isn't EverythingConfiguration Management Isn't Everything
Configuration Management Isn't EverythingJulian Dunn
 
An Introduction to DevOps with Chef
An Introduction to DevOps with ChefAn Introduction to DevOps with Chef
An Introduction to DevOps with ChefJulian Dunn
 
Chef Cookbook Testing and Continuous Integration
Chef Cookbook Testing and Continuous IntegrationChef Cookbook Testing and Continuous Integration
Chef Cookbook Testing and Continuous IntegrationJulian Dunn
 
ChefConf 2013: Beginner Chef Antipatterns
ChefConf 2013: Beginner Chef AntipatternsChefConf 2013: Beginner Chef Antipatterns
ChefConf 2013: Beginner Chef AntipatternsJulian Dunn
 
Chef Workflow Strategies at SecondMarket
Chef Workflow Strategies at SecondMarketChef Workflow Strategies at SecondMarket
Chef Workflow Strategies at SecondMarketJulian Dunn
 
What Your CDN Won't Tell You: Optimizing a News Website for Speed and Stability
What Your CDN Won't Tell You: Optimizing a News Website for Speed and StabilityWhat Your CDN Won't Tell You: Optimizing a News Website for Speed and Stability
What Your CDN Won't Tell You: Optimizing a News Website for Speed and StabilityJulian Dunn
 
An Introduction to Shef, the Chef Shell
An Introduction to Shef, the Chef ShellAn Introduction to Shef, the Chef Shell
An Introduction to Shef, the Chef ShellJulian Dunn
 

More from Julian Dunn (17)

Technical Careers Beyond DevOps
Technical Careers Beyond DevOpsTechnical Careers Beyond DevOps
Technical Careers Beyond DevOps
 
Pull, Don't Push! Sensu Summit 2018 Talk
Pull, Don't Push! Sensu Summit 2018 TalkPull, Don't Push! Sensu Summit 2018 Talk
Pull, Don't Push! Sensu Summit 2018 Talk
 
Now That I Have Choreography, What Do I Do With It?
Now That I Have Choreography, What Do I Do With It?Now That I Have Choreography, What Do I Do With It?
Now That I Have Choreography, What Do I Do With It?
 
Distributed systems are hard; distributed systems of people are harder
Distributed systems are hard; distributed systems of people are harderDistributed systems are hard; distributed systems of people are harder
Distributed systems are hard; distributed systems of people are harder
 
Chef on AIX
Chef on AIXChef on AIX
Chef on AIX
 
Chef-NYC Announcements July 2014
Chef-NYC Announcements July 2014Chef-NYC Announcements July 2014
Chef-NYC Announcements July 2014
 
Chef NYC Users' Group - Announcements for June 2014
Chef NYC Users' Group - Announcements for June 2014Chef NYC Users' Group - Announcements for June 2014
Chef NYC Users' Group - Announcements for June 2014
 
Improving Your Mac Productivity
Improving Your Mac ProductivityImproving Your Mac Productivity
Improving Your Mac Productivity
 
Chef Cookbook Governance BoF at ChefConf
Chef Cookbook Governance BoF at ChefConfChef Cookbook Governance BoF at ChefConf
Chef Cookbook Governance BoF at ChefConf
 
What Makes a Good Cookbook?
What Makes a Good Cookbook?What Makes a Good Cookbook?
What Makes a Good Cookbook?
 
Configuration Management Isn't Everything
Configuration Management Isn't EverythingConfiguration Management Isn't Everything
Configuration Management Isn't Everything
 
An Introduction to DevOps with Chef
An Introduction to DevOps with ChefAn Introduction to DevOps with Chef
An Introduction to DevOps with Chef
 
Chef Cookbook Testing and Continuous Integration
Chef Cookbook Testing and Continuous IntegrationChef Cookbook Testing and Continuous Integration
Chef Cookbook Testing and Continuous Integration
 
ChefConf 2013: Beginner Chef Antipatterns
ChefConf 2013: Beginner Chef AntipatternsChefConf 2013: Beginner Chef Antipatterns
ChefConf 2013: Beginner Chef Antipatterns
 
Chef Workflow Strategies at SecondMarket
Chef Workflow Strategies at SecondMarketChef Workflow Strategies at SecondMarket
Chef Workflow Strategies at SecondMarket
 
What Your CDN Won't Tell You: Optimizing a News Website for Speed and Stability
What Your CDN Won't Tell You: Optimizing a News Website for Speed and StabilityWhat Your CDN Won't Tell You: Optimizing a News Website for Speed and Stability
What Your CDN Won't Tell You: Optimizing a News Website for Speed and Stability
 
An Introduction to Shef, the Chef Shell
An Introduction to Shef, the Chef ShellAn Introduction to Shef, the Chef Shell
An Introduction to Shef, the Chef Shell
 

Recently uploaded

办理学位证(UCSD证书)美国加利福尼亚大学圣迭戈分校毕业证成绩单原版一比一
办理学位证(UCSD证书)美国加利福尼亚大学圣迭戈分校毕业证成绩单原版一比一办理学位证(UCSD证书)美国加利福尼亚大学圣迭戈分校毕业证成绩单原版一比一
办理学位证(UCSD证书)美国加利福尼亚大学圣迭戈分校毕业证成绩单原版一比一A SSS
 
1比1办理美国北卡罗莱纳州立大学毕业证成绩单pdf电子版制作修改
1比1办理美国北卡罗莱纳州立大学毕业证成绩单pdf电子版制作修改1比1办理美国北卡罗莱纳州立大学毕业证成绩单pdf电子版制作修改
1比1办理美国北卡罗莱纳州立大学毕业证成绩单pdf电子版制作修改yuu sss
 
(办理学位证)约克圣约翰大学毕业证,KCL成绩单原版一比一
(办理学位证)约克圣约翰大学毕业证,KCL成绩单原版一比一(办理学位证)约克圣约翰大学毕业证,KCL成绩单原版一比一
(办理学位证)约克圣约翰大学毕业证,KCL成绩单原版一比一D SSS
 
办理学位证(SFU证书)西蒙菲莎大学毕业证成绩单原版一比一
办理学位证(SFU证书)西蒙菲莎大学毕业证成绩单原版一比一办理学位证(SFU证书)西蒙菲莎大学毕业证成绩单原版一比一
办理学位证(SFU证书)西蒙菲莎大学毕业证成绩单原版一比一F dds
 
Untitled presedddddddddddddddddntation (1).pptx
Untitled presedddddddddddddddddntation (1).pptxUntitled presedddddddddddddddddntation (1).pptx
Untitled presedddddddddddddddddntation (1).pptxmapanig881
 
Top 10 Modern Web Design Trends for 2025
Top 10 Modern Web Design Trends for 2025Top 10 Modern Web Design Trends for 2025
Top 10 Modern Web Design Trends for 2025Rndexperts
 
原版美国亚利桑那州立大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
原版美国亚利桑那州立大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree原版美国亚利桑那州立大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
原版美国亚利桑那州立大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degreeyuu sss
 
cda.pptx critical discourse analysis ppt
cda.pptx critical discourse analysis pptcda.pptx critical discourse analysis ppt
cda.pptx critical discourse analysis pptMaryamAfzal41
 
Unveiling the Future: Columbus, Ohio Condominiums Through the Lens of 3D Arch...
Unveiling the Future: Columbus, Ohio Condominiums Through the Lens of 3D Arch...Unveiling the Future: Columbus, Ohio Condominiums Through the Lens of 3D Arch...
Unveiling the Future: Columbus, Ohio Condominiums Through the Lens of 3D Arch...Yantram Animation Studio Corporation
 
2024新版美国旧金山州立大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
2024新版美国旧金山州立大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree2024新版美国旧金山州立大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
2024新版美国旧金山州立大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degreeyuu sss
 
毕业文凭制作#回国入职#diploma#degree美国威斯康星大学欧克莱尔分校毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#...
毕业文凭制作#回国入职#diploma#degree美国威斯康星大学欧克莱尔分校毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#...毕业文凭制作#回国入职#diploma#degree美国威斯康星大学欧克莱尔分校毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#...
毕业文凭制作#回国入职#diploma#degree美国威斯康星大学欧克莱尔分校毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#...ttt fff
 
Call Girls Aslali 7397865700 Ridhima Hire Me Full Night
Call Girls Aslali 7397865700 Ridhima Hire Me Full NightCall Girls Aslali 7397865700 Ridhima Hire Me Full Night
Call Girls Aslali 7397865700 Ridhima Hire Me Full Nightssuser7cb4ff
 
CREATING A POSITIVE SCHOOL CULTURE CHAPTER 10
CREATING A POSITIVE SCHOOL CULTURE CHAPTER 10CREATING A POSITIVE SCHOOL CULTURE CHAPTER 10
CREATING A POSITIVE SCHOOL CULTURE CHAPTER 10uasjlagroup
 
办理卡尔顿大学毕业证成绩单|购买加拿大文凭证书
办理卡尔顿大学毕业证成绩单|购买加拿大文凭证书办理卡尔顿大学毕业证成绩单|购买加拿大文凭证书
办理卡尔顿大学毕业证成绩单|购买加拿大文凭证书zdzoqco
 
'CASE STUDY OF INDIRA PARYAVARAN BHAVAN DELHI ,
'CASE STUDY OF INDIRA PARYAVARAN BHAVAN DELHI ,'CASE STUDY OF INDIRA PARYAVARAN BHAVAN DELHI ,
'CASE STUDY OF INDIRA PARYAVARAN BHAVAN DELHI ,Aginakm1
 
General Knowledge Quiz Game C++ CODE.pptx
General Knowledge Quiz Game C++ CODE.pptxGeneral Knowledge Quiz Game C++ CODE.pptx
General Knowledge Quiz Game C++ CODE.pptxmarckustrevion
 
澳洲UQ学位证,昆士兰大学毕业证书1:1制作
澳洲UQ学位证,昆士兰大学毕业证书1:1制作澳洲UQ学位证,昆士兰大学毕业证书1:1制作
澳洲UQ学位证,昆士兰大学毕业证书1:1制作aecnsnzk
 
Apresentação Clamo Cristo -letra música Matheus Rizzo
Apresentação Clamo Cristo -letra música Matheus RizzoApresentação Clamo Cristo -letra música Matheus Rizzo
Apresentação Clamo Cristo -letra música Matheus RizzoCarolTelles6
 
FiveHypotheses_UIDMasterclass_18April2024.pdf
FiveHypotheses_UIDMasterclass_18April2024.pdfFiveHypotheses_UIDMasterclass_18April2024.pdf
FiveHypotheses_UIDMasterclass_18April2024.pdfShivakumar Viswanathan
 
DAKSHIN BIHAR GRAMIN BANK: REDEFINING THE DIGITAL BANKING EXPERIENCE WITH A U...
DAKSHIN BIHAR GRAMIN BANK: REDEFINING THE DIGITAL BANKING EXPERIENCE WITH A U...DAKSHIN BIHAR GRAMIN BANK: REDEFINING THE DIGITAL BANKING EXPERIENCE WITH A U...
DAKSHIN BIHAR GRAMIN BANK: REDEFINING THE DIGITAL BANKING EXPERIENCE WITH A U...Rishabh Aryan
 

Recently uploaded (20)

办理学位证(UCSD证书)美国加利福尼亚大学圣迭戈分校毕业证成绩单原版一比一
办理学位证(UCSD证书)美国加利福尼亚大学圣迭戈分校毕业证成绩单原版一比一办理学位证(UCSD证书)美国加利福尼亚大学圣迭戈分校毕业证成绩单原版一比一
办理学位证(UCSD证书)美国加利福尼亚大学圣迭戈分校毕业证成绩单原版一比一
 
1比1办理美国北卡罗莱纳州立大学毕业证成绩单pdf电子版制作修改
1比1办理美国北卡罗莱纳州立大学毕业证成绩单pdf电子版制作修改1比1办理美国北卡罗莱纳州立大学毕业证成绩单pdf电子版制作修改
1比1办理美国北卡罗莱纳州立大学毕业证成绩单pdf电子版制作修改
 
(办理学位证)约克圣约翰大学毕业证,KCL成绩单原版一比一
(办理学位证)约克圣约翰大学毕业证,KCL成绩单原版一比一(办理学位证)约克圣约翰大学毕业证,KCL成绩单原版一比一
(办理学位证)约克圣约翰大学毕业证,KCL成绩单原版一比一
 
办理学位证(SFU证书)西蒙菲莎大学毕业证成绩单原版一比一
办理学位证(SFU证书)西蒙菲莎大学毕业证成绩单原版一比一办理学位证(SFU证书)西蒙菲莎大学毕业证成绩单原版一比一
办理学位证(SFU证书)西蒙菲莎大学毕业证成绩单原版一比一
 
Untitled presedddddddddddddddddntation (1).pptx
Untitled presedddddddddddddddddntation (1).pptxUntitled presedddddddddddddddddntation (1).pptx
Untitled presedddddddddddddddddntation (1).pptx
 
Top 10 Modern Web Design Trends for 2025
Top 10 Modern Web Design Trends for 2025Top 10 Modern Web Design Trends for 2025
Top 10 Modern Web Design Trends for 2025
 
原版美国亚利桑那州立大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
原版美国亚利桑那州立大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree原版美国亚利桑那州立大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
原版美国亚利桑那州立大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
 
cda.pptx critical discourse analysis ppt
cda.pptx critical discourse analysis pptcda.pptx critical discourse analysis ppt
cda.pptx critical discourse analysis ppt
 
Unveiling the Future: Columbus, Ohio Condominiums Through the Lens of 3D Arch...
Unveiling the Future: Columbus, Ohio Condominiums Through the Lens of 3D Arch...Unveiling the Future: Columbus, Ohio Condominiums Through the Lens of 3D Arch...
Unveiling the Future: Columbus, Ohio Condominiums Through the Lens of 3D Arch...
 
2024新版美国旧金山州立大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
2024新版美国旧金山州立大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree2024新版美国旧金山州立大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
2024新版美国旧金山州立大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
 
毕业文凭制作#回国入职#diploma#degree美国威斯康星大学欧克莱尔分校毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#...
毕业文凭制作#回国入职#diploma#degree美国威斯康星大学欧克莱尔分校毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#...毕业文凭制作#回国入职#diploma#degree美国威斯康星大学欧克莱尔分校毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#...
毕业文凭制作#回国入职#diploma#degree美国威斯康星大学欧克莱尔分校毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#...
 
Call Girls Aslali 7397865700 Ridhima Hire Me Full Night
Call Girls Aslali 7397865700 Ridhima Hire Me Full NightCall Girls Aslali 7397865700 Ridhima Hire Me Full Night
Call Girls Aslali 7397865700 Ridhima Hire Me Full Night
 
CREATING A POSITIVE SCHOOL CULTURE CHAPTER 10
CREATING A POSITIVE SCHOOL CULTURE CHAPTER 10CREATING A POSITIVE SCHOOL CULTURE CHAPTER 10
CREATING A POSITIVE SCHOOL CULTURE CHAPTER 10
 
办理卡尔顿大学毕业证成绩单|购买加拿大文凭证书
办理卡尔顿大学毕业证成绩单|购买加拿大文凭证书办理卡尔顿大学毕业证成绩单|购买加拿大文凭证书
办理卡尔顿大学毕业证成绩单|购买加拿大文凭证书
 
'CASE STUDY OF INDIRA PARYAVARAN BHAVAN DELHI ,
'CASE STUDY OF INDIRA PARYAVARAN BHAVAN DELHI ,'CASE STUDY OF INDIRA PARYAVARAN BHAVAN DELHI ,
'CASE STUDY OF INDIRA PARYAVARAN BHAVAN DELHI ,
 
General Knowledge Quiz Game C++ CODE.pptx
General Knowledge Quiz Game C++ CODE.pptxGeneral Knowledge Quiz Game C++ CODE.pptx
General Knowledge Quiz Game C++ CODE.pptx
 
澳洲UQ学位证,昆士兰大学毕业证书1:1制作
澳洲UQ学位证,昆士兰大学毕业证书1:1制作澳洲UQ学位证,昆士兰大学毕业证书1:1制作
澳洲UQ学位证,昆士兰大学毕业证书1:1制作
 
Apresentação Clamo Cristo -letra música Matheus Rizzo
Apresentação Clamo Cristo -letra música Matheus RizzoApresentação Clamo Cristo -letra música Matheus Rizzo
Apresentação Clamo Cristo -letra música Matheus Rizzo
 
FiveHypotheses_UIDMasterclass_18April2024.pdf
FiveHypotheses_UIDMasterclass_18April2024.pdfFiveHypotheses_UIDMasterclass_18April2024.pdf
FiveHypotheses_UIDMasterclass_18April2024.pdf
 
DAKSHIN BIHAR GRAMIN BANK: REDEFINING THE DIGITAL BANKING EXPERIENCE WITH A U...
DAKSHIN BIHAR GRAMIN BANK: REDEFINING THE DIGITAL BANKING EXPERIENCE WITH A U...DAKSHIN BIHAR GRAMIN BANK: REDEFINING THE DIGITAL BANKING EXPERIENCE WITH A U...
DAKSHIN BIHAR GRAMIN BANK: REDEFINING THE DIGITAL BANKING EXPERIENCE WITH A U...
 

Cooking with Chef on Windows

  • 1. Cooking with Chef on Microsoft Windows Julian C. Dunn Senior Consultant, Chef Software, Inc. jdunn@getchef.com
  • 2. Chef and Windows Timeline • May 2011 – Knife plugin for Windows announced • Oct 2011 – PowerShell, IIS, SQL Server, and Windows cookbooks • Dec 2011 – Chef Client Installer MSI for Microsoft Windows • Feb 2012 – Integration of the registry_key resource into core Chef from the Windows cookbook • Aug 2013 – Chef 11.6.0 release. PowerShell and Batch scripting integrated into core Chef. Chef Client released as Windows service • Aug 2013 - PowerShell Desired State Configuration support announced (for delivery in 2014)
  • 3. Challenges to Chef on Windows • No real package manager • COTS vendors don’t understand automation • UAC • WinRM Quotas • Win32 Redirector • Not all preferences/state stored in registry
  • 4. Windows < 2012? • WinRM Memory Quota Hotfix required: • http://support.microsoft.com/kb/2842230
  • 5. Automating a .NET App on Windows
  • 6. Automating a .NET App on Windows • The app: nopCommerce Shopping Cart solution ( www.nopcommerce.com) • ASP.NET with SQL Server backend • Available through WebPI • WebPI install assumes a lot, however • Full-featured app suitable to show off Chef resources on Windows
  • 7. Resources Automated in Demo • Installing Windows Features and Roles • IIS app pool • IIS site • IIS app • Registry settings • Deploying files onto the system • Unzipping files • Windows filesystem rights management
  • 8. Provisioning with Chef • Azure plugin for Knife • Request new VM from Azure API • Bootstrap it over WinRM • Install and start Chef • Register with Chef server • Run through the “run list” • Instant infrastructure with one command
  • 11. nopCommerce Recipe Code: Install IIS, ASP.NET 4.5 ::Chef::Recipe.send(:include, Windows::Helper) windows_feature 'IIS-WebServerRole' do action :install end # Pre-requisite features for IIS-ASPNET45 that need to be installed first, in this order. %w{IIS-ISAPIFilter IIS-ISAPIExtensions NetFx3ServerFeatures NetFx4Extended-ASPNET45 IISNetFxExtensibility45}.each do |f| windows_feature f do action :install end end windows_feature 'IIS-ASPNET45' do action :install end service "iis" do service_name "W3SVC" action :nothing end include_recipe "iis::remove_default_site"
  • 12. nopCommerce Recipe Code: Install nopCommerce windows_zipfile node['nopcommerce']['approot'] do source node['nopcommerce']['dist'] action :unzip not_if {::File.exists?(::File.join(node['nopcommerce']['approot'], "nopCommerce"))} end %w{App_Data bin Content ContentImages ContentImagesThumbs ContentImagesUploaded ContentfilesExportImport Plugins Pluginsbin}.each do |d| directory win_friendly_path(::File.join(node['nopcommerce']['approot'], 'nopCommerce', d)) do rights :modify, 'IIS_IUSRS' end end %w{Global.asax web.config}.each do |f| file win_friendly_path(::File.join(node['nopcommerce']['approot'], 'nopCommerce', f)) do rights :modify, 'IIS_IUSRS' end end
  • 13. Set up IIS Pool, App, etc. iis_pool node['nopcommerce']['poolname'] do runtime_version "4.0" action :add end directory node['nopcommerce']['siteroot'] do rights :read, 'IIS_IUSRS' recursive true action :create end iis_site 'nopCommerce' do protocol :http port 80 path node['nopcommerce']['siteroot'] application_pool node['nopcommerce']['poolname'] action [:add,:start] end iis_app 'nopCommerce' do application_pool node['nopcommerce']['poolname'] path node['nopcommerce']['apppath'] physical_path "#{node['nopcommerce']['approot']}nopCommerce" action :add end
  • 14. Other Code You Might Have Noticed system32_path = node['kernel']['machine'] == 'x86_64' ? 'C:WindowsSysnative' : 'C:WindowsSystem32' cookbook_file "#{system32_path}oemlogo.bmp" do source node['windowshacks']['oeminfo']['logofile'] rights :read, "Everyone" action :create end registry_key 'HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionOEMInformation' do values [{:name => 'Logo', :type => :string, :data => 'C:WindowsSystem32oemlogo.bmp'}, {:name => 'Manufacturer', :type => :string, :data => node['windowshacks']['oeminfo'] ['manufacturer']}, {:name => 'SupportHours', :type => :string, :data => node['windowshacks']['oeminfo'] ['supporthours']}, {:name => 'SupportPhone', :type => :string, :data => node['windowshacks']['oeminfo'] ['supportphone']}, {:name => 'SupportURL', :type => :string, :data => node['windowshacks']['oeminfo']['supporturl']}] action :create end
  • 15. 64
  • 18. Same as UNIX/Linux • file, remote_file, cookbook_file, template • directory, remote_directory • user, group • mount (can take CIFS paths) • env • service • execute • ruby_block • many others...
  • 19. Unique to Windows • registry_key (new in Chef 11.0.0) • powershell_script (new in Chef 11.6.0) • batch (new in Chef 11.6.0) • Automatic architecture handling (:i386 vs. :x86_64) • Automatic Windows filesystem redirector handling (Wow64) • Long-term roadmap: move more resources to core and out of ‘windows’ cookbook
  • 20. Windows-Only Cookbooks • By Chef: • 7-zip • iis • powershell • sql_server • webpi • windows • wix
  • 21. Windows Community Cookbooks • ms_dotnet2 / 4 / 45 • windows_ad (by TAMU) • msoffice • azure
  • 22. registry_key example # Set system’s proxy settings to be the same as used for Chef proxy = URI.parse(Chef::Config[:http_proxy]) registry_key 'HKCUSoftwareMicrosoftWindowsCurrentVersionInternet Settings' do values [{:name => 'ProxyEnable', :type => :reg_dword, :data => 1}, {:name => 'ProxyServer', :data => "#{proxy.host}:#{proxy.port}"}, {:name => 'ProxyOverride', :type => :reg_string, :data => '<local>'}] action :create end
  • 23. powershell_script example powershell_script "rename hostname" do code <<-EOH $computer_name = Get-Content env:computername $new_name = 'test-hostname' $sysInfo = Get-WmiObject -Class Win32_ComputerSystem $sysInfo.Rename($new_name) EOH end
  • 24. Registry Helpers • Resources like powershell_script are not idempotent by default • We provide some helpers for checking the registry: • registry_data_exists? • registry_get_subkeys • registry_get_values • registry_has_subkeys? • registry_key_exists? • registry_value_exists?
  • 26. Example Usage require 'chef/win32/version' windows_version = Chef::ReservedNames::Win32::Version.new if (windows_version.windows_server_2008_r2? || windows_version.windows_7?) && windows_version.core? # Server 2008 R2 Core does not come with .NET or Powershell 2.0 enabled # ... install Powershell 2.0 here end • https://github.com/juliandunn/ms_dotnet2/blob/master/re
  • 27. Special File/Directory Handling • Parameters that don’t make sense are ignored • DOMAINuser, DOMAINgroup work • Filesystem ACLs are different on Windows • mode parameter semantics • rights parameter only for Windows
  • 28. The ‘windows’ Cookbook • The windows cookbook includes a number of resources and providers, and helper libraries. • See https://github.com/opscode-cookbooks/windows for a full list • Highlights: • windows_auto_run • windows_feature • windows_package • windows_path • windows_reboot • windows_zipfile • Other: windows_printer, windows_printer_port, windows_task
  • 29. Windows Report Handlers • Windows cookbook: • WindowsRebootHandler • windows_reboot resource • windows::reboot_handler recipe • Eventlog cookbook: • Send Chef output to Windows Event Log
  • 30. Desired State Configuration (DSC) •New in Windows 2012R2 / WMF4 •“Chef-like” declarative system •Compiles to intermediate format (MOF) •Provides reliable automation hooks into Windows
  • 31. Potential DSC Integration dsc_resource 'IIS' do name 'Webserver' resource :component action :install end • 1:1 mapping DSC resources to Chef resources • Challenges: DSC transactional, Chef is not • Thoughts? See me after
  • 32. Windows Roadmap 2014 • Moar resources in core chef-client • Package (e.g. msi), feature, reboot, etc. • PowerShell DSC resource integration • Easy WinRM setup, bootstrap • Cookbooks: WSUS, AD, Group Policy, etc. • Miscellaneus: Anonymous Resource RFC • http://tinyurl.com/anonymous-resource-rfc
  • 34. As a Host • Berkshelf, Test-Kitchen, ChefSpec work on Windows • You need Git Bash or a UNIX-like environment
  • 35. As a Guest • vagrant-windows • Monkeypatch to Vagrant to support WinRM • Works adequately, but fragile • Packer images to generate Windows VMs • https://github.com/misheska/basebox-packer • ServerSpec supports Windows, but limited assertions
  • 36. Questions? • Much more than what’s shown here! • Questions? • Thank you! • E: jdunn@getchef.com • W: www.getchef.com • T: @julian_dunn • G: github.com/juliandunn

Editor's Notes

  1. We have many others.
  2. Here we set up IIS properly with all the extensions we need I’m not using the “iis” cookbook but we could have done that too, but I didn’t want webpi on my system.
  3. Download and unpack nopCommerce, set up its permissions properly
  4. On a 64-bit system, if addressed from a 32-bit process, System32 is redirected to Sysnative thanks to Microsoft’s wacky filesystem redirector, necessitating logic such as this. To which I have to make the following joke...
  5. Again, reiterate what a “resource” is in the context of Chef
  6. Not gonna show “batch” in this webinar, just mention that “batch” is for running CMD.EXE format scripts
  7. Tell them that anything I can’t answer, I’ll post answers on the blog. Also, feel free to ask questions through the blog and I’ll respond, or get someone at Opscode to respond.