SlideShare ist ein Scribd-Unternehmen logo
1 von 39
Cooking with Chef on Windows
The 2015 Edition
Julian Dunn
Product Manager
Chef Software, Inc.
2015 Changelog
• ChefDK
• Azure extension
• Reboot handling
• Windows package
• Event log
• Desired State Configuration
• Test Kitchen on Windows (guest/host)
• Pester
• PoSHChef
Challenges to Chef on Windows
• No real package manager
• Many COTS vendors don’t understand automation
• UAC (User Access Control)
• WinRM Quotas
• Win32 Redirector
• Not all preferences/state stored in registry
• Reboots
• Some commands over WinRM behave differently
• Other annoyances (KB2773898, KB2918614, KB2842230)
• http://tinyurl.com/winrm-workarounds
Windows =< 2012?
• WinRM Memory Quota Hotfix required:
• http://support.microsoft.com/kb/2842230
Automating a .NET Application
Resources Automated in the 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
1. Upload content (cookbooks, roles, etc.)
2. Request VM
3. Create VM, install Azure
and Chef agents
4. Register with Chef server
5. Execute run_list
Provisioning with Chef on Azure
$ knife azure server create
--azure-source-image a699494373c04fc0bc8f2bb1389d6106__Windows-Server-2012-R2-201412.01-en.us-127GB.vhd
--bootstrap-protocol cloud-api
--winrm-user chef
--winrm-password DELETED
--azure-dns-name DELETED
-r "role[base-windows], role[fourthcoffee-classic]"
...........
Waiting for virtual machine to reach status 'provisioning'............vm state 'provisioning' reached after 2.6 minutes.
Waiting for virtual machine to reach status 'ready'..........................vm state 'ready' reached after 6.23 minutes.
.
DNS Name: DELETED.cloudapp.net
VM Name: DELETED
Size: Medium
Azure Source Image: a699494373c04fc0bc8f2bb1389d6106__Windows-Server-2012-R2-201409.01-en.us-127GB.vhd
Azure Service Location: East US
Public Ip Address: XXXXXXXX
Private Ip Address: YYYYYYYY
WinRM Port: 5985
Environment: _default
Provisioning with Chef on Azure
Waiting for Resource Extension to reach status 'wagent provisioning'....
Resource extension state 'wagent provisioning' reached after 0.03 minutes.
Waiting for Resource Extension to reach status 'installing'....................
Resource extension state 'installing' reached after 2.17 minutes.
Waiting for Resource Extension to reach status 'provisioning'....................................
Resource extension state 'provisioning' reached after 4.33 minutes.
Waiting for Resource Extension to reach status 'ready'....................
Resource extension state 'ready' reached after 2.16 minutes.
.
DNS Name: DELETED.cloudapp.net
VM Name: DELETED
Size: Medium
Azure Source Image: a699494373c04fc0bc8f2bb1389d6106__Windows-Server-2012-R2-201409.01-en.us-127GB.vhd
Azure Service Location: East US
Public Ip Address: XXXXXX
Private Ip Address: YYYYYY
WinRM Port: 5985
Environment: _default
Runlist: ["role[base-windows]", "role[fourthcoffee-classic]"]
Welcome to Fourth Coffee Corporation of Seattle
The Man Behind the Curtain
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 IIS-NetFxExtensibility45}.each do
|f|
windows_feature f do
action :install
end
end
windows_feature 'IIS-ASPNET45' do
action :install
end
More Code…
remote_directory node['fourthcoffee']['install_path'] do
source 'fourthcoffee'
action :create
end
iis_pool 'FourthCoffee' do
runtime_version '4.0'
action :add
end
iis_site 'FourthCoffee' do
protocol :http
port 80
path node['fourthcoffee']['install_path']
application_pool 'FourthCoffee'
action [:add,:start]
end
Other Code I Use…
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
sys
The Result
Chef Resources on Windows
Cross-Platform
• file, remote_file, cookbook_file, template
• directory, remote_directory
• user, group
• mount (can take CIFS paths)
• env
• service
• execute
• ruby_block
• reboot (new this year)
Reboot Resource
reboot "now" do
action :nothing
reason "Cannot continue Chef run without a reboot."
delay_mins 2
end
Windows-Specific
• registry_key
• powershell_script
• batch
• service resource can handle :automatic, :delayed (new in 2015)
• windows_package (new in 2015)
• Automatic architecture handling (:i386 vs. :x86_64)
• Automatic Windows filesystem redirector handling (Wow64)
• Auto-detection of :guard_interpreter
Guard Interpreter
• Older (pre-12) versions of Chef always used sh or cmd to execute guards
(not_if/only_if)
• Didn't make a lot of sense:
powershell_script "hello" do
code "…" # powershell code here
not_if { … } # guard used to run as cmd.exe!
end
Guard Interpreter (continued)
• Chef 12: sensible defaults for guard interpreter
• powershell_script uses PowerShell
• batch uses CMD.EXE
• Override as desired
• guard_interpreter :bash, :batch, :powershell_script, etc. etc.
Windows Helpers
registry_data_exists?
registry_get_subkeys
registry_get_values
registry_has_subkeys?
registry_key_exists?
registry_value_exists?
System Helpers on Chef::ReservedNames::Win32
:windows_8_1?
:windows_server_2012_r2?
:windows_8?
:windows_server_2012?
etc.
:marketing_name
:cluster?
:core?
:datacenter?
Special File and 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
Native Event Logging in Chef Client 12
Desired State Configuration
Native declarative state management on Windows
PowerShell DSC: The Future of Automation
"DSC represents a significant break in administration, because it asks …
administrators to not actually configure anything themselves. Instead, DSC asks
administrators to describe, in fairly simple text files, how they would like a
computer to be configured. The computer, in turn, reads that text file, and
configures itself accordingly."
- The DSC Book, Don Jones & Steve Murawski
Aren't DSC and Chef Competitors?
• As PerfMon is to Solarwinds, DSC is to Chef
• DSC provides automation primitives that Chef recipes can call
• It deliberately lacks the ecosystem:
• Content distribution
• Cross-platform support
• Monitoring/logging/analytics
• However, it brings a standard base for automation to Windows
• No MSFT product in the future may ship without DSC modules!
Example DSC Code
Configuration FourthCoffee
{
# Install the IIS role
WindowsFeature IIS
{
Ensure = "Present"
Name = "Web-Server"
}
# Install the ASP .NET 4.5 role
WindowsFeature AspNet45
{
Ensure = "Present"
Name = "Web-Asp-Net45"
}
...
}
dsc_resource 'webserver' do
resource_name :windowsfeature
property :name, 'Web-Server'
property :ensure, 'Present'
end
dsc_resource 'dotnet45' do
resource_name :windowsfeature
property :name, 'Web-Asp-Net45'
property :ensure, 'Present'
end
Testing Chef Infracode on Windows
Chef Development Kit (ChefDK)
• Obviates need to build your own Ruby development environment
• One-click, instant prescriptive workflow for infrastructure coding
• Code linting
• Unit testing
• Acceptance testing
• Test Kitchen
• … bring your own hypervisor.
Test Kitchen Support on Windows
• Hard at work – releasing soon!
• Windows guests (with or without Windows host)
• Working bundle: https://github.com/juliandunn/fourthcoffee/blob/master/Gemfile
• Where to get Windows box images?
Test Kitchen on Windows Demo
fourthcoffee ~$ kitchen test default-windows-2012R2 --destroy=never
-----> Starting Kitchen (v1.3.0)
-----> Cleaning up any prior instances of <default-windows-2012R2>
-----> Testing <default-windows-2012R2>
-----> Creating <default-windows-2012R2>...
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'win2012r2-datacenter-chef11.16.2'...
Vagrant instance <default-windows-2012R2> created.
Finished creating <default-windows-2012R2> (2m57.54s).
-----> Converging <default-windows-2012R2>...
-----> Chef Omnibus installation detected (true)
Transferring files to <default-windows-2012R2>
Concurrent threads set to :max_threads => 2
[2014-10-13T19:16:36-07:00] INFO: Starting chef-zero on host localhost, port 8889 with repository at
repository at C:/tmp/kitchen
One version per cookbook
[2014-10-13T19:16:40-07:00] INFO: *** Chef 11.16.2 ***
[2014-10-13T19:16:40-07:00] INFO: Chef-client pid: 1656
Test Kitchen on Windows Demo
[2014-10-13T19:19:10-07:00] INFO: Chef Run complete in 142.572914 seconds
[2014-10-13T19:19:10-07:00] INFO: Running report handlers
[2014-10-13T19:19:10-07:00] INFO: Report handlers complete
Finished converging <default-windows-2012R2> (22m55.08s).
-----> Setting up <default-windows-2012R2>...
-----> Running postinstall for serverspec plugin
Finished setting up <default-windows-2012R2> (0m45.62s).
-----> Verifying <default-windows-2012R2>...
-----> Running serverspec test suite
Windows feature "IIS-WebServer" should be installed
Port "80" should be listening
File "C:inetpubFourthCoffeeDefault.cshtml" should be file
Finished in 13.41 seconds (files took 0.48432 seconds to load)
3 examples, 0 failures
Finished verifying <default-windows-2012R2> (0m22.73s).
Finished testing <default-windows-2012R2> (27m11.16s).
-----> Kitchen is finished. (27m12.60s)
Windows Roadmap for 2015
• Import DSC resources into core
• Importing more resources from windows cookbook
• AD, GPO, WSUS client/server cookbooks
• Performance on Windows
Q&A
jdunn@chef.io
julian_dunn
juliandunn

