Upload
mat-schaffer
View
3.160
Download
4
Tags:
Embed Size (px)
Citation preview
Chef Loves WindowsMat Schaffer, ALT.NET – Nov, 2011
slideshare.net/matschaffer/chef-loves-windows
Our agenda
• Me
• You
• Old cars and automation
• How chef works
• Setting up Chef
• An Example deployment (Node.js)
Mat Schaffergithub.com/matschaffer
@matschaffer
(for hire)
•Linux System Administration
•Ruby on Rails
•Chef
•Chef on Win2k3 via Cygwin
You
Your CM
Expensive ($2k-$3k)
Hand made
12.5 hours
$850
Heavily Automated
1.5 hours
“Most tech companies are essentially American auto companies pre-Ford.”
- Trotter Cashion
250 early car companies failed by 1930*
Chef
(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
cookbook
role
node
Step 1: Get a Chef server
http://devops.mashion.net/chef-install
Step 2: Get some cookbooks
Cookbooks?
github.com/matschaffer/chef-loves-windows
Thanks toDoug MacEachern (VMware)
&Seth Chisamore (OpsCode)
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
Step 3: Prepare a server
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"}
WinSSHD
Cygwin
FreeSSHd
Or SSH
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
C:\> w32tm /resync$ ntpdate pool.ntp.org
42!
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
Thank youquestions?
github.com/matschaffer
@matschaffer