Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Vagrant + Berkshelf

9b69fbdeb0713def44a8731091ce5885?s=47 Yusuke Ando
November 12, 2013

Vagrant + Berkshelf

9b69fbdeb0713def44a8731091ce5885?s=128

Yusuke Ando

November 12, 2013
Tweet

Transcript

  1. OBOBQJ!ZBOEP 7BHSBOUͰ/HJOYQIQGQN $IFGͱࠜؾͱ#FSLTIFMG

  2. ZBOEP $BOEZ$BOFQIQ $BLF1)1࣮ફೖ໳

  3. UFDIBMJTUFSTKQ

  4. 1)13VCZ/PEF+BWBରԠ1BB4 $IFGͰ"84ɺ"[VSFΛࣗಈߏங ࣌ؒ༗ਓ؂ࢹ 44)TVEPՄೳ͔ͭαϙʔτ༗ εϥΠυͳͲ͸ˠ GBDFCPPLDPNFZKBQBO

  5. $IFGͷϔϏʔϢʔβʔ

  6. ։ൃ؀ڥ ୭Ͱ΋ඞཁʹͳΔ ଟ࠼ ͗͢Δ ؀ڥ 9".1 .".1 7JSUVBM#PY TZTUFN1)1 ࣮؀ڥͱ͸Կ͔͕ҧ͏

    શ͘ҧ͏
  7. ͦ͜Ͱ7BHSBOU

  8. 7BHSBOU ։ൃ؀ڥߏஙπʔϧ 7BHSBOUͱ7JSUVBM#PYͷηοτΞοϓ ఆٛϑΝΠϧΛςΩετͰهड़ WBHSBOUVQͰ։ൃ؀ڥ͕ىಈ

  9. WBHSBOUVQ Vagrantfile VirtualBox Chef Solo Cookbook ಡΈࠐΈ ىಈ ࣗಈઃఆ ಡΈࠐΈ

    ΩοΫ
  10. ͍͢͝ ϑΝΠϧ͚ͩͰಉ͡؀ڥΛ࠶ݱ ςΩετͳͷͰࠩ෼؅ཧͰ͖Δ ޷͖ͳ*%&ͰΰϦΰϦฤूͰ͖Δ $IFGͷDPPLCPPLΛຊ൪ʹྲྀ༻Ͱ͖Δ ௒ศར͔ͭɺຊ෺ͷ؀ڥ͕࢖͑Δ

  11. Πϯετʔϧ HFNͰͷΠϯετʔϧ͸ඇਪ঑

  12. 5JQT3VCZJO7BHSBOU 7BHSBOUҎ߱͸3VCZΛಉ͍ࠝͯ͠Δ

  13. WBHSBOUCPY ։ൃ؀ڥͷϕʔεʹ͢ΔΠϝʔδ IUUQXXXWBHSBOUCPYFT WBHSBOUCPYBEE\UJUMF^\VSM^ %SPQ#PYͰެ։͢Δͱࢮ͵

  14. None
  15. WBHSBOUJOJU 7BHSBOUpMFΛੜ੒ ϓϩδΣΫτ഑ԼͳͲ͕ྑ͍ IPNFʹ௚઀࡞Βͳ͍΄͏͕ྑ͍ http://bit.ly/php-vagrant

  16. Vagrant.configure("2") do |config| config.vm.box = "base" config.vm.box_url = "http://dom.com/ a.box"

    end
  17. WBHSBOUVQ 7BHSBOUpMFΛݩʹϚγϯΛىಈ WBHSBOUTTIͰTTIͰϩάΠϯՄೳ JEQBTTͷ؅ཧ͸ෆཁʂ ͜ͷ··ͩͱૉͷΠϝʔδ

  18. DPOpHWNTZODFE@GPMEFS 1$ଆͷϑΥϧμΛ7.ʹϚ΢ϯτ υΩϡϝϯτϧʔτʹιʔεΛʂ *%&Ͱฤूͨ͠಺༰͕ଈ࣌൓ө GUQɺTDQ΍HJU͕ແͯ͘΋େৎ෉

  19. ͦͷଞ DPOpHWNOFUXPSL /"5ઃఆͳͲͷࣗಈԽ WCDVTUPNJ[F ϝϞϦׂΓ౰ͯͳͲ ϓϥάΠϯ ଞͷԾ૝Խ΍Ϋϥ΢υΛར༻Մೳ

  20. DPOpHWNQSPWJTJPO ىಈͨ͠Ϛγϯ΁ͷߏஙઃఆ $IFGTPMP 1VQQFU$'&OHJOF4IFMM"OTJCMF΋Մೳ ΫοΫϒοΫ΁ͷύεΛهड़

  21. config.vm.provision :chef_solo do |chef| chef.cookbooks_path = "../my-recipes/cookbooks" chef.add_recipe "mysql" end

  22. $IFG େྲྀߦͷߏஙπʔϧ ϨγϐΛهड़ͯ͠ߏங ωοτ্ʹ৘ใ͕ଟ͍ ߚനग़৔ܾఆڃͷώοτ

  23. package “nginx” template “/etc/nginx/nginx.conf” do source “nginx.conf.erb” end service “nginx”

    do action :start end SFDJQF Πϯετʔϧ ઃఆϑΝΠϧίϐʔ αʔϏε։࢝
  24. ཧ૝ܗ Vagrantfile Cookbook Ϋϥ΢υ ։ൃ؀ڥ ຊ൪؀ڥ $PPLCPPLͰ։ൃ؀ڥͱຊ൪؀ڥΛಉظ

  25. 5*14ΫοΫϒοΫ͸෗Δ ͦΕ·Ͱಈ͍͍ͯͨΫοΫϒοΫ ͋Δ࣌఺͔Βಈ͔ͳ͘ͳΔ ύοέʔδͷΞοϓσʔτͳͲ ܧଓతͳϝϯςφϯε͕͔ܽͤͳ͍

  26. Node Node GitHub engineyard.com Node &OHJOF:BSEͷ৔߹ DIFGTPMP Cookbook BQQMZ &OHJOF:BSE͕࣮૷ͨ͠Ϩγϐ

    Λ8FCͷૢ࡞Ͱඞཁͳ࣌ʹ൓ө ΧελϜϨγϐ
  27. ಥવͷ੬ऑੑରԠ

  28. ੬ऑੑରԠͳͲΛਵ࣌഑৴

  29. ͜͜·Ͱ͸ Ҏલ͓࿩͠·ͨ͠

  30. 7BHSBOU $IFGͷ՝୊ 7BHSBOUpMFͱผʹΫοΫϒοΫ͕ඞཁ DPPLCPPLTͷ৔ॴΛࢦఆ ෳ਺ͷΞϓϦͰڞ༻͢Δ࣌΋ ΫοΫϒοΫ͸ෆఆظͰϝϯς͕ඞཁ

  31. ΫοΫϒοΫڞ༗ Vagrantfile Cookbook App1 Vagrantfile App2 Vagrantfile App3

  32. ZBOEPEPNVTVCJ QIQGQNOHJOYͳ ։ൃ؀ڥ༻Ϩγϐ

  33. PNVTVCJ 6CVOUVϕʔε εΫϥονͰॻ͍ͨΫοΫϒοΫ QIQ/HJOY$PNQPTFSQIQVOJU NZTRMQPTUHSFTRMJNBHFNBHJDL ඞཁ͔ͩͬͨΒॻ͍ͨϨγϐ

  34. ਖ਼߈๏Ϩγϐಉࠝ

  35. ਖ਼߈๏TVCNPEVMFTVCUSFF

  36. ࠇຐज़DIFGTPMPS ϦϞʔτͷUBSϘʔϧΛల։࣮ͯ͠ߦ

  37. ଥڠશ෦4IFMM ͞ΑͳΒႈ౳ੑ

  38. ͲΕ΋͍·͍ͪ Oճͷϝϯς͕ඞཁ

  39. ͦ͜Ͱ#FSLTIFMG

  40. #FSLTIFMG 3JPU(BNFT੡ $PPLCPPLͷґଘ؅ཧπʔϧ CVOEMFSతͳࣄ͕ग़དྷΔ CFSLTJOTUBMMͰ#FSLTpMFΛݩʹऩू ίϛϡχςΟΫοΫϒοΫҎ֎΋0,

  41. -PDBUJPO

  42. #FSLTIFMGͳΒ ࣗ࡞ͷΫοΫϒοΫΛ֎෦͔Βಋೖ ϓϥΠϕʔτϦϙδτϦ΋0, 0QT$PEFͱซ༻΋Մೳ 7BHSBOU#FSLTIFMGϓϥάΠϯͰશࣗಈ

  43. શࣗಈ WBHSBOUQMVHJOJOTUBMMWBHSBOUCFSLTIFMG DPOpHCFSLTIFMGFOBCMFUSVF CFSLTίϚϯυΛ৮Δඞཁແ͠ʂ

  44. #FSLTpMF

  45. 7BHSBOUpMF #FSLTGJMFͰऔಘͨ͠ ϨγϐΛࢦఆՄೳʹ

  46. ͞Βʹຐվ଄ #FSLTGJMFΛ7BHSBOUGJMF ʹ಺ଂͤͯ͞ݟͨ

  47. ஫ҙ఺ ར༻ऀʹ7BHSBOU#FSLTIFMGϓϥάΠϯ ΫοΫϒοΫʹ͸NFUBEBUBSC͕ඞཁ UFTULJUDIFOͳͲͰςετ͕ඞཁ

  48. αϯϓϧ HJUIVCDPNZBOEPEPNVTVCJ HJTUHJUIVCDPNZBOEPE

  49. ࣭໰ʁ