Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Ansible Configuration Management Tool 소개 및 활용

Ansible Configuration Management Tool 소개 및 활용

  • Login to see the comments

Ansible Configuration Management Tool 소개 및 활용

  1. 1. Ansible 
 Configuration Management 
 & / AWS
  2. 2. • DevOps • Ansible • Ansible • Inventory, Variable, Role, Template, Condition, Loop • • OS , , Packer Ansible •
  3. 3. DevOps ..
  4. 4. DevOps? ? Engineering Culture Development Operation
  5. 5. DevOps? ? Google DevOps 5 • • • • •
  6. 6. DevOps? ? Eliminating Toils ( ) - Google SRE • • • • • O(n)
  7. 7. Automation Automation all the things!! ?
  8. 8. Automation vs https://liggat.org/automate-all-the-things/
  9. 9. Automation
  10. 10. CM Tool • Ansible • Chef • Puppet • SaltStack • Etc..
  11. 11. CM Tool • Tool Tool • Tool ? • / / / / OK
  12. 12. Ansible
  13. 13. Agentless
  14. 14. Ansible - Agentless Agentless (SSH ) https://blog.knoldus.com/introduction-to-ansible/
  15. 15. Ansible - Agentless Agentless (SSH ) Agent ! Agent .
  16. 16. Ansible - Agentless SSH ...
  17. 17. Ansible - Agentless SSH ... SSH ? ... Control ? ...?
  18. 18. Ansible - Agentless SSH vs Agent
  19. 19. Ansible - Agentless https://www.cvedetails.com/vulnerability-list/vendor_id-97/product_id-585/Openbsd-Openssh.html
 https://www.cvedetails.com/vulnerability-list/vendor_id-15862/product_id-40551/Chef-Chef.html
  20. 20. YAML
  21. 21. Ansible - YAML . YAML
  22. 22. Ansible - YAML
  23. 23. Modules
  24. 24. Ansible - Modules 1850
  25. 25. Ansible - Modules Linux Module 
 yum, apt, user, hostname, timezone, sysctl, cront, etc IaC 
 ec2, ec2_elb, elb_target, lambda, ec2_vpc, sqs_queue, etc
  26. 26. Ansible - Modules IaC (Infrastructure as Code) Ansible ..? . ) 
 IaC Module ‘ ’ Ansible 
 Terraform CloudFormation
  27. 27. (idempotent)
  28. 28. Ansible -
  29. 29. Ansible -
  30. 30. Ansible - • Module • command, shell • • • ... •
  31. 31. Ansible - Inventory /etc/ansible/hosts playbook directory hosts host
  32. 32. Ansible - Host Module Options
  33. 33. Ansible - (2) , playbook
  34. 34. Ansible Playbook
  35. 35. Ansible Playbook
  36. 36. Ansible Playbook Tree Ansible Playbook Home & Inventory Role target Task Triggering Task Playbooks Role Dependency Task target + jinja2 . Default Role
  37. 37. Ansible Playbook Tree Ansible Playbook Home & Inventory Role target Task Triggering Task Task target + jinja2 . Default Playbooks Role
  38. 38. Ansible Playbook Tree
  39. 39. Ansible Playbook
 config & Inventory
  40. 40. Ansible Playbook Tree Ansible Playbook Home & Inventory
  41. 41. Ansible configuration ansible.cfg config 1. ANSIBLE_CONFIG 2. ansible.cfg ( ) 3. ~/.ansible.cfg ( Home Dir) 4. /etc/ansible/ansible.cfg 2 - Git Config
  42. 42. Inventory hosts Inventory 
 (/etc/hosts ) Host IP Host Group Host Name
  43. 43. Ansible Playbook
 playbook.yml
  44. 44. Ansible Playbook Tree Playbooks Role Directory = Role
  45. 45. Playbook playbook/httpd.yml Target Host playbook ansible.cfg override Role
  46. 46. Ansible Playbook
 Tasks & Vars
  47. 47. Ansible Playbook Tree Role Directory = Role Tasks
  48. 48. Role / Var httpd/vars/main.yml
  49. 49. Role / Task httpd/tasks/main.yml yum module Package Loop
  50. 50. Ansible Playbook
 Tasks & Templates & Vars
  51. 51. Role / Template Role Directory = Role Tasks Template File
  52. 52. Role / Template httpd/tasks/main.yml template file Template 
 +
  53. 53. Role / Template httpd/templates/httpd-vhost.conf.j2
  54. 54. Ansible Playbook
 Handler
  55. 55. Ansible Playbook Tree Role Directory = Role Tasks Tasks Triggering Handler
  56. 56. Role / Handler httpd/tasks/main.yml Handler Triggering Task Triggering . ( , role triggering)
  57. 57. Role / Handler httpd/handlers/main.yml tasks/main.yml
  58. 58. Role / Handler Task 
 notify 
 (handler trigger) Role 
 triggered Role 
 Task !
  59. 59. Role / Handler 
 = Handler
  60. 60. Role / Handler httpd/tasks/main.yml trigger handler
  61. 61. Role / Handler Task 
 notify 
 (handler trigger) Handler Role/Task
  62. 62. Ansible Playbook
 Role
  63. 63. Role Tomcat Install 
 Playbook Tomcat Install Role Java Install Role Scouter Server 
 Install Playbook ScouterServer
 Install Role Role Playbook
  64. 64. Role playbook/tomcat.yml playbook/scouter.yml
  65. 65. Ansible Playbook 
 AMI /
  66. 66. Immutable Infrastructure
  67. 67. Mutable Infrastructure Instance A OS v1.0 App v1.0 Instance A OS v1.1 App v1.0 Instance A OS v1.1 App v1.1Mutable
 Infrastructure Status
  68. 68. Immutable Infrastructure Instance A OS v1.0 App v1.0 Instance Image A Instance A’ OS v1.1 App v1.0 Immutable
 Infrastructure Instance Image B Instance B OS v1.1 App v1.0 Instance A’
  69. 69. Immutable Infrastructure Instance A OS v1.0 App v1.0 Instance Image A Instance A’ OS v1.1 App v1.0 Immutable
 Infrastructure Instance Image B Instance B OS v1.1 App v1.0 Instance A’ CM Tool
  70. 70. Immutable Infrastructure -
  71. 71. Immutable Infrastructure Instance A OS Pure
 Amazon
 Linux Instance A’ OS v1.0 Base 
 OS v1.0 ex) package OS agent
  72. 72. Immutable Infrastructure Instance A OS v1.0 Instance Instance A’ OS v1.0 Middleware A v1.0 A
 Base 
 OS Image
 v1.0 Service A 
 Base OS Image v1.0 Instance B OS v1.0 B
 Instance B’ OS v1.0 Middleware B v1.0 Service B 
 Base OS Image v1.0
  73. 73. Service A 
 Base OS Image v1.0 Service B 
 Base OS Image v1.0 Immutable Infrastructure Instance Instance A OS v1.0 Middleware A v1.0 A Source Code v1.0 Instance A’ OS v1.0 Middleware A v1.0 Instance Instance B OS v1.0 Middleware B v1.0 B Source Code v1.0 Instance B’ OS v1.0 Middleware B v1.0
  74. 74. Service A 
 Base OS Image v1.0 Service B 
 Base OS Image v1.0 Instance Instance A OS v1.0 Middleware A v1.0 A Source Code Instance A’ OS v1.0 Middleware A v1.0 Instance Instance B OS v1.0 Middleware B v1.0 B Source Code Instance B’ OS v1.0 Middleware B v1.0 Instance A OS v1.0 Instance Instance A’ OS v1.0 Middleware A A
 Base 
 OS Image
 v1.0 Instance B OS v1.0 B
 Instance B’ OS v1.0 Middleware B Instance A OS Pure
 Amazon
 Linux Instance A’ OS v1.0
  75. 75. Immutable Infrastructure /
  76. 76. Service A 
 Base OS Image v1.0 Service B 
 Base OS Image v1.0 Instance Instance A OS v1.0 Middleware A v1.0 A Source Code Instance A’ OS v1.0 Middleware A v1.0 Instance Instance B OS v1.0 Middleware B v1.0 B Source Code Instance B’ OS v1.0 Middleware B v1.0 Instance A OS v1.1 Instance Instance A’ OS v1.0 Middleware A A
 Base 
 OS Image
 v1.0 Instance B OS v1.1 B
 Instance B’ OS v1.0 Middleware B Instance A OS Pure
 Amazon
 Linux Instance A’ OS v1.1 ( ) Ansible ( ) Ansible .
  77. 77. Service A 
 Base OS Image v1.0 Service B 
 Base OS Image v1.0 Instance Instance A OS v1.0 Middleware A v1.0 A Source Code Instance A’ OS v1.0 Middleware A v1.0 Instance Instance B OS v1.0 Middleware B v1.0 B Source Code Instance B’ OS v1.0 Middleware B v1.0 Instance A OS v1.1 Instance Instance A’ OS v1.0 Middleware A A
 Base 
 OS Image
 v1.0 Instance B OS v1.1 B
 Instance B’ OS v1.0 Middleware B Instance A OS Pure
 Amazon
 Linux Instance A’ OS v1.1 
 AMI 

  78. 78. Instance Image Packer
  79. 79. Packer
  80. 80. Packer Image Instance A OS v1.0 Instance A’ OS v1.0 Middleware A v1.0 Image’
  81. 81. Packer EC2 
 Template Ansible CM Tool 
 Provisioning
  82. 82. Packer 
 ..
  83. 83. Q & A

×