Writing recipes for Windows typically involves taking a dependency on the platform-specific Windows cookbook, an artifact that has no real analog when authoring content for Unix-like systems. This requirement is changing starting with Chef 11, as more functionality and resources such as the registry resource formerly tied to the Windows cookbook are available in the core chef-client itself, thus reducing or eliminating the need to use the Windows cookbook. Additionally, the new implementations of the resources provide additional features that make recipes more predictable and robust on the Windows platform.
We’ll see some of this new capability in action, describe the motivation and what gets better, and look forward to additional Windows functionality that can be folded into chef-client.
Takeaways
All of us, Windows and non-Windows users alike, benefit when we rely less on the Windows cookbook
New resources for registry, powershell, and batch scripting are available without the Windows cookbook
These resources enable predictability for 32-bit / 64-bit (Wow64) difficulties
We should start changing our cookbooks to use the new resources
Chef-client as a Windows service is now robust and reliable, no Windows cookbook needed
This is just the beginning–let us know what should jump into core Chef next!
Slides from 08-27-2013 Opscode webinar on using Chef to automate your Microsoft Windows-based infrastructure, including a live demo of Windows automation and a review of the latest and greatest resources available for running Chef with Windows-based infrastructure.
Nordstrom has been using Chef to automate Windows environments. Come by this talk to get some tips and tricks for managing your Windows-based environment with Chef.
Tips such as:
Using Mixlib::Shellout and PowershellOut to execute Windows tools and scripts as a Domain user.
Windows cookbook improvements, including Printer LWRP
Diskpart cookbook
Chef-keypass for better one-way encryption of data-bag secrets, including certs and passwords
How to use Windows cookbook helpers
Using the new Windows Registry resource in Chef 11
Windows Sysnative for correctly locating Windows programs
Perf improvement numbers for Ruby 1.9.3 in Chef 11 for Windows
Recommended Ohai plugins to disable
Writing recipes for Windows typically involves taking a dependency on the platform-specific Windows cookbook, an artifact that has no real analog when authoring content for Unix-like systems. This requirement is changing starting with Chef 11, as more functionality and resources such as the registry resource formerly tied to the Windows cookbook are available in the core chef-client itself, thus reducing or eliminating the need to use the Windows cookbook. Additionally, the new implementations of the resources provide additional features that make recipes more predictable and robust on the Windows platform.
We’ll see some of this new capability in action, describe the motivation and what gets better, and look forward to additional Windows functionality that can be folded into chef-client.
Takeaways
All of us, Windows and non-Windows users alike, benefit when we rely less on the Windows cookbook
New resources for registry, powershell, and batch scripting are available without the Windows cookbook
These resources enable predictability for 32-bit / 64-bit (Wow64) difficulties
We should start changing our cookbooks to use the new resources
Chef-client as a Windows service is now robust and reliable, no Windows cookbook needed
This is just the beginning–let us know what should jump into core Chef next!
Slides from 08-27-2013 Opscode webinar on using Chef to automate your Microsoft Windows-based infrastructure, including a live demo of Windows automation and a review of the latest and greatest resources available for running Chef with Windows-based infrastructure.
Nordstrom has been using Chef to automate Windows environments. Come by this talk to get some tips and tricks for managing your Windows-based environment with Chef.
Tips such as:
Using Mixlib::Shellout and PowershellOut to execute Windows tools and scripts as a Domain user.
Windows cookbook improvements, including Printer LWRP
Diskpart cookbook
Chef-keypass for better one-way encryption of data-bag secrets, including certs and passwords
How to use Windows cookbook helpers
Using the new Windows Registry resource in Chef 11
Windows Sysnative for correctly locating Windows programs
Perf improvement numbers for Ruby 1.9.3 in Chef 11 for Windows
Recommended Ohai plugins to disable
This presentation was held at the DevOps Meetup Frankfurt on 2014/12/08. It describes some tools and practices for testing your infrastructure provisioned with Chef.
Infrastructure Automation with Chef & Ansiblewajrcs
What is Infrastructure and why you should automate it?
Typical Infrastructure
Benefits
CMS/ Automation
Chef / Terminologies / Disadvantages
Ansible / Disadvantages
Demo
Summary
Author: Waqar Alamgir; Twitter @wajrcs
This presentation starts with an introduction to the rationale behind automated deployments in Continuous Delivery and DevOps. Then, I compare agent-based architectures, such as Chef and Puppet with the agentless architecture of the server orchestration engine Ansible. The presentation concludes with an automated deployment of Dynatrace into a simulated production environment.
Ansible is tool for Configuration Management. The big difference to Chef and Puppet is, that Ansible doesn't need a Master and doesn't need a special client on the servers. It works completely via SSH and the configuration is done in Yaml.
These slides give a short introduction & motivation for Ansible.
Chef vs Puppet vs Ansible vs SaltStack | Configuration Management Tools Compa...Edureka!
This DevOps Tutorial takes you through what is Configuration Management all about and basic concepts of Infrastructure as code. It also compares the four most widely used Configuration Management tools i.e. Chef, Puppet, Ansible and SaltStack.
Check our complete DevOps YouTube playlist here: http://goo.gl/O2vo13
DevOps Tutorial Blog Series here: https://goo.gl/P0zAfF
Community Cookbooks & further resources - Fundamentals Webinar Series Part 6Chef
Part 6 of a 6 part series introducing you to the fundamentals of Chef.
This session includes an introducing Community Cookbooks and some additional resources.
After viewing this webinar you will be able to:
- Find, preview, and download cookbooks from the Chef Community site
- Use knife to work with the Community Site API
- Download, extract, examine and implement cookbooks from the Community site
Video of this webinar can be found at the following URL
https://www.youtube.com/watch?v=ovTIeS3kx4g&list=PL11cZfNdwNyPnZA9D1MbVqldGuOWqbumZ
Windows PowerShell Desired State Configuration (DSC) is taking the Windows Server world by storm. Chef has been on the bleeding edge of configuration management in the Windows space and now Chef can leverage DSC resources. Join me as we take a look at how DSC works in the context of a Chef run, what DSC resources are really made of, and how you can take best advantage of DSC in managing your Windows servers with Chef.
A Microsoft está dando muita importância e reconhecimento para as iniciativas OpenSource, um dos pontos que podemos salientar que colabora com essa afirmação é a quantidade de produtos OpenSource ofertados na plataforma de nuvem da Microsoft assim como a criação de uma subsidiária MSOpenTech e de uma fundação de Software livre que nasceu no Build recebendo o seu primeiro projeto o Roslyn compilador C# escrito em C#.
Aproveitando o momento que vivemos de movimentação para a nuvem pública e DevOps, apresento as dificuldades de implementação e algumas soluções OpenSource de DevOps.
Sim, a Microsoft usa Open Source em DevOpsDanilo Bordini
Entenda como as ferramentas open source, tais como Puppet, Chef, Jenkins, Vagrant se conectam ao Visual Studio e Azure para a criação de uma solução de DevOps
This presentation was held at the DevOps Meetup Frankfurt on 2014/12/08. It describes some tools and practices for testing your infrastructure provisioned with Chef.
Infrastructure Automation with Chef & Ansiblewajrcs
What is Infrastructure and why you should automate it?
Typical Infrastructure
Benefits
CMS/ Automation
Chef / Terminologies / Disadvantages
Ansible / Disadvantages
Demo
Summary
Author: Waqar Alamgir; Twitter @wajrcs
This presentation starts with an introduction to the rationale behind automated deployments in Continuous Delivery and DevOps. Then, I compare agent-based architectures, such as Chef and Puppet with the agentless architecture of the server orchestration engine Ansible. The presentation concludes with an automated deployment of Dynatrace into a simulated production environment.
Ansible is tool for Configuration Management. The big difference to Chef and Puppet is, that Ansible doesn't need a Master and doesn't need a special client on the servers. It works completely via SSH and the configuration is done in Yaml.
These slides give a short introduction & motivation for Ansible.
Chef vs Puppet vs Ansible vs SaltStack | Configuration Management Tools Compa...Edureka!
This DevOps Tutorial takes you through what is Configuration Management all about and basic concepts of Infrastructure as code. It also compares the four most widely used Configuration Management tools i.e. Chef, Puppet, Ansible and SaltStack.
Check our complete DevOps YouTube playlist here: http://goo.gl/O2vo13
DevOps Tutorial Blog Series here: https://goo.gl/P0zAfF
Community Cookbooks & further resources - Fundamentals Webinar Series Part 6Chef
Part 6 of a 6 part series introducing you to the fundamentals of Chef.
This session includes an introducing Community Cookbooks and some additional resources.
After viewing this webinar you will be able to:
- Find, preview, and download cookbooks from the Chef Community site
- Use knife to work with the Community Site API
- Download, extract, examine and implement cookbooks from the Community site
Video of this webinar can be found at the following URL
https://www.youtube.com/watch?v=ovTIeS3kx4g&list=PL11cZfNdwNyPnZA9D1MbVqldGuOWqbumZ
Windows PowerShell Desired State Configuration (DSC) is taking the Windows Server world by storm. Chef has been on the bleeding edge of configuration management in the Windows space and now Chef can leverage DSC resources. Join me as we take a look at how DSC works in the context of a Chef run, what DSC resources are really made of, and how you can take best advantage of DSC in managing your Windows servers with Chef.
A Microsoft está dando muita importância e reconhecimento para as iniciativas OpenSource, um dos pontos que podemos salientar que colabora com essa afirmação é a quantidade de produtos OpenSource ofertados na plataforma de nuvem da Microsoft assim como a criação de uma subsidiária MSOpenTech e de uma fundação de Software livre que nasceu no Build recebendo o seu primeiro projeto o Roslyn compilador C# escrito em C#.
Aproveitando o momento que vivemos de movimentação para a nuvem pública e DevOps, apresento as dificuldades de implementação e algumas soluções OpenSource de DevOps.
Sim, a Microsoft usa Open Source em DevOpsDanilo Bordini
Entenda como as ferramentas open source, tais como Puppet, Chef, Jenkins, Vagrant se conectam ao Visual Studio e Azure para a criação de uma solução de DevOps
An overview of Chef Automate and the various resources for Chef, InSpec and Habitat for Azure and Microsoft's other products. Presented September 20, 2017 at Tank Stream Labs.
Node object and roles - Fundamentals Webinar Series Part 3Chef
Part 3 of a 6 part series introducing you to the fundamentals of Chef.
This session includes:
* Node object
* Chef roles
After viewing this webinar you will be able to:
- Explain what the node object represents in Chef
- Show details about a node
- Describe what node attributes are
- Retrieve a node attribute
- Describe where and how attributes are set
- Explain the attribute merge order and precedence rules
- Declare an attribute with a recipe and set its value
- Explain what Roles are, and how they are used to provide -larity
- Discuss the Role JSON DSL
- Explain how merge order affects the precedence hierarchy
Video of this webinar can be found at the following URL
https://www.youtube.com/watch?v=nQogf89hgnM&list=PL11cZfNdwNyPnZA9D1MbVqldGuOWqbumZ
Configuration Management in the Cloud - AWS Online Tech TalksAmazon Web Services
Learning Objectives:
- Learn how to use AWS OpsWorks, AWS CodeDeploy, and AWS CodePipeline to build a reliable and consistent development pipeline
- Understand about continous integration and delivery for Infrastructure as Code
- Learn how to get started with these services.
Overview of Chef - Fundamentals Webinar Series Part 1Chef
This is an Overview of Chef. After viewing this webinar you will be able to:
- Describe how Chef thinks about Infrastructure Automation
- Define the following terms:
- Resource
- Recipe
- Node
- Run List
- Search
- Login to Hosted Chef
- Run `knife` commands from your workstation
Video of this webinar can be found at the following URL
https://www.youtube.com/watch?v=S5lHUpzoCYo&list=PL11cZfNdwNyPnZA9D1MbVqldGuOWqbumZ
Introduction to Infrastructure as Code & Automation / Introduction to ChefNathen Harvey
Your customers expect you to continuously deliver delightful experiences. This means that you’ll need to continuously deliver application and infrastructure updates. Hand-crafted servers lovingly built and maintained by a system administrator are a thing of the past. Golden images are fine for initial provisioning but will quickly fail as your configuration requirements change over time.
It’s time for you to fully automate the provisioning and management of your infrastructure components. Welcome to the world of infrastructure as code! In this new world, you’ll be able to programmatically provision and configure the components of your infrastructure.
Disposable infrastructure whose provisioning, configuration, and on-going maintenance is fully automated allow you to change the way you build and deliver applications. Move your applications and infrastructure towards continuous delivery.
In this talk, we’ll explore the ideas behind “infrastructure as code” and, specifically, look at how Chef allows you to fully automate your infrastructure. If you’re brave enough, we’ll even let you get your hands on some Chef and experience the delight of using Chef to build and deploy some infrastructure components.
AWS re:Invent 2016: Configuration Management in the Cloud (DEV305)Amazon Web Services
To ensure that your application operates in a predictable manner in both your test and production environments, you must vigilantly maintain the configuration of your resources. By leveraging configuration management solutions, Dev and Ops engineers can define the state of their resources across their entire lifecycle. In this session, we will show you how to use AWS OpsWorks, AWS CodeDeploy, and AWS CodePipeline to build a reliable and consistent development pipeline that assures your production workloads behave in a predictable manner.
My slides of my talk at WordSesh 2014.
A talk about a few projects and the lessons I learned from them.
Checkout wordsesh.org for more information about this event.
In this talk, I riff on various jobs you can do with your DevOps knowledge that aren't more of the same (or moving into software engineering). These include sales engineering, consulting, product management, product marketing, and more.
Pull, Don't Push! Sensu Summit 2018 TalkJulian Dunn
Architectures for monitoring and configuration in a microservices era. A talk given by Julian Dunn and Fletcher Nichol at Sensu Summit 2018 in Portland, Oregon.
Hello everyone! I am thrilled to present my latest portfolio on LinkedIn, marking the culmination of my architectural journey thus far. Over the span of five years, I've been fortunate to acquire a wealth of knowledge under the guidance of esteemed professors and industry mentors. From rigorous academic pursuits to practical engagements, each experience has contributed to my growth and refinement as an architecture student. This portfolio not only showcases my projects but also underscores my attention to detail and to innovative architecture as a profession.
Can AI do good? at 'offtheCanvas' India HCI preludeAlan Dix
Invited talk at 'offtheCanvas' IndiaHCI prelude, 29th June 2024.
https://www.alandix.com/academic/talks/offtheCanvas-IndiaHCI2024/
The world is being changed fundamentally by AI and we are constantly faced with newspaper headlines about its harmful effects. However, there is also the potential to both ameliorate theses harms and use the new abilities of AI to transform society for the good. Can you make the difference?
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
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
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
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
We have many others.
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.
Download and unpack nopCommerce, set up its permissions properly
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...
Again, reiterate what a “resource” is in the context of Chef
Not gonna show “batch” in this webinar, just mention that “batch” is for running CMD.EXE format scripts
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.