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
200
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
2024/11/8 関西Kaggler会 2024 #3 / Kaggle Kernel で Gemma 2 × vLLM を動かす。
kohecchi
5
920
Compose 1.7のTextFieldはPOBox Plusで日本語変換できない
tomoya0x00
0
190
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
1
100
Amazon Qを使ってIaCを触ろう!
maruto
0
410
ローコードSaaSのUXを向上させるためのTypeScript
taro28
1
610
Figma Dev Modeで変わる!Flutterの開発体験
watanave
0
110
A Journey of Contribution and Collaboration in Open Source
ivargrimstad
0
910
レガシーシステムにどう立ち向かうか 複雑さと理想と現実/vs-legacy
suzukihoge
14
2.2k
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
110
Duckdb-Wasmでローカルダッシュボードを作ってみた
nkforwork
0
130
[Do iOS '24] Ship your app on a Friday...and enjoy your weekend!
polpielladev
0
100
OSSで起業してもうすぐ10年 / Open Source Conference 2024 Shimane
furukawayasuto
0
100
Featured
See All Featured
Music & Morning Musume
bryan
46
6.2k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
93
16k
Statistics for Hackers
jakevdp
796
220k
10 Git Anti Patterns You Should be Aware of
lemiorhan
654
59k
Teambox: Starting and Learning
jrom
133
8.8k
4 Signs Your Business is Dying
shpigford
180
21k
Being A Developer After 40
akosma
86
590k
Imperfection Machines: The Place of Print at Facebook
scottboms
265
13k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
506
140k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
364
24k
Gamification - CAS2011
davidbonilla
80
5k
Mobile First: as difficult as doing things right
swwweet
222
8.9k
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ܥ͕࣮͞Ε͍ͯΔ ಠࣗʹॻ͘ͳΒܾΊଧͪՄೳ ʮखॱॻʯΛࣗಈԽ͢Δهड़ྗ
࣭ʁ