31
Chef Loves Windows Mat Schaffer, ALT.NET – Nov, 2011 slideshare.net/matschaffer/chef-loves-windows

chef loves windows

Embed Size (px)

Citation preview

Page 1: chef loves windows

Chef Loves WindowsMat Schaffer, ALT.NET – Nov, 2011

slideshare.net/matschaffer/chef-loves-windows

Page 2: chef loves windows

Our agenda

• Me

• You

• Old cars and automation

• How chef works

• Setting up Chef

• An Example deployment (Node.js)

Page 3: chef loves windows

Mat Schaffergithub.com/matschaffer

@matschaffer

Page 4: chef loves windows

(for hire)

Page 5: chef loves windows

•Linux System Administration

•Ruby on Rails

•Chef

•Chef on Win2k3 via Cygwin

Page 6: chef loves windows

You

Page 7: chef loves windows

Your CM

Page 8: chef loves windows

Expensive ($2k-$3k)

Hand made

12.5 hours

Page 9: chef loves windows

$850

Heavily Automated

1.5 hours

Page 10: chef loves windows

“Most tech companies are essentially American auto companies pre-Ford.”

- Trotter Cashion

250 early car companies failed by 1930*

Page 11: chef loves windows

Chef

Page 12: chef loves windows

(Chef server)

my_cookbook├── README.rdoc├── attributes├── definitions├── files│   └── default├── libraries├── metadata.rb├── providers├── recipes│   └── default.rb├── resources└── templates └── default

my_cookbook├── README.rdoc├── attributes├── definitions├── files│   └── default├── libraries├── metadata.rb├── providers├── recipes│   └── default.rb├── resources└── templates └── default

my_cookbook

$ chef-client

$ chef-client

my_cookbook

my_cookbook

$ chef-server

Page 13: chef loves windows

cookbook

role

node

Page 14: chef loves windows

Step 1: Get a Chef server

Page 15: chef loves windows

http://manage.opscode.com

Page 17: chef loves windows

Step 2: Get some cookbooks

Page 18: chef loves windows

Cookbooks?

Page 19: chef loves windows
Page 20: chef loves windows

http://community.opscode.com

Page 21: chef loves windows

github.com/matschaffer/chef-loves-windows

Thanks toDoug MacEachern (VMware)

&Seth Chisamore (OpsCode)

Page 22: chef loves windows

git clone \ https://github.com/matschaffer/chef-loves-windows.git

cd chef-loves-windows

### configure knife

knife cookbook upload -a

for ROLE in roles/*.rb; do knife role from file $ROLE;done

Page 23: chef loves windows

Step 3: Prepare a server

Page 24: chef loves windows

WinRM

REM Configure itwinrm quickconfig -q

REM A chef run uses some memory, let it.winrm set winrm/config/winrs @{MaxMemoryPerShellMB="300"}

REM A chef run also takes some time, let it.winrm set winrm/config @{MaxTimeoutms="1800000"}

REM For dev/testing allow unencrypted basic authwinrm set winrm/config/service @{AllowUnencrypted="true"}winrm set winrm/config/service/auth @{Basic="true"}

Page 25: chef loves windows

WinSSHD

Cygwin

FreeSSHd

Or SSH

Page 26: chef loves windows

gem install knife-windows

knife bootstrap windows winrm $HOST -r “role[$ROLE]” \ -x Administrator -P $PASSWORD

knife winrm -m $HOST -x Administrator -P $PASSWORD \ ‘chef-client -c c:/chef/client.rb’

knife bootstrap windows ssh $HOST -r “role[$ROLE]” \ -x Administrator -i $KEY

knife ssh -m $HOST -x Administrator -i $KEY \ ‘chef-client -c c:/chef/client.rb’

github.com/opscode/knife-windows

Page 27: chef loves windows

C:\> w32tm /resync$ ntpdate pool.ntp.org

Page 28: chef loves windows

42!

Page 29: chef loves windows
Page 30: chef loves windows

Wrap-UP

• Automation can save your business

• CM is a key part of your stack

• Opscode.com and EC2 is all you need

• Yes, it works on windows

Page 31: chef loves windows

Thank youquestions?

github.com/matschaffer

@matschaffer