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

構成管理ツールを渡り歩いてItamaeに辿り着いた話/Itamae Meetup #1

sugamasao
December 10, 2015

構成管理ツールを渡り歩いてItamaeに辿り着いた話/Itamae Meetup #1

http://itamae.connpass.com/event/22857/
に登壇した際の資料です

sugamasao

December 10, 2015
Tweet

More Decks by sugamasao

Other Decks in Technology

Transcript

  1. ߏ੒؅ཧπʔϧΛ౉Γ
    า͍ͯItamaeʹḷΓண
    ͍ͨ࿩
    Itamae Meetup #1
    sugamasao 2015/12/09

    View full-size slide

  2. HN: sugamasao
    PN: ͕͢ΘΒ·͞ͷΓ
    RubyͰΞϓϦέʔγϣϯ
    ίʔυΛॻ͖ͭͭΠϯϑϥͷ
    ߏங΍ӡ༻ͳͲ΋΍ΔϚϯ
    ࣗݾ঺հ

    View full-size slide

  3. ॻ͍ͨ΋ͷʢએ఻ʣ

    View full-size slide

  4. ॻ͍ͨ΋ͷʢ୅ද࡞తͳ΋ͷʣ
    https://github.com/sugamasao/kanojo_bot

    View full-size slide

  5. લஔ͖
    • ࣠଍͸ΞϓϦέʔγϣϯΤϯδχΞ
    • Πϯϑϥઐ೚ͷΤϯδχΞͰ͸ͳ͍
    • ͋·Γ࣌ؒΛֻ͚ΒΕͳ͍……
    • αʔό୆਺͕૿͑Δͱ͍ͬͯ΋͍͍ͤͥ
    10୆͘Β͍ͷن໛ײͰ͢

    View full-size slide

  6. ߏ੒؅ཧπʔϧͷมભͱಋೖ࣌ظ
    • fabricظʢ3ʙ4೥લ͘Β͍ʁʣ
    • chef-soloظʢ2೥લ͘Β͍ʁʣ
    • Itamaeظʢ1೥લ͘Β͍ʁʣ
    ※αʔόߏ੒Λݟ௚͢λΠϛϯάͰ৐Γ׵͑ͯΔɺɺɺ

    View full-size slide

  7. fabricظ
    • αʔό୆਺͕͘͝গͳ͍࣌୅
    • ࣗલϏϧυͷϛυϧ΢ΣΞ͕͍ͭ͘
    ͔

    View full-size slide

  8. fabric
    from fabric.api import local
    def sample():
    local("ls -l")
    • खଓ͖తʹॲཧ͕ॻ͚Δ
    • ϩʔΧϧଆͱαʔόଆͰͦΕͧΕγΣϧεΫϦϓ
    τΛॻ͘ײ͡
    ➜ fab sample
    : # ls ͷ݁Ռ͕ग़ྗ͞ΕΔ

    View full-size slide

  9. fabricظ
    γΣϧεΫϦϓτΛศརʹॻ͚Δ
    A͕͋ͬͨΒBΛ֬ೝ͔ͯ͠ΒϏϧυʙ
    Έ͍ͨͳҰ࿈ͷྲྀΕΛॻ͖΍͍͢
    ίϚϯυͷ໭Γ஋ͷ֬ೝ΍ϑΝΠϧͷ
    సૹͳͲࡉʑͨ͠࡞ۀ༻ʹศརϝιο
    υ͕ఏڙ͞Ε͍ͯΔ
    put/sed/containsͳͲ

    View full-size slide

  10. fabricظ
    ύοέʔδͷΠϯετʔϧͳͲܾ·Γ੾ͬ
    ͨॲཧͳͲ͸γΣϧεΫϦϓτϕʔεͰ
    ॻ͘ඞཁ͕͋ΔͷͰͪΐͬͱ໘౗
    ※ࠓ͸ͦ͏͍͏ͷ΋͋Δ͔΋ʁ

    View full-size slide

  11. αʔόߏ੒Λม͑Δʹ͋ͨΓཉ͔ͬͨ͠
    Ϡʔπ
    • ύοέʔδͷΠϯετʔϧ͕Ͱ͖ͯ
    • ઃఆϑΝΠϧஔ͚ͯ
    • ద౰ͳσΟϨΫτϦΛ࡞੒Ͱ͖Δ

    View full-size slide

  12. ཉ͔ͬͨ͠ͷ
    ͜ΕͰ
    ͸ʂʂʂʁʂʂʂ
    ʁʂʂʁ
    http://www.amazon.co.jp/dp/B00BSPH158

    View full-size slide

  13. chef-soloظ
    • αʔό୆਺͕ͪΐͬͱ૿͑ͨ࣌୅
    • ࣗલϏϧυΛഇࢭͯ͠ఏڙ͞Ε͍ͯ
    ΔύοέʔδΛੵۃతʹར༻͢Δ
    • fabricͷར఺ͩͬͨখճΓͷྑ͕͞
    ׆͔ͤͳ͘ͳ͖ͬͯͨ

    View full-size slide

  14. chef-soloظ
    DSLͰඞཁͳ෼͚ͩॻ͚Δ
    ඞཁͳػೳ͸ἧͬͯͦ͏

    View full-size slide

  15. chef-soloظ
    ίϛϡχςΟΫοΫϒοΫ࢖͏ͷɺ༐ؾ͕͍
    Δ……ʢ໰୊ͳ͍͔શ෦ಡΉӋ໨ʹͳΔʣ
    ͱ͍͏͔ͦ΋ͦ΋ɺͦΜͳʹେڼͳ΋ͷ͡Ό
    ͳͯ͘ྑ͍……
    ࣗ෼Ͱ࡞Δʹͯ͠΋ͻͳܗͳͲେڼͳײ͡

    View full-size slide

  16. 1ʙ2ϲ݄ޙ
    ʮϤογϟߏ੒ͪΐͬͱม͑ΔͰʯ
    ʮσΟϨΫτϦߏ੒֮͑ͱΒΜ…ʯ
    ʮʯ

    View full-size slide

  17. ͜Μͳ͸ͣͰ͸

    View full-size slide

  18. chef-soloɺྑ͍͚Ͳδϣ
    δϣͰྫ͑ΔͳΒΘ͟Θ͟
    ϩʔυϩʔϥʔΛ୳͖ͯ͠
    ͯͿͬ௵ͦ͏ͱ͢ΔΑ͏ͳ
    େڼ͞Λײ͍ͯͨ͡ࠒɺ
    ItamaeͷଘࡏΛ஌ͬͨ

    View full-size slide

  19. ٻΊ͍ͯͨ΋
    ͷɺ͜ΕͰ͸ʁ

    View full-size slide

  20. Itamaeظ
    DSLͰຊ౰ʹඞཁͳ෼͚ͩॻ͚Δ
    ΤʔδΣϯτϨε
    ڍಈ͕Α͘Θ͔Βͳͯ͘΋ίʔυΛ͙͢
    ಡΊΔαΠζ

    View full-size slide

  21. Itamaeظ
    ʢ౰࣌͸ʣυΩϡϝϯτ͕গͳ͘ɺख୳
    ΓͰਐΊ͍ͯ͘͜ͱ͕ଟ͔ͬͨ
    ΋ͬͱྲྀߦͬͯ΄͍͠w

    View full-size slide

  22. ٻΊ͍ͯͨ΋ͷɺ
    ͜Εͩͬͨʂ

    View full-size slide

  23. ͕࣌ؒ༨ͬͨ
    Β࿩͢༻

    View full-size slide

  24. Itamaeʹ·ͭΘΔྑ͍࿩
    ʢྑ͍࿩൑ఆ͓ئ͍͠·͢ʣ

    View full-size slide

  25. ڈ೥ͷࠓࠒ·Ͱɺ
    ࣮༻తͳOSSπʔϧʹ
    ରͯ͠p-rΛͨ͜͠ͱ
    ͕ͳ͔ͬͨ

    View full-size slide

  26. ඞཁʹഭΒΕ͔ͨΒͱ͍
    ͏͜ͱ΋͋Δ͚ΕͲɺ
    Itamae΍όοΫΤϯυͰ
    ࢖༻͍ͯ͠ΔSpecinfraʹ
    ରͯ͠ز͔ͭमਖ਼ͷp-rΛ
    ͯ͠ɺऔΓࠐ·Εͨ☺️

    View full-size slide

  27. ͜Ε͸خ͍͠
    ίʔυͰੈͷதʹߩݙͰ͖Δ
    ͜ͱ΄Ͳخ͍͜͠ͱ͸ͳ͍

    View full-size slide

  28. ͜Μͳܦݧ͕Ͱ͖
    ͨͷ΋Itamaeͷ
    ͓͔͛Ͱ͢

    View full-size slide