Weitere ähnliche Inhalte

Was ist angesagt?

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
 
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.
 
Infrastructure Automation with Chef & Ansible
Infrastructure Automation with Chef & AnsibleInfrastructure Automation with Chef & Ansible
Infrastructure Automation with Chef & Ansiblewajrcs
 
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.
 
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
 
Server Installation and Configuration with Chef
Server Installation and Configuration with ChefServer Installation and Configuration with Chef
Server Installation and Configuration with ChefRaimonds Simanovskis
 
Play Framework: Intro & High-Level Overview
Play Framework: Intro & High-Level OverviewPlay Framework: Intro & High-Level Overview
Play Framework: Intro & High-Level OverviewJosh Padnick
 
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.
 
The unintended benefits of Chef
The unintended benefits of ChefThe unintended benefits of Chef
The unintended benefits of ChefChef Software, Inc.
 
Chef introduction
Chef introductionChef introduction
Chef introductionFENG Zhichao
 
Chef, Devops, and You
Chef, Devops, and YouChef, Devops, and You
Chef, Devops, and YouBryan Berry
 

Was ist angesagt? (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
 
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
 
Infrastructure Automation with Chef & Ansible
Infrastructure Automation with Chef & AnsibleInfrastructure Automation with Chef & Ansible
Infrastructure Automation with Chef & Ansible
 
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
 
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...
 
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
 
Server Installation and Configuration with Chef
Server Installation and Configuration with ChefServer Installation and Configuration with Chef
Server Installation and Configuration with Chef
 
Play Framework: Intro & High-Level Overview
Play Framework: Intro & High-Level OverviewPlay Framework: Intro & High-Level Overview
Play Framework: Intro & High-Level Overview
 
Ansible new paradigms for orchestration
Ansible new paradigms for orchestrationAnsible new paradigms for orchestration
Ansible new paradigms for orchestration
 
Learning chef
Learning chefLearning chef
Learning chef
 
Docker
DockerDocker
Docker
 
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
 
The unintended benefits of Chef
The unintended benefits of ChefThe unintended benefits of Chef
The unintended benefits of Chef
 
Chef introduction
Chef introductionChef introduction
Chef introduction
 
Chef, Devops, and You
Chef, Devops, and YouChef, Devops, and You
Chef, Devops, and You
 

Ähnlich wie Cooking with Chef on Windows: 2015 Edition

Server 2016 sneak peek
Server 2016 sneak peekServer 2016 sneak peek
Server 2016 sneak peekMichael RĂźefli
 
Deploying Windows Containers on Windows Server 2016
Deploying Windows Containers on Windows Server 2016Deploying Windows Containers on Windows Server 2016
Deploying Windows Containers on Windows Server 2016Ben Hall
 
PowerShellForDBDevelopers
PowerShellForDBDevelopersPowerShellForDBDevelopers
PowerShellForDBDevelopersBryan Cafferky
 
WordPress Development Environments
WordPress Development Environments WordPress Development Environments
WordPress Development Environments Ohad Raz
 
InSpec For DevOpsDays Amsterdam 2017
InSpec For DevOpsDays Amsterdam 2017InSpec For DevOpsDays Amsterdam 2017
InSpec For DevOpsDays Amsterdam 2017Mandi Walls
 
Local development environment evolution
Local development environment evolutionLocal development environment evolution
Local development environment evolutionWise Engineering
 
Geode on Docker
Geode on DockerGeode on Docker
Geode on DockerApache Geode
 
Prescriptive System Security with InSpec
Prescriptive System Security with InSpecPrescriptive System Security with InSpec
Prescriptive System Security with InSpecAll Things Open
 
Prescriptive Security with InSpec - All Things Open 2019
Prescriptive Security with InSpec - All Things Open 2019Prescriptive Security with InSpec - All Things Open 2019
Prescriptive Security with InSpec - All Things Open 2019Mandi Walls
 
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, OrchestrationThe Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, OrchestrationErica Windisch
 
Meetup - DevCloud and CloudStack 4.2
Meetup - DevCloud and CloudStack 4.2Meetup - DevCloud and CloudStack 4.2
Meetup - DevCloud and CloudStack 4.2amoghvk
 
Deploying windows containers with kubernetes
Deploying windows containers with kubernetesDeploying windows containers with kubernetes
Deploying windows containers with kubernetesBen Hall
 
The Modern Developer Toolbox
The Modern Developer ToolboxThe Modern Developer Toolbox
The Modern Developer ToolboxPablo Godel
 
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
 
Introduction to Chef - April 22 2015
Introduction to Chef - April 22 2015Introduction to Chef - April 22 2015
Introduction to Chef - April 22 2015Jennifer Davis
 
Modern tooling to assist with developing applications on FreeBSD
Modern tooling to assist with developing applications on FreeBSDModern tooling to assist with developing applications on FreeBSD
Modern tooling to assist with developing applications on FreeBSDSean Chittenden
 
Our Puppet Story (Linuxtag 2014)
Our Puppet Story (Linuxtag 2014)Our Puppet Story (Linuxtag 2014)
Our Puppet Story (Linuxtag 2014)DECK36
 
Introduction to Ansible
Introduction to AnsibleIntroduction to Ansible
Introduction to AnsibleMichael Bahr
 
Windows 2012 R2 Multi Server Management
Windows 2012 R2 Multi Server ManagementWindows 2012 R2 Multi Server Management
Windows 2012 R2 Multi Server ManagementSharkrit JOBBO
 
InSpec Workshop at Velocity London 2018
InSpec Workshop at Velocity London 2018InSpec Workshop at Velocity London 2018
InSpec Workshop at Velocity London 2018Mandi Walls
 

Ähnlich wie Cooking with Chef on Windows: 2015 Edition (20)

Server 2016 sneak peek
Server 2016 sneak peekServer 2016 sneak peek
Server 2016 sneak peek
 
Deploying Windows Containers on Windows Server 2016
Deploying Windows Containers on Windows Server 2016Deploying Windows Containers on Windows Server 2016
Deploying Windows Containers on Windows Server 2016
 
PowerShellForDBDevelopers
PowerShellForDBDevelopersPowerShellForDBDevelopers
PowerShellForDBDevelopers
 
WordPress Development Environments
WordPress Development Environments WordPress Development Environments
WordPress Development Environments
 
InSpec For DevOpsDays Amsterdam 2017
InSpec For DevOpsDays Amsterdam 2017InSpec For DevOpsDays Amsterdam 2017
InSpec For DevOpsDays Amsterdam 2017
 
Local development environment evolution
Local development environment evolutionLocal development environment evolution
Local development environment evolution
 
Geode on Docker
Geode on DockerGeode on Docker
Geode on Docker
 
Prescriptive System Security with InSpec
Prescriptive System Security with InSpecPrescriptive System Security with InSpec
Prescriptive System Security with InSpec
 
Prescriptive Security with InSpec - All Things Open 2019
Prescriptive Security with InSpec - All Things Open 2019Prescriptive Security with InSpec - All Things Open 2019
Prescriptive Security with InSpec - All Things Open 2019
 
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, OrchestrationThe Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
 
Meetup - DevCloud and CloudStack 4.2
Meetup - DevCloud and CloudStack 4.2Meetup - DevCloud and CloudStack 4.2
Meetup - DevCloud and CloudStack 4.2
 
Deploying windows containers with kubernetes
Deploying windows containers with kubernetesDeploying windows containers with kubernetes
Deploying windows containers with kubernetes
 
The Modern Developer Toolbox
The Modern Developer ToolboxThe Modern Developer Toolbox
The Modern Developer Toolbox
 
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
 
Introduction to Chef - April 22 2015
Introduction to Chef - April 22 2015Introduction to Chef - April 22 2015
Introduction to Chef - April 22 2015
 
Modern tooling to assist with developing applications on FreeBSD
Modern tooling to assist with developing applications on FreeBSDModern tooling to assist with developing applications on FreeBSD
Modern tooling to assist with developing applications on FreeBSD
 
Our Puppet Story (Linuxtag 2014)
Our Puppet Story (Linuxtag 2014)Our Puppet Story (Linuxtag 2014)
Our Puppet Story (Linuxtag 2014)
 
Introduction to Ansible
Introduction to AnsibleIntroduction to Ansible
Introduction to Ansible
 
Windows 2012 R2 Multi Server Management
Windows 2012 R2 Multi Server ManagementWindows 2012 R2 Multi Server Management
Windows 2012 R2 Multi Server Management
 
InSpec Workshop at Velocity London 2018
InSpec Workshop at Velocity London 2018InSpec Workshop at Velocity London 2018
InSpec Workshop at Velocity London 2018
 

Mehr von 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 on AIX
Chef on AIXChef on AIX
Chef on AIXJulian 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
 

Mehr von 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
 

KĂźrzlich hochgeladen

INDIVIDUAL ASSIGNMENT #3 CBG, PRESENTATION.
INDIVIDUAL ASSIGNMENT #3 CBG, PRESENTATION.INDIVIDUAL ASSIGNMENT #3 CBG, PRESENTATION.
INDIVIDUAL ASSIGNMENT #3 CBG, PRESENTATION.CarlotaBedoya1
 
On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024APNIC
 
How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)Damian Radcliffe
 
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...
(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...Escorts Call Girls
 
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...SofiyaSharma5
 
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...Delhi Call girls
 
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.soniya singh
 
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...singhpriety023
 
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableCall Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableSeo
 
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call GirlVIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girladitipandeya
 
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxAWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxellan12
 
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)Delhi Call girls
 

