Slide 1

Slide 1 text

2013/06/21 @tnmt Puppet ΍ Chef ͷجૅ ͳΜͰඞཁͳͷͱ͔

Slide 2

Slide 2 text

ຊ೔ͷΞδΣϯμ ✤ Puppet, Chefͱ͸ ✤ Puppet, Chefͷඞཁੑ ✤ Puppet, Chefͷߏ੒ ✤ ΠϯϑϥͷίʔυԽͱͦͷपล஌ࣝ

Slide 3

Slide 3 text

Puppet, Chefͱ͸

Slide 4

Slide 4 text

Puppet, Chef ✤ Provisioning Framework < Configuration Management Framework

Slide 5

Slide 5 text

Configuration Management ✤ ߏ੒؅ཧͷλεΫྫ ✤ ωοτϫʔΫઃఆ ✤ Ϣʔβ࡞੒ɾ؅ཧ ✤ ιϑτ΢ΣΞΠϯετʔϧઃఆ ✤ ͜ΕΒΛ”͋Δ΂͖ঢ়ଶ”ʹҡ࣋͢Δ͜ͱ͕ߏ੒؅ཧ ✤ ͦΕΛ࣮ݱ͢ΔͨΊͷπʔϧ͕Puppet, Chef

Slide 6

Slide 6 text

Puppet, Chefͷඞཁੑ

Slide 7

Slide 7 text

ৄ͘͠͸ ✤ mizzy͞ΜͷPuppet࿈ࡌॳճ http://gihyo.jp/admin/serial/01/ puppet/0001 ΍ ✤ antipop͞Μͷ”ೖ໳Puppet”ୈ1ষ ʮͳͥPuppet͕ඞཁͳͷ͔ʁʯ ✤ Λࢀߟʹ…͍ͬͯ͏ͱ͋ΕͳͷͰ࣮ࡍಡΈ߹Θͤ

Slide 8

Slide 8 text

ߏ੒؅ཧλεΫͷ࣮ݱํ๏ʢ̍ʣ ✤ खॱॻʹΑΔखಈઃఆ ✤ ख࡞ۀʹΑΔ࣌ؒͷϩε ✤ ΦϖϨʔγϣϯϛεͷՄೳੑ ✤ खॱॻͷߋ৽๨Εɺܗ֚Խɺ੔߹ੑҡ͕࣋೉͍͠

Slide 9

Slide 9 text

ߏ੒؅ཧλεΫͷ࣮ݱํ๏ʢ̎ʣ ✤ εΫϦϓτʹΑΔࣗಈԽ ✤ εΫϦϓτͷ඼࣭ҡ͕࣋ݸਓͷεΩϧʹΑΔ ✤ ߏ੒มߋ΁ͷ௥ै͕೉͍͠ʢޙड़͢Δႈ౳ੑʣ

Slide 10

Slide 10 text

͜͜Ͱ ✤ खॱॻ͕ͻͲ͍ͱ͜ΖΛݟͤΔʢٽ͖ͳ͕Βʣ

Slide 11

Slide 11 text

Chef, Puppetେࣄɾخ͍͜͠ͱ ✤ ႈ౳ੑ ✤ ίʔυ඼࣭ͷۉҰԽ ✤ ίϥϘϨʔγϣϯՄೳ

Slide 12

Slide 12 text

ႈ౳ੑ ✤ Կ౓࣮ߦͯ͠΋ಉ͡ঢ়ଶʹͳΔ͜ͱ ✤ ৽نɾطଘʹରͯ͠ͷૢ࡞Ͱ΋ಉ͡

Slide 13

Slide 13 text

ίʔυ඼࣭ͷۉҰԽ ✤ େମ୭͕ॻ͍ͯ΋ࣅͨΑ͏ͳײ͡ʹͳΔ ✤ ݚमͰ࡞ͬͯΔ manifest ݟͯ΋ͦ͏ͩΑͶʁ ✤ ଞͷਓ͕ॻ͍ͯΔͷΛݟΕ͹େମԿ΍ͬͯΔ͔෼͔Δ ✤ ී௨ʹ࢖͍ͬͯΕ͹ݸਓͷεΩϧʹ͋Μ·Γࠨӈ͞Εͳ͍ ✤ ෳࡶͳه๏ॻ͖࢝ΊΔͱ·ͨผ͚ͩͲ…

