Slide 1

Slide 1 text

Automating the Cloud Mat Schaffer, Code Camp 2012.1 – May, 2012

Slide 2

Slide 2 text

Our agenda • Me • You • Old cars • How Chef works • Setting up Chef • An Example deployment

Slide 3

Slide 3 text

Mat Schaffer about.me/matschaffer

Slide 4

Slide 4 text

(for hire)

Slide 5

Slide 5 text

•Linux Sys Admin •Ruby on Rails •Chef •Chef on Windows

Slide 6

Slide 6 text

You

Slide 7

Slide 7 text

Automation & You

Slide 8

Slide 8 text

Expensive ($2k-$3k) Hand made 12.5 hours

Slide 9

Slide 9 text

$850 Heavily Automated 1.5 hours

Slide 10

Slide 10 text

“Most tech companies are essentially American auto companies pre-Ford.” - Trotter Cashion 250 early car companies failed by 1930*

Slide 11

Slide 11 text

Continuous Delivery

Slide 12

Slide 12 text

“... continuous delivery will move from being a competitive advantage to being a prerequisite for survival.” - Jez Humble

Slide 13

Slide 13 text

Chef

Slide 14

Slide 14 text

(Chef server) b my_cookbook $ chef-client $ chef-client my_cookbook my_cookbook $ chef-server my_cookbook ├── README.rdoc ├── attributes ├── definitions ├── files │ └── default ├── libraries ├── metadata.rb ├── providers ├── recipes │ └── default.rb ├── resources └── templates └── default

Slide 15

Slide 15 text

cookbook role node environment

Slide 16

Slide 16 text

Step 1: Get a Chef server

Slide 17

Slide 17 text

http://manage.opscode.com

Slide 18

Slide 18 text

http://devops.mashion.net/chef-install

Slide 19

Slide 19 text

Step 2: Set up your workstation

Slide 20

Slide 20 text

wiki.opscode.com/display/ chef/Workstation+Setup

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

No content

Slide 23

Slide 23 text

No content

Slide 24

Slide 24 text

Step 3: Get some cookbooks

Slide 25

Slide 25 text

Cookbooks?

Slide 26

Slide 26 text

No content

Slide 27

Slide 27 text

http://community.opscode.com

Slide 28

Slide 28 text

gem install librarian librarian-chef install

Slide 29

Slide 29 text

github.com/matschaffer/ automating-the-coud

Slide 30

Slide 30 text

git clone https://github.../matschaffer/automat... cd automating-the-cloud librarian-chef install knife cookbook upload -a knife role from file .\roles\*

Slide 31

Slide 31 text

Step 4: Prepare a server

Slide 32

Slide 32 text

WinRM # Configure it winrm quickconfig -q # A chef run uses some memory, let it. winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="300"}' # A chef run also takes some time, let it. winrm set winrm/config '@{MaxTimeoutms="1800000"}' # For dev/testing allow unencrypted basic auth winrm set winrm/config/service '@{AllowUnencrypted="true"}' winrm set winrm/config/service/auth '@{Basic="true"}'

Slide 33

Slide 33 text

WinSSHD Cygwin FreeSSHd Or SSH

Slide 34

Slide 34 text

gem install knife-windows knife bootstrap windows winrm $HOST -r “role[$ROLE]” \ -x Administrator -P $PASSWORD -N $NAME 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 -N $NAME knife ssh -m $HOST -x Administrator -i $KEY \ ‘chef-client -c c:/chef/client.rb’ github.com/opscode/knife-windows

Slide 35

Slide 35 text

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

Slide 36

Slide 36 text

default_attributes iis: { accept_eula: true }

Slide 37

Slide 37 text

knife bootstrap ... -N app1 # at least on EC2

Slide 38

Slide 38 text

No content

Slide 39

Slide 39 text

Wrap-UP • Automation can save your business • CM is a key part of your stack • You can get started today with AWS & OpsCode Chef

Slide 40

Slide 40 text

Thank you Ask a question, get a prize? about.me/matschaffer Online evaluations!