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

Infrastructure as Code in Pairs

Infrastructure as Code in Pairs

Infrastructure as Code in Pairs

sakajunquality

August 29, 2017
Tweet

More Decks by sakajunquality

Other Decks in Programming

Transcript

  1. Copyright © 2017 eureka, Inc. All rights reserved. Infrastructure as

    Code in Pairs 17.07.13 eureka Meetup #05 -SRE Night- Jun Sakata @sakajunquality
  2. Copyright © 2017 eureka, Inc. All rights reserved. 2 who

    am i  43&%JW4FOJPS&OHJOFFS  OFUXPSL NJEEMFXBSF "84  BQQ TPNFUJNFT   'BWPSJUFUDQEVNQUFMOFU @sakajunquality
  3. Copyright © 2017 eureka, Inc. All rights reserved. 3 who

    am i  -JLF)BSEXBSFTXJUDI  $JTDP--  +VOJQFS'JSFXBMM  5PPOPJTZUPTMFFQ
  4. Copyright © 2017 eureka, Inc. All rights reserved. #eureka_meetup 7

    $IFG "OTJCMF 1VQFU $MPVE'PSNBUJPO 5FSSBGPSN 1BDLFS Tools for Infrastructure as Code
  5. Copyright © 2017 eureka, Inc. All rights reserved. #eureka_meetup 8

    Idea of Infrastructure as Code “5IFFOBCMJOHJEFBPGJOGSBTUSVDUVSFBTDPEFJTUIBUUIF TZTUFNTBOEEFWJDFTXIJDIBSFVTFEUPSVOTPGUXBSFDBOCF USFBUFEBTJGUIFZ UIFNTFMWFT BSFTPGUXBSF” – Morris, Infrastructure as Code
  6. Copyright © 2017 eureka, Inc. All rights reserved. #eureka_meetup 9

    Idea of Infrastructure as Code more practically “UIFQSBDUJDFJOXIJDIUIFUFDIOJRVFT QSPDFTTFT BOEUPPMTFUT VTFEJOTPGUXBSFEFWFMPQNFOUBSFMFWFSBHFEUPNBOBHFUIF EFQMPZNFOUBOEDPOpHVSBUJPOPGTZTUFNT BQQMJDBUJPOT BOE NJEEMFXBSF” – http://www.itproguy.com/2015/06/26/devops-practices/
  7. Copyright © 2017 eureka, Inc. All rights reserved. #eureka_meetup 10

    Idea of Infrastructure as Code more practically Codenizing is not good enough – according to me
  8. Copyright © 2017 eureka, Inc. All rights reserved. #eureka_meetup 11

    4PGUXBSF%FWFMPQNFOU 5IF6/*91IJMPTPQIZ Key Concepts
  9. Copyright © 2017 eureka, Inc. All rights reserved. #eureka_meetup 12

    7FSTJPODPOUSPM NPTUMZHJU $PEF3FWJFX 5FTUJOH $*$% FUD Key Concepts: Software Development
  10. Copyright © 2017 eureka, Inc. All rights reserved. #eureka_meetup 13

    3VMFPG.PEVMBSJUZ 3VMFPG4JNQMJDJUZ 4NBMMJTCFBVUJGVM FUD Key Concepts: The UNIX Philosophy
  11. Copyright © 2017 eureka, Inc. All rights reserved. #eureka_meetup 14

    $IFG "OTJCMF 1VQFU $MPVE'PSNBUJPO 5FSSBGPSN 1BDLFS Tools for Infrastructure as Code
  12. Copyright © 2017 eureka, Inc. All rights reserved. #eureka_meetup 15

    $POpHVSBUJPO.BOBHFNFOU5PPMT 4FSWFS5FNQMBUJOH5PPMT Tools for Infrastructure as Code – Brikman, Terraform Up & Running
  13. Copyright © 2017 eureka, Inc. All rights reserved. #eureka_meetup 16

    #VUQSBDUJDBMMZUIPTFUPPMTIBWFGVODUJPOTGPSNBOBHJOHUIFTBNFBSFB FH:PVDPVMEMBVODI&$JOTUBODFXJUI"OTJCMF Tools for Infrastructure as Code
  14. Copyright © 2017 eureka, Inc. All rights reserved. #eureka_meetup 17

    "QQSPQSJBUFUPPMTGPSl*OGSBTUSVDUVSFBTDPEFzNVTUCFEFpOFECZ JOGSBTUSVDUVSFBOEQVSQPTF *UTIPVMEOPUCFBUPPMESJWFO Infrastructure as Code in Practice
  15. Copyright © 2017 eureka, Inc. All rights reserved. #eureka_meetup 19

    .VMUJ3FHJPO KQUX  4FWFSBM.JDSPTFSWJDFT 4PNF$PSQPSBUF4FSWJDFT .VMUJ&OWJSPONFOU 1SPE4UBHF Pairs: Infrastructure
  16. Copyright © 2017 eureka, Inc. All rights reserved. #eureka_meetup 20

    /PBEIPDTDSJQU PQFSBUJPO &BTJFSJOGSBTUSVDUVSFTFUVQ 3FQFBUBCMFJOGSBTUSVDUVSFXJUIJEFNQPUFODZ .BOBHFBTNVDIBTQPTTJCMFJODPEF Pairs: Purpose and Scope for IAC
  17. Copyright © 2017 eureka, Inc. All rights reserved. #eureka_meetup 21

    Pairs: Overview of Infrastructure as Code 1BDLFS &$4QPU ".* &$*OTUBODF 5FSSBGPSN 0UIFS"84 3FTPVSDFT "OTJCMF 1MBZCPPL $PNNPO 3PMFT .PEVMFT
  18. Copyright © 2017 eureka, Inc. All rights reserved. #eureka_meetup 23

    Packer and Ansible: Why? 1BDLFS  ".*1BDLBHJOH  /PPUIFSDIPJDF "OTJCMF  1SPWJTJPOJOHJOTJEF1BDLFS  ,OPXMFEHFJOUIFUFBN
  19. Copyright © 2017 eureka, Inc. All rights reserved. #eureka_meetup 24

    Packer and Ansible 6TJOHDPNNPO"OTJCMFSPMFGPS1BDLFS 1BDLFS &$4QPU ".* "OTJCMF 1MBZCPPL $PNNPO 3PMFT
  20. Copyright © 2017 eureka, Inc. All rights reserved. #eureka_meetup 25

    Packer and Ansible 4FQBSBUFE1MBZCPPLTBOE3PMFTQSPEVDFTPNVDIEVQMJDBUJPO 1BDLFS 1BJST+1 ".* "OTJCMF 1MBZCPPL 1BDLFS 1BJST58 ".* "OTJCMF 1MBZCPPL 1BDLFS .JDSPTFSWJDF ".* "OTJCMF 1MBZCPPL 3PMFT 3PMFT 3PMFT
  21. Copyright © 2017 eureka, Inc. All rights reserved. #eureka_meetup 26

    Packer and Ansible 6TFDPNNPOSPMFTBOETFQBSBUFQMBZCPPL 1BDLFS 1BJST+1 ".* "OTJCMF 1MBZCPPL 1BDLFS 1BJST58 ".* "OTJCMF 1MBZCPPL 1BDLFS .JDSPTFSWJDF ".* "OTJCMF 1MBZCPPL $PNNPO 3PMFT
  22. Copyright © 2017 eureka, Inc. All rights reserved. #eureka_meetup 29

    Packer and Ansible: Common role 3PMFTBSFVTFEBOENPEJpFEJOTFWFSBMQMBZCPPLT 1SPWJTJPOJOHSFTVMUJTOPUHVBSBOUFFE "OTJCMF 1MBZCPPL" "OTJCMF 1MBZCPPL# $PNNPO 3PMFT "OTJCMF 1MBZCPPL$ Modification Modification Modification Modification Modification
  23. Copyright © 2017 eureka, Inc. All rights reserved. #eureka_meetup 30

    Packer and Ansible: Common role  $BSFGVMNPEJpDBUJPO0GDPVSTFCVUOPUHPPEFOPVHI  $BSFGVMDPEFSFWJFX0GDPVSTFCVUTUJMMOPUHPPEFOPVHI 8FOFFE5&45 $PNNPO 3PMFT 4FSWFS .PDL 1MBZCPPL 5FTU CI
  24. Copyright © 2017 eureka, Inc. All rights reserved. #eureka_meetup 31

    Packer  1BDLFSBOE"OTJCMFEJSFDUPSZ 1BDLFS ᵓᴷᴷBOTJCMFSPMFTDPNNPOSPMFT ᴹᵓᴷᴷDPNNPO ᴹᵓᴷᴷOHJOY ᴹᵋᴷᴷFUDʜ ᵓᴷᴷNJDSPTFSWJDFT ᴹᵋᴷᴷNPEFSBUJPO ᴹᵓᴷᴷQSPE ᴹᴹᵓQSPWJTJPOFSTBOTJCMFQMBZCPPL ᴹᴹᵋCVJMEFSTQBDLFSSFDJQF ᴹᵋᴷᴷTUBH ᵋᴷᴷQBJST ᵓᴷᴷKQ ᵋᴷᴷUX
  25. Copyright © 2017 eureka, Inc. All rights reserved. #eureka_meetup 33

    Terraform: Why? 5FSSBGPSN  .BOBHJOH"84BOE($1SFTPVSDFTJODPEF  (PPEEPDVNFOUBUJPO  3FMBUJWFMZSBQJETVQQPSUGPS"84TFSWJDF
  26. Copyright © 2017 eureka, Inc. All rights reserved. #eureka_meetup 34

    Terraform  TFSWJDF FOW BOEUFSSBGPSNEJSFDUPSZ  "DUJWFMZVTFNPEVMF .PEVMFT 1SPE &OW
  27. Copyright © 2017 eureka, Inc. All rights reserved. #eureka_meetup 35

    Terraform  5SZOPUUPNBLFNPEVMFTIVHF  "MMPXEVQMJDBUJPOUPTPNFFYUFOU .PEVMFT 1BJST +1 1SPE4UBHF 58 1SPE4UBHF .PEVMFT .JDSPTFSWJDF .PEFSBUJPO 1SPE4UBHF )PHF 1SPE4UBHF
  28. Copyright © 2017 eureka, Inc. All rights reserved. #eureka_meetup 36

    Terraform  5FSSBGPSNEJSFDUPSZ UFSSBGPSN ᵓᴷᴷDPSQPSBUF ᴹᵓᴷᴷQSPE ᴹᵋᴷᴷTUBH ᵓᴷᴷNJDSPTFSWJDFT ᴹᵓᴷᴷNPEVMFT ᴹᵓᴷᴷQBZNFOU ᴹᴹᵓᴷᴷQSPE ᴹᴹᵋᴷᴷTUBH ᴹᵋᴷᴷNPEFSBUJPO ᴹᵓᴷᴷQSPE ᴹᵋᴷᴷTUBH ᵋᴷᴷQBJST ᵓᴷᴷNPEVMFT ᵓᴷᴷQSPE ᴹᵓᴷᴷKQ ᴹᵋᴷᴷUX ᵋᴷᴷTUBHF ᵓᴷᴷKQ ᵋᴷᴷUX
  29. Copyright © 2017 eureka, Inc. All rights reserved. #eureka_meetup 38

    Best Practice? 1 https://github.com/hashicorp/best-practices
  30. Copyright © 2017 eureka, Inc. All rights reserved. #eureka_meetup 39

    Best Practice? 2 http://dev.classmethod.jp/devops/directory-layout-bestpractice-in-terraform/
  31. Copyright © 2017 eureka, Inc. All rights reserved. #eureka_meetup 40

    Best Practice? 3 https://www.amazon.co.jp/dp/1491977086/
  32. Copyright © 2017 eureka, Inc. All rights reserved. #eureka_meetup 41

    Best Practice? %PFTJUTVJUZPVSSFRVJSFNFOUT  *TO`UJUUPPDPNQMFY
  33. Copyright © 2017 eureka, Inc. All rights reserved. #eureka_meetup 42

    Best Practice? #FTUQSBDUJDFJTOPUBMXBZTCFTU
  34. Copyright © 2017 eureka, Inc. All rights reserved. #eureka_meetup 44

    Community module? https://galaxy.ansible.com/list#/roles?page=1&page_size=10
  35. Copyright © 2017 eureka, Inc. All rights reserved. #eureka_meetup 45

    Community module? https://github.com/terraform-community-modules
  36. Copyright © 2017 eureka, Inc. All rights reserved. #eureka_meetup 47

    Community Modules? *TJUNBJOUBJOFE  8IBUJGJUJTOPMPOHFSNBJOUBJOFE
  37. Copyright © 2017 eureka, Inc. All rights reserved. #eureka_meetup 49

    "VUPNBUFEAUFSSBGPSNQMBOA 3FTVMUUP(JUIVCDPNNFOUXJUI$* /PABQQMZAZFU Automation: Terraform Plan
  38. Copyright © 2017 eureka, Inc. All rights reserved. #eureka_meetup 50

    "84.BOBHFE#VJME%FQMPZ 7JB4MBDLBQQ Automation: Build & Deployment
  39. Copyright © 2017 eureka, Inc. All rights reserved. #eureka_meetup 52

    6TFTPGUXBSFEFWFMPQNFOUUFDIOJRVFT "QQSPQSJBUFUPPMTGPSUIFQVSQPTF ,FFQJNQSPWJOH LFFQHPJOH Conclusion