Slide 14

Slide 14 text

ίϥϘϨʔγϣϯՄೳ ✤ ΤϯδχΞಉ࢜Ͱ૬ޓʹվળ͕Մೳ ✤ Opsಉ࢜Ͱ΋ɻDev͕ॻ͍͍͍ͨͬͯ (DevOps) ✤ VCSΛ༻͍ͨվળ (Pull Request, ϨϏϡʔ) ✤ ௥੻Մೳͱ͍͏ϝϦοτ

Slide 15

Slide 15 text

Puppet, Chefͷߏ੒

Slide 16

Slide 16 text

Puppet, Chefͷൺֱ ݴޠ σΟϨΫτϦߏ੒ Puppet ֎෦DSL ൺֱతࣗ༝ Chef ಺෦DSL (Ruby) ܾ·͍ͬͯΔ

Slide 17

Slide 17 text

ͱ͸͍͑ ✤ ઌ΄Ͳͷ͸֤ϓϩμΫτͷ࢓༷తͳͱ͜ΖͷൺֱͰ ✤ ʢೖ໳ Puppet ʹ΋هࡌͯ͋͠Δʣ ✤ ࣮ࡍʹఏڙ͞ΕΔػೳͱͯ͠͸େ͖ࠩ͘͸ͳ͍ ✤ Ҏ߱͸ڞ௨͍ͯ͠Δӡ༻ʢ࢖͍ํʣͷઆ໌

Slide 18

Slide 18 text

Master, Agentܕ ✤ Puppetͷmanifest, Chefͷrecipe Λूத؅ཧ͢ΔϚελʔɺద༻͢Δ ΤʔδΣϯτͷܗΛऔΔ͜ͱ͕ग़དྷΔ ✤ طଘͷϖύϘ঎ࡐ͸͜ͷߏ੒Λऔ͍ͬͯΔͱ͜Ζ͕ଟ͍ ✤ node৘ใͷ؅ཧ͕ඞཁ ✤ PuppetͩͱςΩετʢ࣮ྫʣɺLDAPͳͲऔΕΔ ✤ ‘puppet agent’ ‘chef-client’

Slide 19

Slide 19 text

Puppetͷྫ

Slide 20

Slide 20 text

୯ମͰ࣮ߦ ✤ manifest, recipe Λద༻͢Δαʔόʹ഑ஔͯ͠୯ମͰ࣮ߦ͢Δ ✤ Master, AgentܕΑΓ͓खܰ ✤ ‘puppet apply’, ‘chef-solo’ ✤ ࠷ۙ͸ͪ͜Β͕ਓؾग़͖ͯͯΔʢޙड़ʣ

Slide 21

Slide 21 text

ΠϯϑϥͷίʔυԽ

Slide 22

Slide 22 text

ίϥϘϨʔγϣϯՄೳͱॻ͍ͨ ✤ Manifest, Cookbooks Λόʔδϣϯ؅ཧग़དྷͯɺෳ਺ਓͰ؅ཧ ✤ ϨϏϡʔͨ͠Γվળͨ͠Γग़དྷΔ ✤ ͜Εͬͯී௨ʹϓϩάϥϜͱҰॹ

Slide 23

Slide 23 text

ϓϩάϥϜͱҰॹ ✤ ͜ΜͳྲྀΕ͕ग़དྷΔΑ͏ʹͳΔ ✤ खݩͷvagrantͰmanifest΍recipeΛ࡞੒ͯ͠ (development) ✤ ࣾ಺ͷmaglica؀ڥͳͲͰ֬ೝͯ͠ (integration) ✤ ࣮ࡍͷαʔϏεͷεςʔδϯάͰ֬ೝͯ͠ (staging) ✤ ຊ൪ʹ౤ೖ (production)

