14
HDE, Inc. SEG dept. Yuu Yamanaka Chef Puppet

Why we are migrating to Chef from Puppet

Embed Size (px)

DESCRIPTION

I've made a 5 mins LT with this slides on 2014/11/21 in HDE, Inc.

Citation preview

Page 1: Why we are migrating to Chef from Puppet

HDE, Inc. SEG dept.Yuu Yamanaka

Chef Puppet

Page 2: Why we are migrating to Chef from Puppet

An engineer of SEG dept. DevOps unit

(6 years career in HDE)

Yuu Yamanaka

Page 3: Why we are migrating to Chef from Puppet

Chef PuppetBefore explaining that,

Page 4: Why we are migrating to Chef from Puppet

Puppet

Page 5: Why we are migrating to Chef from Puppet

We have started to use Puppet from 2012/04

At the time, Chef was not popular and proven than Puppet

We were not Rubyist but Pythonista

(Of course, both Puppet and Chef are made by Ruby)

Page 6: Why we are migrating to Chef from Puppet

Can not apply a part of manifests to a node

Have to write all dependencies for each resources

Own and wordy syntax

Puppet

But some points stressed us…

Page 7: Why we are migrating to Chef from Puppet
Page 8: Why we are migrating to Chef from Puppet

knife-solo make it possible to test recipes speedy and easily

You also can assemble recipes by Role(cook –o role[base])

$ knife solo cook -o recipe[hdeone] srv1.example.com

Page 9: Why we are migrating to Chef from Puppet

Puppetpackage { 'ganglia-gmond':

ensure => latest,}

service { 'gmond':ensure => running,enable => true,hasstatus => true,hasrestart => true,require => Package['ganglia-gmond'],

}file { '/etc/ganglia/gmond.conf':

ensure => file,content => template(“path/to/gmond.conf.erb”),require => Package['ganglia-gmond'],notify => Service['gmond'],

}

Chef

package 'ganglia-gmond'

template '/etc/ganglia/gmond.conf' donotifies :restart, 'service[gmond]'

end

service 'gmond' dosupports :status => true, :restart => true, :reload => trueaction [:start, :enable]

end

Just recognized by order

and we often forget to specify…

Page 10: Why we are migrating to Chef from Puppet

ephemerals = node['ec2'].select { |k, _|k.start_with?('block_device_mapping_ephemeral')

} .map { |k, v| [k.split('_').last, "/dev/#{v}"] }

ephemerals.each { |name, device_path|execute 'mkfs' do

command "mkfs -t #{node['ec2']['ephemeral']['fstype']} #{device_path}"

not_if "grep -qs #{device_path} /proc/mounts"end

mount_point = "/media/#{name}"directory mount_point # create mount point

mount mount_point dodevice device_pathfstype node['ec2']['ephemeral']['fstype']action [:mount, :enable]

end}

%w(main.cf master.cf).each do |conf|template "/etc/postfix/#{conf}" do

notifies :restart, 'service[postfix]'end

end

We are learning Ruby syntax when writing recipes

Page 11: Why we are migrating to Chef from Puppet
Page 12: Why we are migrating to Chef from Puppet
Page 13: Why we are migrating to Chef from Puppet

It is a simple reason.

We would like to use a better tool.

Chef Puppet

Page 14: Why we are migrating to Chef from Puppet

Stay CreativeLive Comfortably

(from DevOps Unit's creed)

END