DevOps and Windows

27
DevOps and Windows

description

My presentation for the October meeting of the Cleveland DevOps MeetUp group. Based on my experience of using Chef on Windows

Transcript of DevOps and Windows

Page 1: DevOps and Windows

DevOps and Windows

Page 2: DevOps and Windows

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

Page 3: DevOps and Windows

Windows automation

Management in past were batch and command files along with Ghost an Ghost walker

Altiris

POSH

System Center

Page 4: DevOps and Windows
Page 5: DevOps and Windows

My TaskFind 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

Page 6: DevOps and Windows

Challenges Part 1Not a developer - I didn’t know Ruby

I didn’t know anything about Puppet or Chef

Page 7: DevOps and Windows

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

Page 8: DevOps and Windows

My Dev EnvironmentMacbook 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

Page 9: DevOps and Windows

Use Version Control

Page 10: DevOps and Windows

Chef and Windows

• Chef provided cookbooks • chef_handler-1.16 • powershell-3.0.7 - pulls in ms_dotnet • windows-1.34.6

Page 11: DevOps and Windows

Using Chef with Windows

• Reboots • Roles and Features • PageFile • Registry • Installing Software

Page 12: DevOps and Windows

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

Page 13: DevOps and Windows

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

Page 14: DevOps and Windows

Using windows_reboot

Page 15: DevOps and Windows

Install Roles and Features

• DISM - windows_feature

• PowerShell - powershell_script

• Caveat with PowerShell, if role/feature needs a reboot, you have to separate them

Page 16: DevOps and Windows

DSIM - windows_feature

Page 17: DevOps and Windows

powershell_script

Page 18: DevOps and Windows

Windows Pagefile• Use Ohai to grab total memory

• Differs between OS and Hypervisor

• Differs between XenServer and vSphere

• Differs between W2k8R2 and W2012/2012r2

Page 19: DevOps and Windows

Case Statement for Pagefile

Page 20: DevOps and Windows

Setting Pagefile - 4GB

Page 21: DevOps and Windows

Registry

• using registry_key to set registry setting

• Include recursive true

• Use attributes for actual keys

• use ‘/‘ or ‘\\' for ruby to recognize the path

Page 22: DevOps and Windows

Set registry settingsAttribute

Recipe

Page 23: DevOps and Windows

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

Page 24: DevOps and Windows

Installing filezilla - Standalone

Page 25: DevOps and Windows

Install Citrix XenDesktop

Page 26: DevOps and Windows

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.

Page 27: DevOps and Windows

Test to prevent this