Slide 24

Slide 24 text

ϓϩάϥϜͱҰॹ ✤ ͜͏͍͏ͱ͖͸୯ମ࣮ߦ͕ศརͩͶ ✤ ֤؀ڥʹpupper-server΍chef-serverΛߏங͢Δͷ͸͠ΜͲ͍ ✤ ͔͠΋ͦΕΒ͸ӡ༻ʹͦΕͳΓʹख͕͔͔ؒΔ

Slide 25

Slide 25 text

Vagrant ✤ ‘vagrant provision’ ίϚϯυ ✤ http://docs-v1.vagrantup.com/v1/docs/provisioners.html ✤ ࡞ͬͯյͯ͠ͱ͍͏ͷ͕؆୯ʹग़དྷΔ

Slide 26

Slide 26 text

ࠓ·ͰͷδϨϯϚ ✤ manifest΍recipeͷ֬ೝ͕େม ✤ ࡞੒ ✤ ద༻ ✤ ֬ೝ ʢ໨ࢹʣ

Slide 27

Slide 27 text

໘౗ͳ͜ͱ͸CI ✤ ͜͜࠷ۙ೤͍τϐοΫ ✤ ϓϩάϥϚϒϧʹαʔόߏங͕ग़དྷΔΑ͏ʹͳͬͨ ✤ ֬ೝ΍ςετΛCIͰճͤΔΑͱ͍͏ͷͰઌਓ͕ϊ΢ϋ΢ΛஷΊͯڞ༗ ͖͍ͯͯ͠Δ

Slide 28

Slide 28 text

ႈ౳ੑສࡀ ✤ طଘͷαʔό΁ͷద༻ ✤ ৽نαʔόͷߏங ✤ ͲͪΒʹͰ΋࢖͑ΔɺͲͪΒ΋֬ೝग़དྷΔ

Slide 29

Slide 29 text

CIྫ (Puppet) ✤ “Ukigumo ͱ serverspec Ͱ Puppet ͷܧଓతΠϯςάϨʔγϣϯ” ✤ http://mizzy.org/blog/2013/03/27/2/ ✤ puppet-lxc-box Ͱ࡞ͬͨίϯςφʹରͯ͠ܧଓతʹ puppet apply ͠ ͯ݁ՌΛϨϙʔτ

Slide 30

Slide 30 text

CIྫ (Chef) ✤ “Vagrant + Chef Solo + serverspec + Jenkins ͰαʔόʔߏஙΛ CI” ✤ http://d.hatena.ne.jp/naoya/20130520/1369054828 ✤ vagrant ʹΑͬͯ࡞੒ͨ͠ vm ʹରͯ͠ɺ৽ن࡞੒→knife-soloద༻ →serverscpec→ഁغ ͱ͍͏ྲྀΕ

Slide 31

Slide 31 text

ઌ΄ͲͷCIͷλΠτϧΛݟ௚͢ ✤ “Ukigumo ͱ serverspec Ͱ Puppet ͷܧଓతΠϯςάϨʔγϣϯ” ✤ “Vagrant + Chef Solo + serverspec + Jenkins ͰαʔόʔߏஙΛ CI”

Slide 32

Slide 32 text

serverspecʹ͍ͭͯ͸ ✤ ࠓ೔ͷ hbstudy#45 Ͱʂʂ̍

Slide 33

Slide 33 text

͓·͚ʣ΋͏̍ͭͷςετ ✤ αʔϏε؂ࢹ (ϞχλϦϯά͡Όͳͯ͘ࢮ׆؂ࢹͳͲ) ✤ ϖύϘͰ͸NagiosΛ࢖͍ͬͯΔ ✤ NagiosपΓ͸ࠇా͞Μ͕ࠓ౓࿩ͯ͘͠Ε·͢ ✤ serverspec͕ϗϫΠτϘοΫεςετͳΒ, αʔϏε؂ࢹ͸ϒϥοΫϘ οΫεςετ ✤ ʢ௥هʣ࣮ࡍӡ༻தͷNagiosը໘ΛݟͯΈͨ