5. 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)
6. 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…
7.
8. $ knife solo cook -o recipe[hdeone]
srv1.example.com
knife-solo make it possible to test
recipes speedy and easily
You also can assemble recipes by
Role
(cook –o role[base])
9. Puppet
package { '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'],
}
and we often forget to specify…
Chef
package 'ganglia-gmond'
template '/etc/ganglia/gmond.conf' do
notifies :restart, 'service[gmond]'
end
Just recognized by order
service 'gmond' do
supports :status => true, :restart => true, :reload => true
action [:start, :enable]
end
10. 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 do
device device_path
fstype 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
11.
12.
13. It is a simple reason.
We would like to use a better tool.
Chef Puppet
Hi.
How is everyone?
Since there is 10 minutes break after this,
please give your five minutes to me.
And, hello again!
As you know, my name is Yuu Yamanaka.
I’m in DevOps unit of SEG dept.
I’ll speak about Why –
However before explaining that,
I’ll speak Why did
For the first, we have started to use Puppet from 2012/04,
This is the image which is created by me when introduce Puppet to the SEG members
Of course, both Puppet ….
But I thought Chef is for Rubyist
Puppet was convenient,
But some points stressed us
1st, we can’t apply a part of manifests to remote with Puppet
It means we have to apply all manifests to a node, it takes long time
2nd we have to …, I’ll explain it later
3rd Puppet has own and wordy syntax
Chef can apply partal recipes to nodes by Chef’s knife command.
It make
And convention over configuration,
In Japanese “設定よりも規約”
We can write flexible defninitions by Ruby.
I said we are not Rubiest but Pythonista, however I realized,
we can learn Ruby syntax when writing recipes!
And the cooking log is human readable than Puppet.