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

JenkinsとPuppet+ServerspecでインフラCI / Jenkins Puppet Serverspec Infra CI

JenkinsとPuppet+ServerspecでインフラCI / Jenkins Puppet Serverspec Infra CI

Jenkins ユーザ・カンファレンス 2015 東京 – セッション

Shinya Tsunematsu

January 11, 2015
Tweet

More Decks by Shinya Tsunematsu

Other Decks in Technology

Transcript

  1. !
    546/&."5464IJOZB
    +FOLJOTϢʔβɾΧϯϑΝϨϯε౦ژ
    +FOLJOTͱ
    1VQQFU4FSWFSTQFDͰ
    Πϯϑϥ$*

    View full-size slide

  2. 546/&."5464IJOZB
    !UONU
    IUUQCMPHUONUJOGP

    View full-size slide

  3. IFUFNM
    IUUQIFUFNMKQ
    ̋ϔςϜϧ✕ϔϜςϧ
    ϩϦϙοϓʂ IUUQMPMJQPQKQ
    ʹ͙࣍Ϩϯλϧαʔ
    όʔϥΠϯφοϓ
    େ༰ྔɾߴෛՙʹ଱͑͏Δ্ҐαʔϏεͱͯ͠ఏڙ
    ೥ϦϦʔε
    ೥݄ݱࡏ୆ऑ

    View full-size slide

  4. ܧଓత8FCαʔϏεվળΨΠυ
    ୈষɹΠϯϑϥߏ੒؅ཧͷվળʙ࣮αʔ
    ϏεͰͷྺ࢙͔ΒֶͿɼஈ֊తͳෛ࠴
    ฦࡁ
    IUUQHJIZPKQEFWGFBUVSF
    XFCTFSWJDFHVJEF
    ࣥච࣌͸೥

    View full-size slide

  5. ࠓ·Ͱߦ͖ͬͯͨࢪࡦͷ͏ͪͷҰͭ

    View full-size slide

  6. 1VQQFU
    $POpHVSBUJPO.BOBHFNFOU
    'SBNFXPSL
    ߏ੒؅ཧπʔϧ
    *OGSBTUSVDUVSFBT$PEF
    ΠϯϑϥΛίʔυԽ͢Δ
    ΠϯϑϥΛίʔυͰهड़͢Δ

    View full-size slide

  7. 1VQQFU
    ೖ໳1VQQFU
    IUUQCMPHLFOUBSPLPSHFOUSZ

    View full-size slide

  8. 1VQQFU
    طʹ΄΅શϩʔϧ ໾ׂ
    ෼ͷߏஙʹؔ
    ͯ͠ϚχϑΣετԽ͕׬͍ྃͯ͠Δ
    ࠷ॳ࡞Δ·Ͱ͸ׂͱେมͩͬͨ
    ৽نߏஙɾػೳ௥Ճʹ͓͚Δख͕ؒ
    େ෯ʹܰݮ

    View full-size slide

  9. ʊਓਓਓਓਓਓʊ
    ʼɹ໨ࢹʂʂɹʻ
    ʉ:?:?:?:?:ʉ

    View full-size slide

  10. 4FSWFSTQFD
    IUUQTFSWFSTQFDPSH
    NJ[[Z͞Μ IUUQTHJUIVCDPN
    NJ[[Z

    αʔόͷঢ়ଶΛ؆ܿͳίʔυͰهड़ͯ͠
    ςετ͢ΔͨΊͷ࢓૊Έ
    34QFDͰهड़

    View full-size slide

  11. ॕˑΦϥΠϦʔຊʢ௨শΞϗໟຊʣग़൛

    View full-size slide

  12. ܶతϏϑΥʔΞϑλʔ
    CFGPSF
    1VQQFUϚχϑΣετهड़ɾద༻
    ໨ࢹ֬ೝ
    BGUFS
    4FSWFSTQFDͷςετهड़ʢ࢓༷ͷܾఆʣ
    ࢓༷Λຬͨ͢1VQQFUϚχϑΣετΛهड़ɾద༻
    4FSWFSTQFDͰঢ়ଶΛ֬ೝ
    ॳొ৔ɺTQFDσΟϨΫτϦҎԼ͚ͩͰ΋ίϛοτ௒
    ͑ͯ΋͏ແͯ͘͸ͳΒͳ͍ɾҎલͲ͏͔ͯͨ͠ࢥ͍ग़ͤͳ͍Ϩϕϧ

    View full-size slide

  13. 4FSWFSTQFD׆༂γʔϯ
    দɿσΟετϦϏϡʔγϣϯͷόʔδϣϯΞοϓ
    1VQQFUͰઃఆ͕ऩଋʢߏங͕׬ྃͨ͠ʣαʔόͷ
    ঢ়ଶʢͭ·Γ࢓༷ʣΛ4FSWFSTQFDͰهड़
    ͦΕΛຬͨ͢Α͏ʹ৽͍͠όʔδϣϯͷ04༻ͷ
    1VQQFUϚχϑΣετΛ࡞੒
    چɾ৽྆ํͷόʔδϣϯͷαʔόͰςετ͕௨Ε͹ɺ
    ࢓༷Λຬ͍ͨͯ͠Δɾڍಈ͕Ұக͍ͯ͠Δͱݴ͑Δ

    View full-size slide

  14. 4FSWFSTQFD׆༂γʔϯ
    ஛طଘϚχϑΣετͷϦϑΝΫλϦϯά
    ίϐϖίʔυͷ൙ཞɺϚχϑΣετͷϕ
    ετϓϥΫςΟεͷྲྀߦΓഇΓ
    มߋલޙͰ4FSWFSTQFDͷςετ݁Ռ
    ͕มΘΒͳ͍Α͏ڞ௨Խɾมߋɺෆཁ
    ෦෼ͷ࡟আͳͲΛਐΊΔ

    View full-size slide

  15. ػೳ௥ՃɾϦϑΝΫλϦϯά࣌ʹා͍͜ͱ
    طʹ͋ΔఆٛͱόοςΟϯά͢Δ
    ෳ਺ϩʔϧʹ·͕ͨΔઃఆͷڞ௨
    ԽΛਐΊΔ৔߹
    ·ͨ͸ڞ௨ͷઃఆʹԿ͔߲໨Λ௥
    Ճ͢Δͱ͖

    View full-size slide

  16. ૯ϩʔϧ਺
    ୆਺ͷଟগ͸͋Δ͕ɺ1VQQFUϚχ
    ϑΣετͰ؅ཧ͞Ε͍ͯΔαʔόϩʔ
    ϧʢ໾ׂʣ͸Λ௒͑Δ
    ͜ΕΒͷαʔόʹ͍ͭͯɺϚχϑΣ
    ετͷมߋ͝ͱʹϩʔϧ෼ͷςε
    τΛ࣮ߦ͢Δͷ͸ۤߦ

    View full-size slide

  17. +FOLJOT
    ֤ϩʔϧͷ4FSWFSTQFDςετΛ
    ΍ͬͯ΋Β͓͏

    View full-size slide

  18. $*ͷྲྀΕ
    1VQQFUϚχϑΣετͷϦϙδτϦΛ
    ϙʔϦϯά
    NBTUFSʹϚʔδ͞Εͨ࣌ʹશϩʔϧ෼ͷ
    ςετΛ࣮ߦ
    1VQQFUϚχϑΣετͷద༻
    4FSWFSTQFDͰͷςετ

    View full-size slide

  19. ᶃ1VQQFUϚχϑΣετ

    4FSWFSTQFDςετ
    $PNNJU
    ᶄϙʔϦϯά
    ᶅ1VQQFUˍ
    4FSWFSTQFD
    ࣮ߦ

    View full-size slide

  20. ᶃ1VQQFUϚχϑΣετ

    4FSWFSTQFDςετ
    $PNNJU

    View full-size slide

  21. ϦϙδτϦߏ੒ આ໌༻؆қ൛

    View full-size slide

  22. ػೳ௥ՃɾมߋͷྲྀΕ
    TQFDϑΝΠϧมߋ
    TQFDNBJMCBS@TQFDSC
    ςετ࣮ߦ
    GBJMΛ֬ೝ
    QVQQFUϚχϑΣετमਖ਼ɺઌड़ͷίϚϯυͰద༻
    SPMFTNBJMNBOJGFTUTCBSQQ
    ςετ࣮ߦ
    ݁Ռ͕0,Ͱ͋Ε͹ϚχϑΣετͱTQFDϑΝΠϧΛDPNNJU
    CVOEMFFYFDSBLFTQFDNBJM
    CVOEMFFYFDSBLFTQFDNBJM

    View full-size slide

  23. (FNpMF
    ͱΓ͋͑ͣ4FSWFSTQFD͕هࡌ͞Ε
    ͍ͯΕ͹0,
    Y·ͩ࢖͑ͯͳ͍
    TPVSDFIUUQSVCZHFNTPSH
    !
    HFNQVQQFU
    HFNTFSWFSTQFD

    View full-size slide

  24. 3BLFpMF
    4FSWFSTQFD࣮ߦʹඞཁ
    όʔδϣϯ͸ҧ͏͕Y༻ઃఆʹ͍ͭͯ͸ϖύϘͰ࢖͍ͬͯΔ΋
    ͷ͕ެ։͞Ε͍ͯΔͷͰͦͪΒΛࢀর
    l4FSWFSTQFDW༻3BLFpMFͱTQFD@IFMQFSSCͷ঺հc
    CMPHUBLBIJSPPLVNVSBz
    IUUQCMPHIJGVNJJOGPTFSWFSTQFDW
    SBLFpMFBOETQFDIFMQFS

    ͰNBJMϩʔϧͷςετ͕࣮ߦग़དྷΔ
    CVOEMFFYFDSBLFTQFDNBJM

    View full-size slide

  25. 7BHSBOUpMF
    ֤ϩʔϧ͝ͱͷ7.ΛఆٛɺྫNBJM
    ϩʔϧ7.Ҏ্Λఆٛ͢Δ
    ͭҎ্ͷ7.͸ྫ͑͹σΟετϦͷόʔ
    δϣϯ͝ͱʹ Ͱ࡞ͬͨΓ͢Δ
    WBHSBOUTUBUVTͯ͠ಘΒΕΔ7.ͷҰཡ
    ͕ϩʔϧͷҰཡɺͱࢥͬͯ΋Βͬͯ΋ྑ͍

    View full-size slide

  26. SPMFTσΟϨΫτϦ
    ֤ϩʔϧͷ1VQQFUϚχϑΣετΛ
    ഑ஔ͢Δ
    σΟϨΫτϦߏ੒ʹ͍ͭͯ͸ઌड़ͷ
    lೖ໳1VQQFUzΛࢀরͷ͜ͱ

    View full-size slide

  27. TQFDσΟϨΫτϦ
    4FSWFSTQFDͷTQFDϑΝΠϧΛ഑ஔ͢Δ
    ϩʔϧ͝ͱͷαϒσΟϨΫτϦ
    ྫ͑͹NBJMϩʔϧͰGPPQQ CBSQQͱ͍
    ͏ϚχϑΣετΛ࡞੒ͨ͠৔߹ɺͦΕʹ
    ରԠ͢ΔGPP@TQFDSC CBS@TQFDSC౳
    ҙຯͷ͋Δཻ౓୯ҐͰ࡞੒͍ͯ͠Δ

    View full-size slide

  28. WBHSBOUσΟϨΫτϦ
    WBHSBOUؔ࿈Ͱ࢖͏ϑΝΠϧΛ·ͱ
    Ί͍ͯΔ
    QVQQFUBQQMZTI
    CJOTI
    !
    QVQQFUBQQMZa
    NPEVMFQBUIWBHSBOUSPMFTWBHSBOUNPEVMFTa
    TIPX@EJ⒎WFSCPTFa
    WBHSBOUNBOJGFTUTTJUFQQ!

    View full-size slide

  29. NBJM΁ͷ1VQQFUϚχϑΣετద༻
    WBHSBOUTTINBJMDa
    TVEPWBHSBOUWBHSBOUQVQQFUBQQMZTI

    View full-size slide

  30. ػೳ௥ՃɾมߋͷྲྀΕʢ࠶ܝʣ
    TQFDϑΝΠϧมߋ
    TQFDNBJMCBS@TQFDSC
    ςετ࣮ߦ
    GBJMΛ֬ೝ
    QVQQFUϚχϑΣετमਖ਼ɺઌड़ͷίϚϯυͰద༻
    SPMFTNBJMNBOJGFTUTCBSQQ
    ςετ࣮ߦ
    ݁Ռ͕0,Ͱ͋Ε͹ϚχϑΣετͱTQFDϑΝΠϧΛDPNNJU
    CVOEMFFYFDSBLFTQFDNBJM
    CVOEMFFYFDSBLFTQFDNBJM

    View full-size slide

  31. ᶄϙʔϦϯά
    ᶅ1VQQFUˍ
    4FSWFSTQFD
    ࣮ߦ

    View full-size slide

  32. $*αʔό࢓༷
    -JOVY
    σΟετϦ͸ͳΜͰ΋ྑ͍
    ؾ͍ͮͨΒ6CVOUVͷαʔό͕͍ͨ
    +FOLJOT
    ཁ(JU1MVHJO
    7JSUVBM#PYWBHSBOU

    View full-size slide

  33. +FOLJOTδϣϒ
    ֤ϩʔϧ͝ͱʹδϣϒΛ࡞੒

    View full-size slide

  34. +FOLJOTδϣϒ
    ׂͱૉ๿
    Ϗϧυͷ෦෼ʹࢦఆ͍ͯ͠ΔzγΣϧ
    ͷ࣮ߦz͕؊
    CJOTI
    WBHSBOUSVOQVQQFUBOETFSWFSTQFDTINBJM

    View full-size slide

  35. Ϗϧυ಺༰
    CJOTI
    WBHSBOUSVOQVQQFUBOETFSWFSTQFDTINBJM
    ϦϙδτϦʹίϛοτͯ͋͠ΔγΣ
    ϧεΫϦϓτ
    1VQQFU࣮ߦɺ4FSWFSTQFDςετ
    Λ࣮ߦ͢Δ

    View full-size slide

  36. Ϗϧυ಺༰ৄࡉ WNىಈ

    View full-size slide

  37. Ϗϧυ಺༰ৄࡉ 1VQQFUద༻

    QVQQFUBQQMZͷΦϓγϣϯ
    δϣϒͷίϯιʔϧදࣔ༻ʹΧϥʔΛP⒎
    εΫϦϓτ಺Ͱ࢖༻͢ΔͨΊɺFYJUίʔυΛৄࡉ
    ʹ͢Δ

    View full-size slide

  38. Ϗϧυ಺༰ৄࡉ 1VQQFUద༻

    ߏ੒؅ཧπʔϧ͸ద༻ͷॱংΛอূ
    ͠ͳ͍ҝ

    View full-size slide

  39. Ϗϧυ಺༰ৄࡉ 4FSWFSTQFD࣮ߦ

    ͜͜͸ͪΐͬͱΠέͯͳ͍ͷͰमਖ਼
    ͷඞཁ༗Γʜ

    View full-size slide

  40. Ϗϧυ಺༰ৄࡉ ޙย෇͚ɺϏϧυऴྃ

    View full-size slide

  41. ޙ͸δϣϒΛϩʔϧ෼४උ͢Δ͚ͩ
    NBTUFSʹNFSHF͞Εͨͱ͖ʹ֤
    ϩʔϧͰϦάϨογϣϯ͕ى͖ͳ͍
    ͔Ͳ͏͔ʹ͍ͭͯ͸͜Ε͚ͩͰ֬ೝ
    ͕Մೳ
    ڞ௨Ͱࢀর͍ͯ͠Δ߲໨΁ͷมߋ͕
    ͠΍͘͢ͳΔ

    View full-size slide

  42. ίϥϜ%PDLFS͸࢖͍ͬͯͳ͍ʁ
    %PDLFSͷํ͕ܰྔͰ$*޲͖Ͱ͸͋Δ
    ϔςϜϧ͸ΦϯϓϨˍԾ૝Խແ͠ͰαʔόΛӡ
    ༻͍ͯ͠Δ
    ΑΓ࣮ػͷ؀ڥʹ͍ۙ7JSUVBM#PYͰͷ׬શԾ૝
    Խͳ7.ͷํ͕౎߹͕ྑ͍
    ϖύϘࣾ಺Ͱ͸!VE[VSB͕EPDLFSΛ࢖ͬͨ
    Πϯϑϥ$*ΛਐΊ͍ͯͨΓ͢Δ

    View full-size slide

  43. ϋϚͬͨʢϋϚ͍ͬͯΔʣ͜ͱ
    ޙย෇͚࣌ͷ

    WBHSBOUEFTUSPZGPSDF

    Ͱฒߦ࣮ͯ͠ߦ͞Ε͍ͯΔδϣϒͷ7.͕ಓ࿈Εʹ
    ͳΔ
    -JOVYͷΈͰى͖͍ͯΔ໰୊ɺૉৼΓ༻ͷࣗ෼ͷ
    .BD্Ͱ͸࠶ݱ͠ͳ͍
    ผͷษڧձͰ૬ஊͨ͠ͱ͜Ζɺ,7.Ͱ΋ࣅͨΑ͏
    ͳ͜ͱ͕͋Δͱͷ͜ͱ

    View full-size slide

  44. ϋϚͬͨʢϋϚ͍ͬͯΔʣ͜ͱ
    +FOLJOTͷ1SPDFTT5SFF,JMMFSลΓ͔ͳͱࢥͬͯ
    ͍Δ
    IUUQTXJLJKFOLJOTDJPSHEJTQMBZ
    +&/,*/41SPDFTT5SFF,JMMFS
    lBTLUIFTQFBLFSzͰɹ!LPITVLFLBXB͞Μ
    ʹ࣭໰ग़དྷͨͷͰ΋͏গ͠ݟͯΈΑ͏
    ࣅͨ͜ͱ΍ͬͯΔΑͱ͍͏ਓ͸৘ใڞ༗͠·͠ΐ͏

    View full-size slide

  45. ͜Ε͔Β΍Γ͍ͨ͜ͱɾग़དྷ͍ͯͳ͍͜ͱ
    1VMM3FRVFTU࣌ʹ΋֘౰ϩʔϧͰΠϯϑϥ$*
    ࠓ͸NBTUFSͷΈͳͷͰ
    1VMM3FRVFTUͷϒϥϯνͰಉ༷ͷ͜ͱΛ΍Γͨ
    ͍
    +FOLJOTʹͲ͏͍͏෩ʹϩʔϧΛ౉ͯ͠΍Δ͔͕
    ϙΠϯτͦ͏
    +FOLJOTͷ1VMM3FRVFTU#VJMEFS1MVHJO

    View full-size slide

  46. ͜Ε͔Β΍Γ͍ͨ͜ͱɾग़དྷ͍ͯͳ͍͜ͱ
    ςετ͕௨ͬͨΒ*OUFHSBUJPO؀ڥ
    ʹ1VQQFUద༻
    ֤εςʔδͰͷ4FSWFSTQFDఆظ࣮
    ߦ

    View full-size slide

  47. ͜Ε͔Β΍Γ͍ͨ͜ͱɾग़དྷ͍ͯͳ͍͜ͱ
    ΋͏͢͜͠+FOLJOTXBZͰ$*
    ݱঢ়ϏϧυεΫϦϓτຕ
    ΋ͬͱϓϥάΠϯ࢖ͬͨΓ
    ࡉ͔͍δϣϒΛͭͳ͛ͨΓ

    View full-size slide

  48. +FOLJOTҎ֎ͰͷςετۦಈΠϯϑϥˍ$*ྫ
    lαʔόΠϯϑϥపఈ߈ུz
    ಛूlςετۦಈΠϯϑϥ
    ˍ$*࠷લઢ*OGSBTUSVDUVSF
    BT$PEF͕΋ͨΒ͢ϫʔΫϑ
    ϩʔͷ࡮৽z
    8FSLFS %JHJUBM0DFBO

    View full-size slide

  49. ·ͱΊ
    *OGSBTUSVDUVSFBT$PEF
    ίʔυԽग़དྷָͯʹͳͬͨ
    Πϯϑϥ$*
    ͋Δͱ҆৺ͯ͠࡞ۀग़དྷΔ
    ΋ͬͱָ͍ͨ͠ɺ҆৺͍ͨ͠
    ʢ͋ͱग़དྷΕ͹ʣ΋ͬͱڧ͍$*αʔό͕ཉ͍͠

    View full-size slide

  50. ΤϯδχΞੵۃ࠾༻த
    IUUQQFQBCPDPNSFDSVJUQFQBMVODIFPO

    View full-size slide