2. Who am I?
Left the corp world for a Solution/Service Provider in 2011
Prior to 2011, primarily focused on Windows and Citrix
Now Linux, Chef, vCloud and Apace CloudStack/Citrix
CloudPlatform as well as above. Prefer XenServer
http://twitter.com/pigram86
http://www.todpigram.com
http://github.com/pigram86
3. Windows automation
Management in past were batch and command files
along with Ghost an Ghost walker
Altiris
POSH
System Center
4.
5. My Task
Find a tool to use with both Linux and Windows
Needed to work with vCloud and CloudStack
Provide Configuration Management and Desired State Config
Be consistent and repeatable
Be efficient and quick
Puppet vs Chef - my choices
6. Challenges Part 1
Not a developer - I didn’t know Ruby
I didn’t know anything about Puppet or Chef
7. Learning
Went to www.codeacademy.com and took the Ruby portion
Bought a Infinite Skills Ruby for Beginners course on
www.udemy.com
Sat through both Puppetlabs learning course and the
learnchef.getchef.com training
Built both the free open source version of Puppet Server and Chef
Server in home lab
Started coding with both on Windows as most of my customers are
Windows based
8. My Dev Environment
Macbook Pro 13” mid-2012 OS X 10.10
Chefdk
git
chruby with ruby-build - ruby 2.1.2/1.9.3
Vagrant, Veewee, Packer, Bento
Berkshelf and Test-kitchen with kitchen-driver-vagrant_provision, foodcritic
MDT server - for Autounattend.xml - both for builds and templates
Virtualbox and VMware Fusion
Sublime Text 3 with package control - Chef, DashDoc, Sublime-rubocop
Dash
10. Chef and Windows
• Chef provided cookbooks
• chef_handler-1.16
• powershell-3.0.7 - pulls in ms_dotnet
• windows-1.34.6
11. Using Chef with Windows
• Reboots
• Roles and Features
• PageFile
• Registry
• Installing Software
12. Reboots
• Both Puppet and Chef were working great until I
started combining recipes/modules in a continuous run
list.
• Major issue…neither handled pending reboots
13. reboot_pending.rb
• Alex Vinyar (Chef) provided me with a library file to
handle pending reboots. This was added to Chef Client
11.12
• I still use it in all my cookbooks
15. Install Roles and Features
• DISM - windows_feature
• PowerShell - powershell_script
• Caveat with PowerShell, if role/feature needs a reboot,
you have to separate them
18. Windows Pagefile
• Use Ohai to grab total memory
• Differs between OS and Hypervisor
• Differs between XenServer and vSphere
• Differs between W2k8R2 and W2012/2012r2
21. Registry
• using registry_key to set registry setting
• Include recursive true
• Use attributes for actual keys
• use ‘/‘ or ‘' for ruby to recognize the path
23. Installing Software
• using windows_package
• using batch and windows_zipfile
• Installing standalone software
• Installing software that requires the entire ISO
• Always use not_if and only_if for idempotence
• use attributes
26. Testing
For Linux - test kitchen
For Windows mostly utilizing my home chef server and
my custom windows boxes for Vagrant
I use Veewee to create the VM, then export to .box.
Chef-Client is installed as well as service.