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
初めてのChefの教室
Search
Yusuke Ando
February 22, 2013
Programming
19
28k
初めてのChefの教室
2/22に株式会社Engine Yardで開催した非インフラエンジニア向けChef入門講座です。
Yusuke Ando
February 22, 2013
Tweet
Share
More Decks by Yusuke Ando
See All by Yusuke Ando
CakePHP3でアプリ開発
yandod
1
340
Shimokita.Unity パーティクルでエフェクト
yandod
0
760
CakePHP3の明るい未来
yandod
1
210
Testing your app with Selenium on Travis CI
yandod
8
3.1k
Testing your app with Selenium on Travis CI
yandod
0
130
Inputで入力を扱う
yandod
0
660
Detonatorで爆発させる勉強会をした報告
yandod
0
2.4k
Mecanimでアニメーション - Shimokita.Unity
yandod
0
720
パリの街をUnityで駆ける
yandod
1
3.4k
Other Decks in Programming
See All in Programming
テスト自動化失敗から再挑戦しチームにオーナーシップを委譲した話/STAC2024 macho
ma_cho29
1
1.3k
KubeCon + CloudNativeCon NA 2024 Overviewat Kubernetes Meetup Tokyo #68 / amsy810_k8sjp68
masayaaoyama
0
250
わたしの星のままで一番星になる ~ 出産を機にSIerからEC事業会社に転職した話 ~
kimura_m_29
0
180
CSC305 Lecture 26
javiergs
PRO
0
140
The Efficiency Paradox and How to Save Yourself and the World
hollycummins
1
440
Security_for_introducing_eBPF
kentatada
0
110
これでLambdaが不要に?!Step FunctionsのJSONata対応について
iwatatomoya
2
3.6k
Effective Signals in Angular 19+: Rules and Helpers
manfredsteyer
PRO
0
100
42 best practices for Symfony, a decade later
tucksaun
1
180
フロントエンドのディレクトリ構成どうしてる? Feature-Sliced Design 導入体験談
osakatechlab
8
4.1k
創造的活動から切り拓く新たなキャリア 好きから始めてみる夜勤オペレーターからSREへの転身
yjszk
1
130
Monixと常駐プログラムの勘どころ / Scalaわいわい勉強会 #4
stoneream
0
280
Featured
See All Featured
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.3k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
5
450
Become a Pro
speakerdeck
PRO
26
5k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
44
9.3k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
48
2.2k
Producing Creativity
orderedlist
PRO
341
39k
Raft: Consensus for Rubyists
vanstee
137
6.7k
Building Applications with DynamoDB
mza
91
6.1k
Product Roadmaps are Hard
iamctodd
PRO
49
11k
Optimising Largest Contentful Paint
csswizardry
33
3k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
How to Ace a Technical Interview
jacobian
276
23k
Transcript
ॳΊͯͷ$IFGͷڭࣨ &OHJOF:BSE.FFUVQ ඇΠϯϑϥΤϯδχΞͰग़དྷͨ
ZBOEP
"84 $IFG αϙʔτ
&OHJOF:BSE-PDBM ͋ͳͨͷPC Engine Yard Local Engine Yard Cloud Your App
Your App PC্Ͱ։ൃ͕ແྉ Ϋϥυͱಉ͡ڥ (VagrantΛแ) γʔϜϨεʹΞϓϦΛσ ϓϩΠʂ
"HFOEB $IFGͱ ηοτΞοϓ Ϩγϐͷهड़ ใͷ୳͠ํ
$IFGͱ
$IFG 3VCZͷγεςϜཧπʔϧ ઃఆϑΝΠϧΛݩʹαʔόΛࣗಈઃఆ 6OJY-JOVY.BD8JOEPXTରԠ ແঈ൛Ͱར༻Մೳ ࠃ֎Ͱٸʹελϯμʔυʹ
*OGSBTUSVDUVSFBT$PEF 2011/2 ΠϯϑϥΛίʔυͰهड़͢Δ ͕࣌౸དྷͨ͠
None
DPPLCPPLΛݩʹઃఆ recipe cookbook 3VCZͰॻ͔ΕͨϨγϐͷू·Γ͕ΫοΫϒοΫ $IFGϨγϐΛݩʹϗετΛࣗಈͰઃఆ͢Δ
$IFGͷߏ తͷϊʔυ܈ ཧ༻αʔό
όϦΤʔγϣϯ )PTUFE$IFG 0QT$PEF͕ϗεςΟϯά͢Δ ϊʔυʹԠͨ͡՝ۚ 1SJWBUF$IFG 'JSFXBMMͰՔಇ͢Δ ༗ঈ൛αϙʔτ͋Γ
1SJDF
8FC6* ࣮ɺͬͨࣄͳ͍Ͱ͢ʜ
DIFGTPMP αʔόʔෆཁͷDIFG ϩʔΧϧ্ͷΫοΫϒοΫΛ࣮ߦՄೳ (6*͑ͳ͍ DIFGTPMPΛΩοΫ͢Δπʔϧଟ͍ FY 7BHSBOU &OHJOF:BSE
·ͣ$IFG4PMPͰ ϨγϐΛͬͨߏஙʹ ׳ΕΔͷ͕٢
ηοτΞοϓ
ηοτΞοϓ 3VCZ 3VCZHFNT TPMPSC OPEFKTPO
3VCZSVCZHFNT $ sudo apt-get install ruby1.8 $ sudo apt-get install
rubygems $ sudo gem install chef $ chef-solo -v Chef: 11.4.0 DIFGTPMPDIFGʹಉࠝ DIFGࣗମBQUHFUͰಋೖՄ
3VCZͷཧҙ
TPMPSC Ұ࣍σΟϨΫτϦͷॴͷઃఆ ΫοΫϒοΫͷύεͷઃఆ FUDDIFGTPMPSC ࣮ߦ࣌ʹଘࡏ͠ͳ͍߹ܯࠂ
TPMPSC file_cache_path "/var/chef-solo" cookbook_path ["/var/chef-solo/cookbooks"] file_cache_path "/var/chef-solo" cookbook_path ["/var/chef-solo/cookbooks", "/var/chef-solo/site-cookbooks"]
ෳࢦఆՄ
OPEFKTPO $IFGαʔό͔Βͷσʔλͷସ ΫοΫϒοΫ͢มΛઃఆ ࣮ߦ͢ΔϨγϐΛࢦఆ͢Δ
OPEFKTPO { "resolver": { "nameservers": [ "10.0.0.1" ], "search":"int.example.com" },
"run_list": [ "recipe[resolver]" ] } { "run_list": [ "recipe[resolver]" ] } ࣮ߦ͍ͨ͠Ϩγϐ
DIFGTPMP
ͭ·Γ ະઃఆͷঢ়ଶ͔ΒͰҙͷΫοΫ ϒοΫΛ࣮ߦग़དྷΔ WBSDIFGDPPLCPPLTIPHF ͷΫοΫϒοΫΛ࣮ߦ͢ΔͳΒ $ sudo chef-solo -o hoge
ςετ࣮ߦ
͜͜·Ͱͷ·ͱΊ TVEPBQUHFUVQEBUF TVEPBQUHFUSVCZSVCZHFNT TVEPHFNJOTUBMMDIFG TVEPLOJGFDPPLCPPLDSFBUFIPHF TVEPDIFGTPMPPIPHF
Ϩγϐͷهड़
Ϩγϐͷهड़ LOJGFίϚϯυ σΟϨΫτϦߏ 3FTPVSDF ެ։͞Ε͍ͯΔΫοΫϒοΫ
LOJGFίϚϯυ DIFGαʔόͱͷ௨৴֤छ࡞ۀΛߦ͏ ΫϥΠΞϯτ DIFGTPMPͰར༻͢Δ߹ΫοΫϒο ΫͷॳظԽ࡞ۀʹ͏ ϓϥάΠϯͰαϒίϚϯυΛ֦ுՄ
αϒίϚϯυ ߦ͋Δϔϧϓ ʢ֮͑ΒΕͳ͍ʣ
ΫοΫϒοΫ࡞ LOJGFDPPLCPPLDSFBUF\OBNF^ WBSDIFGDPPLCPPLTҎԼʹ࡞ $IFGαʔόΛΘͳ͍ͷͰΑ͠ͳʹ (JU)VC4Ͱཧ
σΟϨΫτϦߏ CHANGELOG.md attributes/ files/ metadata.rb recipes/ templates/ README.md definitions/ libraries/
providers/ resources/ ϨγϐΛஔ͘ QMBUGPSNຖʹग़དྷΔ ઃఆϑΝΠϧͷͻͳܗ ϨγϐͰར༻͍ͨ͠มͳͲ
SFDJQFTEFGBVMUSC log “Hello Chef” QMBUGPSNΛؾʹ͠ͳ͍߹
Ϩγϐ 3VCZͰॻ͔ΕͨεΫϦϓτ ෦%4-Λͬͯهड़ 3FTPVSDFͱݺΕΔจ๏ ΈࠐΈͷ3FTPVSDF04ʹґଘ͠ͳ͍ ઃఆ࡞ۀΛఏڙ
Α͘͏ػೳ
SFDJQJFTEFGBVMUSC log "Hello Chef" package "apache2" do action :install end
service "apache2" do action :start end ֤ڥͷύοέʔδཧΛ࣮ߦ
BQBDIFೖͬͨ
BQUHFUͰྑ͘Ͷʁ ୯७ͳύοέʔδಋೖҎ্ͷॲཧ͕ग़ དྷΔͷ͕$IFGͷڧΈ ݻ༗ͷઃఆϑΝΠϧͷઃஔ ύοέʔδؒɺϊʔυؒͷ࿈ಈઃఆ ࣮ߦ࣌ʹใΛऔಘ͢Δػೳ
UFNQMBUFϦιʔε &3#ΛͬͯಈతͳΛૠೖ "QBDIFQIQOHJOYͳͲͷઃఆʹ ϓϥοτϑΥʔϜຖʹࠩ͠ସ͑Մೳ
UFNQMBUFTEFGBVMUUFTUUYUFSC This is Sample File.<br/> <%= node[:platform] %><br/> <%= node[:platform_version]
%> SFDJQFTEFGBVMUSC ଓ template "/var/www/test.txt" do source "test.txt.erb" mode 0644 end
ಈతʹϑΝΠϧΛ࡞
JODMVEF ผͷΫοΫϒοΫΛಡΈࠐΉ طଘͷࣝͷ࠶ར༻ ґଘؔͷఆٛ include_recipe “fuga”
ͦͯ͠ ࣗྗͰهड़ͨ͠ϨγϐΛஷΊ͍ͯ͘ ωοτ্ͷϨγϐΛखͯ͠͠ར༻ *OGSBTUSVDUVSFBTDPEFΛ࣮ݱ
ใͷ୳͠ํ
ެ։͞Ε͍ͯΔϨγϐ ͞·͟·ͳํ๏Ͱ͞·͟·ͳஂମ͕ ΫοΫϒοΫΛެ։͍ͯ͠Δ ϨγϐΛ࠶ར༻͢Δ߹શମͷΞʔ ΩςΫνϟʹେ͖ͳӨڹ
DPNNVOJUZPQTDPEFDPN
(JU)VC্ͷϦιʔε opscode-cookbooks ެࣜΫοΫϒοΫ rightscale/cookbooks_public engineyard/ey-cloud-recipes aws/opsworks-cookbooks ֤ϓϥοτϑΥʔϜ͚ jsierles/chef_cookbooks ͔ͭͯ 37signalsͷϦϙδτϦͩͬͨͷ
4PVSDFΠϯετʔϧΛ࣮
None
3PMF͕࣮͞Ε͍ͯΔ
None
None
ͪΐͬͱมΘͬͨ pivotal/pivotal_workstation Pivotalͷ։ൃऀͷPCΛηοτΞοϓ͢Δ
$ISPNF
.BDͷนࢴΛઃఆ
ڭ܇ ެࣜϨγϐϚϧνϓϥοτϑΥʔϜ 1BB4ܥ͕࣮͞Ε͍ͯΔ ಠࣗʹॻ͘ͳΒܾΊଧͪՄೳ ʮखॱॻʯΛࣗಈԽ͢Δهड़ྗ
࣭ʁ