Slide 1

Slide 1 text

DevOps, Puppet & Chef (from susestudio.com's perspective)

Slide 2

Slide 2 text

I'm James Tan @jamestyj on Twitter & Github blog.susestudio.com Engineering Manager @

Slide 3

Slide 3 text

Where I'm from... Singapore! (but living in Germany)

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

What I work on...

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

Appliance / Image

Slide 11

Slide 11 text

SUSE Cloud

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

DevOps

Slide 23

Slide 23 text

I want change! I want stability! Wall of Confusion Development Operations

Slide 24

Slide 24 text

Wall of Confusion Development Operations

Slide 25

Slide 25 text

Wall of Confusion Development Operations

Slide 26

Slide 26 text

Communication Collaboration Integration Automation

Slide 27

Slide 27 text

We have change without pain We're in it together! Development Operations

Slide 28

Slide 28 text

Continuous deployments Continuous (automated) builds, integration, tests, and deployments

Slide 29

Slide 29 text

0 10 20 30 40 50 60 susestudio.com deployments (per month) Jun 2009 to Sep 2012 Deployments Continuous deployments!

Slide 30

Slide 30 text

Configuration Management is not easy

Slide 31

Slide 31 text

No content

Slide 32

Slide 32 text

No content

Slide 33

Slide 33 text

What happens when the server crashes? How do you scale this to other servers? How do you deploy to other data centers or to the cloud?

Slide 34

Slide 34 text

Infrastructure as Code Repeatable Scalable Maintainable

Slide 35

Slide 35 text

Infrastructure as Code Version control Peer code reviews Tests

Slide 36

Slide 36 text

vs

Slide 37

Slide 37 text

Flavors Serverless Puppet Master/Agent Puppet Puppet Enterprise Chef Solo Chef Client & Server Private Chef Hosted Chef

Slide 38

Slide 38 text

Installing on openSUSE 12.2 # Installing Puppet > zypper ar http://download.opensuse.org/repositories\ /systemsmanagement:/puppet/openSUSE_12.2/ Puppet > zypper in puppet # Installing Chef > zypper ar http://download.opensuse.org/repositories\ /systemsmanagement:/chef/openSUSE_12.2/ Chef > zypper in rubygem-chef

Slide 39

Slide 39 text

Puppet quickstart (serverless) > vim test.pp file { 'testfile-puppet': path => '/tmp/testfile-puppet', ensure => present, mode => '0640', content => "I'm a test file.\n" } > puppet apply test.pp

Slide 40

Slide 40 text

Chef quickstart (solo) > knife cookbook create test > vim /var/chef/cookbooks/test/recipes/default.rb file "/tmp/testfile-chef" do mode "0640" content "I'm a test file.\n" action :create end > chef-solo -o test -N test

Slide 41

Slide 41 text

Puppet package, file, service package { 'openssh-server': ensure => present, before => File['/etc/ssh/sshd_config'] } file { '/etc/ssh/sshd_config': ensure => file, mode => '0600', source => 'sshd_config' } service { 'sshd': ensure => running, enable => true, hasrestart => true, hasstatus => true, subscribe => File['/etc/ssh/sshd_config'] } Ensure order!

Slide 42

Slide 42 text

Chef package, file, service package "openssh-server" do action :install end cookbook_file "/etc/ssh/sshd_config" do source "sshd_config" mode "0600" end service "sshd" do supports :status => true, :restart => true action [ :enable, :start ] subscribes :reload, resources( "cookbook_file[/etc/ssh/sshd_config]") end

Slide 43

Slide 43 text

Puppet vs Chef package, file, service package { 'openssh-server': ensure => present, before => File['/etc/ssh/sshd_config'] } file { '/etc/ssh/sshd_config': ensure => file, mode => '0600', source => 'sshd_config' } service { 'sshd': ensure => running, enable => true, hasrestart => true, hasstatus => true, subscribe => File['/etc/ssh/sshd_config'] } package "openssh-server" do action :install end cookbook_file "/etc/ssh/sshd_config" do source "sshd_config" mode "0600" end service "sshd" do supports :status => true, :restart => true action [ :enable, :start ] subscribes :reload, resources( "cookbook_file[/etc/ssh/sshd_config]") end

Slide 44

Slide 44 text

Resources Puppet & Chef: cron, exec/execute, file, group, mount, package, service, user Puppet: augeas, host, interface, nagios_command, ssh_authorized_key, sshkey, zfs, zone, … Chef: deploy, directory, env, git, HTTP request, Link, log, route, Ruby block, subversion, ...

Slide 45

Slide 45 text

Puppet & Chef templates (ERB) # Puppet manifest: balancer.pp $nodes = [ "node100", "node101", "node102" ] file { '/etc/apache/balancer.conf': path => '/etc/apache/balancer.conf', ensure => file, content => template("balancer.erb") } # Chef recipe: balancer.rb template "/etc/apache/balancer.conf" do source "balancer.erb" variables({ :nodes => ["node100", "node101", "node102"] }) end

Slide 46

Slide 46 text

Puppet & Chef templates (ERB) # Template: balancer.erb <% nodes.each do |node| -%> BalancerMember http://<%= node %>.cluster.xs:81 <% end -%> # Output: /etc/apache/balancer.conf BalancerMember http://node100.cluster.xs:81 BalancerMember http://node101.cluster.xs:81 BalancerMember http://node102.cluster.xs:81

Slide 47

Slide 47 text

Code reuse Puppet modules Manifests Files Libraries Templates (ERB) Chef cookbooks Recipes File Distribution Libraries Templates (ERB) Attributes Definitions Lightweight Resources & Providers (LWRP) Metadata

Slide 48

Slide 48 text

Puppet Master / Agent Puppet Master Workstation Nodes Git Git MCollective PuppetDB Puppet Dashboard Puppet Agent Facter

Slide 49

Slide 49 text

No content

Slide 50

Slide 50 text

Chef Server / Client Chef API server Workstation Nodes Git knife Chef Indexer (Solr) Chef Web UI Chef Client Ohai CouchDB RabbitMQ knife (ssh)

Slide 51

Slide 51 text

No content

Slide 52

Slide 52 text

No content

Slide 53

Slide 53 text

Other concepts Puppet Classes External Node Classifier (ENC) Chef Roles Run lists (Encrypted) Databags Search

Slide 54

Slide 54 text

We're moving from Puppet to Chef Why?

Slide 55

Slide 55 text

More maintainers needed!

Slide 56

Slide 56 text

Questions? Slides @ http://speakerdeck.com/u/jamestyj