Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Puppet & Chef
Search
Shinya Tsunematsu
June 21, 2013
Programming
12
3.6k
Puppet & Chef
新卒研修でやった座学の内容。
既に Puppet & serverspec で研修を進めていたので、まとめと周辺知識の関連付け。
Shinya Tsunematsu
June 21, 2013
Tweet
Share
More Decks by Shinya Tsunematsu
See All by Shinya Tsunematsu
GMOペパボでのSREの実践 / SRE Practices of GMO Pepabo, Inc.
tnmt
3
4.5k
ペパボサービスインフラの今までこれから / pepabo infra past and future
tnmt
3
640
知らなかった、時に困るWebサービスのセキュリティ対策 / Where Do We Start With Information Security?
tnmt
19
9.2k
IaaSをいじっている人が PaaSについて考えたこと / Should We Prepare Own PaaS?
tnmt
5
2.1k
成長を支援する “ふりかえり”の技術 / How to lockback using "furik"
tnmt
7
1.6k
こんにちわ福岡 / hello-fukuoka
tnmt
0
1.2k
Inside Nyah & Future - A case of "Private Cloud" using OpenStack -
tnmt
0
250
OpenStackクラスタ間マイグレーション事例 Havana to Mitaka / OpenStack Migration Case (Shift from Havana to Mitaka)
tnmt
1
1.1k
ペパボのプライベートクラウド "Nyah" その後 / Pepabo's PrivateCloud "Nyah" After That
tnmt
8
13k
Other Decks in Programming
See All in Programming
return文におけるstd::moveについて
onihusube
1
1.4k
선언형 UI에서의 상태관리
l2hyunwoo
0
250
Запуск 1С:УХ в крупном энтерпрайзе: мечта и реальность ПМа
lamodatech
0
850
競技プログラミングへのお誘い@阪大BOOSTセミナー
kotamanegi
0
390
KubeCon + CloudNativeCon NA 2024 Overviewat Kubernetes Meetup Tokyo #68 / amsy810_k8sjp68
masayaaoyama
0
290
rails newと同時に型を書く
aki19035vc
3
490
ゆるやかにgolangci-lintのルールを強くする / Kyoto.go #56
utgwkk
2
720
命名をリントする
chiroruxx
1
540
PHPで学ぶプログラミングの教訓 / Lessons in Programming Learned through PHP
nrslib
4
1k
Zoneless Testing
rainerhahnekamp
0
150
React 19でお手軽にCSS-in-JSを自作する
yukukotani
5
530
バグを見つけた?それAppleに直してもらおう!
uetyo
0
210
Featured
See All Featured
What's in a price? How to price your products and services
michaelherold
244
12k
Faster Mobile Websites
deanohume
305
30k
The Language of Interfaces
destraynor
155
24k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Into the Great Unknown - MozCon
thekraken
34
1.6k
Git: the NoSQL Database
bkeepers
PRO
427
64k
Designing for humans not robots
tammielis
250
25k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3.1k
How to Think Like a Performance Engineer
csswizardry
22
1.3k
Optimising Largest Contentful Paint
csswizardry
33
3k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
127
18k
Music & Morning Musume
bryan
46
6.3k
Transcript
2013/06/21 @tnmt Puppet Chef ͷجૅ ͳΜͰඞཁͳͷͱ͔
ຊͷΞδΣϯμ ✤ Puppet, Chefͱ ✤ Puppet, Chefͷඞཁੑ ✤ Puppet, Chefͷߏ
✤ ΠϯϑϥͷίʔυԽͱͦͷपลࣝ
Puppet, Chefͱ
Puppet, Chef ✤ Provisioning Framework < Configuration Management Framework
Configuration Management ✤ ߏཧͷλεΫྫ ✤ ωοτϫʔΫઃఆ ✤ Ϣʔβ࡞ɾཧ ✤ ιϑτΣΞΠϯετʔϧઃఆ
✤ ͜ΕΒΛ”͋Δ͖ঢ়ଶ”ʹҡ࣋͢Δ͜ͱ͕ߏཧ ✤ ͦΕΛ࣮ݱ͢ΔͨΊͷπʔϧ͕Puppet, Chef
Puppet, Chefͷඞཁੑ
ৄ͘͠ ✤ mizzy͞ΜͷPuppet࿈ࡌॳճ http://gihyo.jp/admin/serial/01/ puppet/0001 ✤ antipop͞Μͷ”ೖPuppet”ୈ1ষ ʮͳͥPuppet͕ඞཁͳͷ͔ʁʯ ✤
Λࢀߟʹ…͍ͬͯ͏ͱ͋ΕͳͷͰ࣮ࡍಡΈ߹Θͤ
ߏཧλεΫͷ࣮ݱํ๏ʢ̍ʣ ✤ खॱॻʹΑΔखಈઃఆ ✤ ख࡞ۀʹΑΔ࣌ؒͷϩε ✤ ΦϖϨʔγϣϯϛεͷՄೳੑ ✤ खॱॻͷߋ৽Εɺܗ֚Խɺ߹ੑҡ͕͍࣋͠
ߏཧλεΫͷ࣮ݱํ๏ʢ̎ʣ ✤ εΫϦϓτʹΑΔࣗಈԽ ✤ εΫϦϓτͷ࣭ҡ͕࣋ݸਓͷεΩϧʹΑΔ ✤ ߏมߋͷै͕͍͠ʢޙड़͢Δႈੑʣ
͜͜Ͱ ✤ खॱॻ͕ͻͲ͍ͱ͜ΖΛݟͤΔʢٽ͖ͳ͕Βʣ
Chef, Puppetେࣄɾخ͍͜͠ͱ ✤ ႈੑ ✤ ίʔυ࣭ͷۉҰԽ ✤ ίϥϘϨʔγϣϯՄೳ
ႈੑ ✤ Կ࣮ߦͯ͠ಉ͡ঢ়ଶʹͳΔ͜ͱ ✤ ৽نɾطଘʹରͯ͠ͷૢ࡞Ͱಉ͡
ίʔυ࣭ͷۉҰԽ ✤ େମ୭͕ॻ͍ͯࣅͨΑ͏ͳײ͡ʹͳΔ ✤ ݚमͰ࡞ͬͯΔ manifest ݟͯͦ͏ͩΑͶʁ ✤ ଞͷਓ͕ॻ͍ͯΔͷΛݟΕେମԿͬͯΔ͔͔Δ ✤
ී௨ʹ͍ͬͯΕݸਓͷεΩϧʹ͋Μ·Γࠨӈ͞Εͳ͍ ✤ ෳࡶͳه๏ॻ͖࢝ΊΔͱ·ͨผ͚ͩͲ…
ίϥϘϨʔγϣϯՄೳ ✤ ΤϯδχΞಉ࢜Ͱ૬ޓʹվળ͕Մೳ ✤ Opsಉ࢜ͰɻDev͕ॻ͍͍͍ͨͬͯ (DevOps) ✤ VCSΛ༻͍ͨվળ (Pull Request,
ϨϏϡʔ) ✤ Մೳͱ͍͏ϝϦοτ
Puppet, Chefͷߏ
Puppet, Chefͷൺֱ ݴޠ σΟϨΫτϦߏ Puppet ֎෦DSL ൺֱతࣗ༝ Chef ෦DSL (Ruby)
ܾ·͍ͬͯΔ
ͱ͍͑ ✤ ઌ΄Ͳͷ֤ϓϩμΫτͷ༷తͳͱ͜ΖͷൺֱͰ ✤ ʢೖ Puppet ʹهࡌͯ͋͠Δʣ ✤ ࣮ࡍʹఏڙ͞ΕΔػೳͱͯ͠େ͖ࠩ͘ͳ͍ ✤
Ҏ߱ڞ௨͍ͯ͠Δӡ༻ʢ͍ํʣͷઆ໌
Master, Agentܕ ✤ Puppetͷmanifest, Chefͷrecipe Λूதཧ͢ΔϚελʔɺద༻͢Δ ΤʔδΣϯτͷܗΛऔΔ͜ͱ͕ग़དྷΔ ✤ طଘͷϖύϘࡐ͜ͷߏΛऔ͍ͬͯΔͱ͜Ζ͕ଟ͍ ✤
nodeใͷཧ͕ඞཁ ✤ PuppetͩͱςΩετʢ࣮ྫʣɺLDAPͳͲऔΕΔ ✤ ‘puppet agent’ ‘chef-client’
Puppetͷྫ
୯ମͰ࣮ߦ ✤ manifest, recipe Λద༻͢Δαʔόʹஔͯ͠୯ମͰ࣮ߦ͢Δ ✤ Master, AgentܕΑΓ͓खܰ ✤ ‘puppet
apply’, ‘chef-solo’ ✤ ࠷ۙͪ͜Β͕ਓؾग़͖ͯͯΔʢޙड़ʣ
ΠϯϑϥͷίʔυԽ
ίϥϘϨʔγϣϯՄೳͱॻ͍ͨ ✤ Manifest, Cookbooks Λόʔδϣϯཧग़དྷͯɺෳਓͰཧ ✤ ϨϏϡʔͨ͠Γվળͨ͠Γग़དྷΔ ✤ ͜Εͬͯී௨ʹϓϩάϥϜͱҰॹ
ϓϩάϥϜͱҰॹ ✤ ͜ΜͳྲྀΕ͕ग़དྷΔΑ͏ʹͳΔ ✤ खݩͷvagrantͰmanifestrecipeΛ࡞ͯ͠ (development) ✤ ࣾͷmaglicaڥͳͲͰ֬ೝͯ͠ (integration) ✤
࣮ࡍͷαʔϏεͷεςʔδϯάͰ֬ೝͯ͠ (staging) ✤ ຊ൪ʹೖ (production)
ϓϩάϥϜͱҰॹ ✤ ͜͏͍͏ͱ͖୯ମ࣮ߦ͕ศརͩͶ ✤ ֤ڥʹpupper-serverchef-serverΛߏங͢Δͷ͠ΜͲ͍ ✤ ͔ͦ͠ΕΒӡ༻ʹͦΕͳΓʹख͕͔͔ؒΔ
Vagrant ✤ ‘vagrant provision’ ίϚϯυ ✤ http://docs-v1.vagrantup.com/v1/docs/provisioners.html ✤ ࡞ͬͯյͯ͠ͱ͍͏ͷ͕؆୯ʹग़དྷΔ
ࠓ·ͰͷδϨϯϚ ✤ manifestrecipeͷ֬ೝ͕େม ✤ ࡞ ✤ ద༻ ✤ ֬ೝ ʢࢹʣ
໘ͳ͜ͱCI ✤ ͜͜࠷͍ۙτϐοΫ ✤ ϓϩάϥϚϒϧʹαʔόߏங͕ग़དྷΔΑ͏ʹͳͬͨ ✤ ֬ೝςετΛCIͰճͤΔΑͱ͍͏ͷͰઌਓ͕ϊϋΛஷΊͯڞ༗ ͖͍ͯͯ͠Δ
ႈੑສࡀ ✤ طଘͷαʔόͷద༻ ✤ ৽نαʔόͷߏங ✤ ͲͪΒʹͰ͑ΔɺͲͪΒ֬ೝग़དྷΔ
CIྫ (Puppet) ✤ “Ukigumo ͱ serverspec Ͱ Puppet ͷܧଓతΠϯςάϨʔγϣϯ” ✤
http://mizzy.org/blog/2013/03/27/2/ ✤ puppet-lxc-box Ͱ࡞ͬͨίϯςφʹରͯ͠ܧଓతʹ puppet apply ͠ ͯ݁ՌΛϨϙʔτ
CIྫ (Chef) ✤ “Vagrant + Chef Solo + serverspec +
Jenkins ͰαʔόʔߏஙΛ CI” ✤ http://d.hatena.ne.jp/naoya/20130520/1369054828 ✤ vagrant ʹΑͬͯ࡞ͨ͠ vm ʹରͯ͠ɺ৽ن࡞→knife-soloద༻ →serverscpec→ഁغ ͱ͍͏ྲྀΕ
ઌ΄ͲͷCIͷλΠτϧΛݟ͢ ✤ “Ukigumo ͱ serverspec Ͱ Puppet ͷܧଓతΠϯςάϨʔγϣϯ” ✤ “Vagrant
+ Chef Solo + serverspec + Jenkins ͰαʔόʔߏஙΛ CI”
serverspecʹ͍ͭͯ ✤ ࠓͷ hbstudy#45 Ͱʂʂ̍
͓·͚ʣ͏̍ͭͷςετ ✤ αʔϏεࢹ (ϞχλϦϯά͡Όͳͯ͘ࢮ׆ࢹͳͲ) ✤ ϖύϘͰNagiosΛ͍ͬͯΔ ✤ NagiosपΓࠇా͞Μ͕ࠓͯ͘͠Ε·͢ ✤ serverspec͕ϗϫΠτϘοΫεςετͳΒ,
αʔϏεࢹϒϥοΫϘ οΫεςετ ✤ ʢهʣ࣮ࡍӡ༻தͷNagiosը໘ΛݟͯΈͨ