sphinxからAnsible Playbookを読み込む

28da29f13a2f4e6f602b7bfa032a94cc?s=47 shirou
July 29, 2016

sphinxからAnsible Playbookを読み込む

28da29f13a2f4e6f602b7bfa032a94cc?s=128

shirou

July 29, 2016
Tweet

Transcript

  1. SphinxͱAnsible एࢁ࢙࿠ (πΩϊϫגࣜձࣾ)

  2. ͓·͑ͩΕΑʁ • एࢁ࢙࿠ (@r_rudi) • πΩϊϫגࣜձࣾ • ஶॻ • ೖ໳Ansible

    • SphinxΛ͸͡ΊΑ͏
  3. Ansible

  4. Ansibleͱ͸ • ߏ੒؅ཧπʔϧͷҰͭ (chefͱ͔puppetͱ͔ͱಉ͡) • ଟ਺ͷαʔόʔΛ౷Ұతʹ؅ཧ • ͍Ζ͍Ζ࢖͑Δ • αʔόʔͷߏ੒؅ཧ

    • ΞϓϦͷσϓϩΠ • Ϋϥ΢υαʔϏεͷૢ࡞ • Juniperͱ͔IOSͱ͔΋ରԠ
  5. Ansible Playbookͷྫ - hosts: web tasks: - name: apacheΛΠϯετʔϧ yum:

    name=apache state=installed - name: PHPΛΠϯετʔϧ yum: name=php state=installed - name: php.iniͷઃఆ template: src=php.ini dest=/etc/php.ini - name: ΞϓϦΛσϓϩΠ copy: src=info.php dest=/var/www/html/info.php
 - name: httpdΛىಈ service: name=httpd state=started task
  6. Playbookͷ໰୊఺ • ʮnameʯͷΈ • ͋·Γ௕͍৘ใ͸ॻ͚ͳ͍ • ͋ͱ͸ίϝϯτͰॻ͔͘͠ͳ͍ • https://github.com/h-hirokawa/ansible- playbook-docgen

  7. Sphinx Autodoc

  8. Sphinx Autodoc • Pythonίʔυ͔ΒAPIυΩϡϝϯτΛࣗಈੜ੒ ͢Δػೳ • docstring͔ΒυΩϡϝϯτΛੜ੒ͯ͘͠ΕΔ • ৄ͘͠͸Software Design

    9݄߸Ͱ
  9. ࣮ྫ EFGEVNQT PCK FOTVSF@BTDJJ5SVF  4FSJBMJ[FAAPCKAAUPB+40/
 QBSBNEJDUPCKEJDUUZQFPCKFDUUPTFSJBMJ[F QBSBNCPPMFOTVSF@BTDJJ%FGBVMUJT5SVF*G 'BMTF BMMOPO"4$**DIBSBDUFSTBSFOPU

    SFUVSO+40/GPSNBUUFETUSJOH SUZQFTUS  SFUVSOUPCFJNQMFNFOUFE BVUPTVNNBSZ UPDUSFFHFOFSBUFE VUJMT  QZUIPO EPDTUSJOH 4QIJOY
  10. ݁Ռ

  11. Autodocͷ࢖͍Ͳ͜Ζ • ιʔείʔυʹॻ͍͓͚ͯ͹ɺυΩϡϝϯτ ʹ΋͏Ұ౓ॻ͘ඞཁ͸ͳ͍ • υΩϡϝϯτશମ͸खͰࣥච • ඞཁʹԠͯؔ͡਺ͷઆ໌Λݺͼग़͢

  12. AnsibleͰautodoc • Playbookʹ͸͋Μ·Γ৘ใΛهࡌͰ͖ͳ͍ ͕ɺυΩϡϝϯτʹ͸هࡌͰ͖Δ • Playbookʹॻ͍ͯ͋Δ͜ͱΛυΩϡϝϯτʹ ΋͏Ұ౓ॻ͘ඞཁ͸ͳ͍

  13. ࡞ͬͯΈ·ͨ͠

  14. Sphinx ansibleautodoc

  15. ࢖͍ํ QJQJOTUBMMTQIJOYDPOUSJCBOTJCMFBVUPEPD DPOGQZͷFYUFOTJPOʹ
 TQIJOYDPOUSJCBOTJCMFBVUPEPD
 Λ௥Ճ

  16. IPTUTXFC UBTLT OBNFBQBDIFΛΠϯετʔϧ ZVNOBNFBQBDIFTUBUFJOTUBMMFE OBNF1)1ΛΠϯετʔϧ ZVNOBNFQIQTUBUFJOTUBMMFE OBNFΞϓϦΛ഑ஔ DPQZ TSDJOGPQIQEFTUWBSXXX IUNMJOGPQIQ

    ࠓճͷΞϓϦέʔγϣϯ͸ QIQϑΝΠϧΛର৅ϗετʹஔ͘͜ ͱͰσϓϩΠ͠·͢ɻ BOTJCMFBVUPUBTLΞϓϦΛ഑ஔ QMBZCPPLBOTJCMFXFCZNM BOTJCMFQMBZCPPL 4QIJOY
  17. None
  18. ansibleautodoc • ࢦఆͨ͠playbook͔Βɺࢦఆͨ͠nameͷtask Λݕࡧ͠ɺදࣔ͢Δ • includeઌ΋role಺΋ಡΈࠐΜͰݕࡧ͢Δ

  19. ͪΐͬͱͨ͠
 σϞ

  20. ੍ݶࣄ߲ • ม਺ల։͸͞Ε·ͤΜ(YAMLΛղੳ͍ͯ͠Δ͚ͩ) • Ͳ͏͍͏ද͕ࣔྑ͍͔͸ࢼߦࡨޡத • ςʔϚʹΑͬͯ͸ݟͨ໨͕ม • ҰݸͷλεΫ͚ͩͰ͢ •

    λεΫΛશ෦දࣔ͢Δػೳ͸·ͩ͋Γ·ͤΜ
  21. ·ͱΊ

  22. ·ͱΊ • SphinxͷAutodocػೳ͸ศར • AnsibleͷPlaybookΛSphinx͔Β࢖͍͍ͨ • υΩϡϝϯτΛҰՕॴʹ·ͱΊΔ • sphinxcontrib-ansibleautodocΛ࡞Γ·ͨ͠ •

    nameΛࢦఆͯͦ͠ͷtaskͷ಺༰Λදࣔ
  23. πΩϊϫגࣜձࣾ: ࣾһืूத! • 9݄ʹҾӽ͠༧ఆ • डୗ։ൃ͕த৺Ͱ͢ • Sphinx/Ansible/Golang/Django/Elixir/React Native ͳͲͳͲɺ͍Ζ͍Ζͳٕज़Λ࢖͍ͬͯ·͢

    • ϦϞʔτϫʔΫՄೳ (طʹઋ୆ʹࣾһ͕͍·͢) • Twitter: @r_rudi ͔ @hfunai ·Ͱ͝࿈བྷ