KĂźrzlich hochgeladen (20)

INDIVIDUAL ASSIGNMENT #3 CBG, PRESENTATION.
INDIVIDUAL ASSIGNMENT #3 CBG, PRESENTATION.INDIVIDUAL ASSIGNMENT #3 CBG, PRESENTATION.
INDIVIDUAL ASSIGNMENT #3 CBG, PRESENTATION.
 
On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024
 
How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)
 
Russian Call Girls in %(+971524965298 )# Call Girls in Dubai
Russian Call Girls in %(+971524965298  )#  Call Girls in DubaiRussian Call Girls in %(+971524965298  )#  Call Girls in Dubai
Russian Call Girls in %(+971524965298 )# Call Girls in Dubai
 
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...
(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...
 
@9999965857 🫦 Sexy Desi Call Girls Laxmi Nagar 💓 High Profile Escorts Delhi 🫶
@9999965857 🫦 Sexy Desi Call Girls Laxmi Nagar 💓 High Profile Escorts Delhi 🫶@9999965857 🫦 Sexy Desi Call Girls Laxmi Nagar 💓 High Profile Escorts Delhi 🫶
@9999965857 🫦 Sexy Desi Call Girls Laxmi Nagar 💓 High Profile Escorts Delhi 🫶
 
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
 
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
 
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
 
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
 
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableCall Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
 
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
 
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
 
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call GirlVIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
 
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxAWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
 
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
 
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
 
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
 

Cooking with Chef on Windows: 2015 Edition

  • 1. Cooking with Chef on Windows The 2015 Edition Julian Dunn Product Manager Chef Software, Inc.
  • 2. 2015 Changelog • ChefDK • Azure extension • Reboot handling • Windows package • Event log • Desired State Configuration • Test Kitchen on Windows (guest/host) • Pester • PoSHChef
  • 3. Challenges to Chef on Windows • No real package manager • Many COTS vendors don’t understand automation • UAC (User Access Control) • WinRM Quotas • Win32 Redirector • Not all preferences/state stored in registry • Reboots • Some commands over WinRM behave differently • Other annoyances (KB2773898, KB2918614, KB2842230) • http://tinyurl.com/winrm-workarounds
  • 4. Windows =< 2012? • WinRM Memory Quota Hotfix required: • http://support.microsoft.com/kb/2842230
  • 5. Automating a .NET Application
  • 6.
  • 7. Resources Automated in the 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 1. Upload content (cookbooks, roles, etc.) 2. Request VM 3. Create VM, install Azure and Chef agents 4. Register with Chef server 5. Execute run_list
  • 9.
  • 10. Provisioning with Chef on Azure $ knife azure server create --azure-source-image a699494373c04fc0bc8f2bb1389d6106__Windows-Server-2012-R2-201412.01-en.us-127GB.vhd --bootstrap-protocol cloud-api --winrm-user chef --winrm-password DELETED --azure-dns-name DELETED -r "role[base-windows], role[fourthcoffee-classic]" ........... Waiting for virtual machine to reach status 'provisioning'............vm state 'provisioning' reached after 2.6 minutes. Waiting for virtual machine to reach status 'ready'..........................vm state 'ready' reached after 6.23 minutes. . DNS Name: DELETED.cloudapp.net VM Name: DELETED Size: Medium Azure Source Image: a699494373c04fc0bc8f2bb1389d6106__Windows-Server-2012-R2-201409.01-en.us-127GB.vhd Azure Service Location: East US Public Ip Address: XXXXXXXX Private Ip Address: YYYYYYYY WinRM Port: 5985 Environment: _default
  • 11. Provisioning with Chef on Azure Waiting for Resource Extension to reach status 'wagent provisioning'.... Resource extension state 'wagent provisioning' reached after 0.03 minutes. Waiting for Resource Extension to reach status 'installing'.................... Resource extension state 'installing' reached after 2.17 minutes. Waiting for Resource Extension to reach status 'provisioning'.................................... Resource extension state 'provisioning' reached after 4.33 minutes. Waiting for Resource Extension to reach status 'ready'.................... Resource extension state 'ready' reached after 2.16 minutes. . DNS Name: DELETED.cloudapp.net VM Name: DELETED Size: Medium Azure Source Image: a699494373c04fc0bc8f2bb1389d6106__Windows-Server-2012-R2-201409.01-en.us-127GB.vhd Azure Service Location: East US Public Ip Address: XXXXXX Private Ip Address: YYYYYY WinRM Port: 5985 Environment: _default Runlist: ["role[base-windows]", "role[fourthcoffee-classic]"]
  • 12. Welcome to Fourth Coffee Corporation of Seattle
  • 13. The Man Behind the Curtain 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 IIS-NetFxExtensibility45}.each do |f| windows_feature f do action :install end end windows_feature 'IIS-ASPNET45' do action :install end
  • 14. More Code… remote_directory node['fourthcoffee']['install_path'] do source 'fourthcoffee' action :create end iis_pool 'FourthCoffee' do runtime_version '4.0' action :add end iis_site 'FourthCoffee' do protocol :http port 80 path node['fourthcoffee']['install_path'] application_pool 'FourthCoffee' action [:add,:start] end
  • 15. Other Code I Use… 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
  • 18. Chef Resources on Windows
  • 19. Cross-Platform • file, remote_file, cookbook_file, template • directory, remote_directory • user, group • mount (can take CIFS paths) • env • service • execute • ruby_block • reboot (new this year)
  • 20. Reboot Resource reboot "now" do action :nothing reason "Cannot continue Chef run without a reboot." delay_mins 2 end
  • 21. Windows-Specific • registry_key • powershell_script • batch • service resource can handle :automatic, :delayed (new in 2015) • windows_package (new in 2015) • Automatic architecture handling (:i386 vs. :x86_64) • Automatic Windows filesystem redirector handling (Wow64) • Auto-detection of :guard_interpreter
  • 22. Guard Interpreter • Older (pre-12) versions of Chef always used sh or cmd to execute guards (not_if/only_if) • Didn't make a lot of sense: powershell_script "hello" do code "…" # powershell code here not_if { … } # guard used to run as cmd.exe! end
  • 23. Guard Interpreter (continued) • Chef 12: sensible defaults for guard interpreter • powershell_script uses PowerShell • batch uses CMD.EXE • Override as desired • guard_interpreter :bash, :batch, :powershell_script, etc. etc.
  • 25. System Helpers on Chef::ReservedNames::Win32 :windows_8_1? :windows_server_2012_r2? :windows_8? :windows_server_2012? etc. :marketing_name :cluster? :core? :datacenter?
  • 26. Special File and 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
  • 27. Native Event Logging in Chef Client 12
  • 28. Desired State Configuration Native declarative state management on Windows
  • 29. PowerShell DSC: The Future of Automation "DSC represents a significant break in administration, because it asks … administrators to not actually configure anything themselves. Instead, DSC asks administrators to describe, in fairly simple text files, how they would like a computer to be configured. The computer, in turn, reads that text file, and configures itself accordingly." - The DSC Book, Don Jones & Steve Murawski
  • 30. Aren't DSC and Chef Competitors? • As PerfMon is to Solarwinds, DSC is to Chef • DSC provides automation primitives that Chef recipes can call • It deliberately lacks the ecosystem: • Content distribution • Cross-platform support • Monitoring/logging/analytics • However, it brings a standard base for automation to Windows • No MSFT product in the future may ship without DSC modules!
  • 31. Example DSC Code Configuration FourthCoffee { # Install the IIS role WindowsFeature IIS { Ensure = "Present" Name = "Web-Server" } # Install the ASP .NET 4.5 role WindowsFeature AspNet45 { Ensure = "Present" Name = "Web-Asp-Net45" } ... } dsc_resource 'webserver' do resource_name :windowsfeature property :name, 'Web-Server' property :ensure, 'Present' end dsc_resource 'dotnet45' do resource_name :windowsfeature property :name, 'Web-Asp-Net45' property :ensure, 'Present' end
  • 33.
  • 34. Chef Development Kit (ChefDK) • Obviates need to build your own Ruby development environment • One-click, instant prescriptive workflow for infrastructure coding • Code linting • Unit testing • Acceptance testing • Test Kitchen • … bring your own hypervisor.
  • 35. Test Kitchen Support on Windows • Hard at work – releasing soon! • Windows guests (with or without Windows host) • Working bundle: https://github.com/juliandunn/fourthcoffee/blob/master/Gemfile • Where to get Windows box images?
  • 36. Test Kitchen on Windows Demo fourthcoffee ~$ kitchen test default-windows-2012R2 --destroy=never -----> Starting Kitchen (v1.3.0) -----> Cleaning up any prior instances of <default-windows-2012R2> -----> Testing <default-windows-2012R2> -----> Creating <default-windows-2012R2>... Bringing machine 'default' up with 'virtualbox' provider... ==> default: Importing base box 'win2012r2-datacenter-chef11.16.2'... Vagrant instance <default-windows-2012R2> created. Finished creating <default-windows-2012R2> (2m57.54s). -----> Converging <default-windows-2012R2>... -----> Chef Omnibus installation detected (true) Transferring files to <default-windows-2012R2> Concurrent threads set to :max_threads => 2 [2014-10-13T19:16:36-07:00] INFO: Starting chef-zero on host localhost, port 8889 with repository at repository at C:/tmp/kitchen One version per cookbook [2014-10-13T19:16:40-07:00] INFO: *** Chef 11.16.2 *** [2014-10-13T19:16:40-07:00] INFO: Chef-client pid: 1656
  • 37. Test Kitchen on Windows Demo [2014-10-13T19:19:10-07:00] INFO: Chef Run complete in 142.572914 seconds [2014-10-13T19:19:10-07:00] INFO: Running report handlers [2014-10-13T19:19:10-07:00] INFO: Report handlers complete Finished converging <default-windows-2012R2> (22m55.08s). -----> Setting up <default-windows-2012R2>... -----> Running postinstall for serverspec plugin Finished setting up <default-windows-2012R2> (0m45.62s). -----> Verifying <default-windows-2012R2>... -----> Running serverspec test suite Windows feature "IIS-WebServer" should be installed Port "80" should be listening File "C:inetpubFourthCoffeeDefault.cshtml" should be file Finished in 13.41 seconds (files took 0.48432 seconds to load) 3 examples, 0 failures Finished verifying <default-windows-2012R2> (0m22.73s). Finished testing <default-windows-2012R2> (27m11.16s). -----> Kitchen is finished. (27m12.60s)
  • 38. Windows Roadmap for 2015 • Import DSC resources into core • Importing more resources from windows cookbook • AD, GPO, WSUS client/server cookbooks • Performance on Windows

Hinweis der Redaktion

  1. Chocolatey/NuGet will help with the package management problem. There is still a crapton of legacy stuff out there, and a variety of packaging formats. Not all of them can deal with inplace upgrades. COTS vendors don't understand automation: Some products can't be installed in Server Core Some products can't be installed over PoSH remote sessions or unattended sessions KB2773898 – you can't install MSUs over WinRM KB2918614 – broken patches to Windows that prevent MSIs from installing KB2842230 – WinRM quotas not respected on older operating systems
  2. You can do it via the GUI too, but we're automation people, so we like to use the command line
  3. knife azure server create --azure-vm-size Large --azure-source-image a699494373c04fc0bc8f2bb1389d6106__Windows-Server-2012-R2-201412.01-en.us-127GB.vhd --bootstrap-protocol cloud-api --winrm-user chef --winrm-password C00kingWithChef$ --azure-dns-name devopsnjdemo1 --tcp-endpoints 3389:3389,80:80 -r "role[base-windows],role[fourthcoffee-classic]"
  4. Would love to be able to reboot safely – save the resource collection back to the server and resume from point of rebot
  5. Use as guard expressions on other resources
  6. Direct mapping between DSC and Chef resources Mix and match!