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.

[Red Hat] OpenStack Automation with Ansible

2,319 views

Published on

This is presentation for OpenInfra Days Korea 2018 and English version.

Published in: Engineering
  • Be the first to comment

[Red Hat] OpenStack Automation with Ansible

  1. 1. OpenStack Automation with Ansible Open Infra Days Korea 2018 Nalee Jang Red Hat Korea Platform Consultant OpenStack Korea User Group Advisor 2018-06-28
  2. 2. About Me IT Expert for leading on the Cloud! I am a Consultant for working about OpenStack, CloudForms and Ansible of Red Hat Korea. - Name : Jang HyonJeong (NaleeJang) - Company : Red Hat Korea Cloud Platform Consultant - HP Helion MVP(Most Valuable Professional)/2015.06.05 - Published : 20-May-2017 / “The Art of OpenStack” Second Edition / Gilbut - Patent : System and method for providing cloud market service for sale contents base on software as a service/25-September-2015/KIPO - Blog : http://naleejang.tistory.com - Facebook : http://www.facebook.com/naleejang - Community : Advisor of OpenStack Korea User Group (http://www.facebook.com/groups/openstack.kr/) (http://www.openstack.or.kr/)
  3. 3. Open Infra Days Korea 2018 – OpenStack Automation with Ansible Work Life of IT Engineer~ What is Ansible? Cloud! OpenStack! OpenStack Automation with Ansible Not Easy! Iterative Work! Automation for Iterative Work AGENDA
  4. 4. Work Life of IT Engineer
  5. 5. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 5 Work Life of IT Engineer Kind of IT Engineers are Infrastructure engineer and Software engineer. Infra Engineer Software Engineer
  6. 6. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 6 Work Life of IT Engineer Engineers have to know lots of things like below for work.
  7. 7. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 7 Work Life of IT Engineer So we work hard! Everyday try to solve problem~~~ When do I finish?? Digging. Digging.. Digging... Digging Life~~
  8. 8. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 8 Work Life of IT Engineer Infrastructure Platform Software Blow picture is cloud technical that we know.
  9. 9. Cloud! OpenStack!
  10. 10. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 10 Cloud! OpenStack! 10 years ago, Amazon start to service resource like server, storage by web.
  11. 11. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 11 Cloud! OpenStack! 2010. 06! NASA and Rackspace opened working project Nova, compute service and Swift, object storage service. 2010.06 IaaS
  12. 12. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 12 Cloud! OpenStack! Before It was Open Source Cloud Computing Projects OpenStack and Others. Standard Open Source Projects was below.
  13. 13. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 13 Cloud! OpenStack! Now Amazon, Microsoft and Google start public cloud service market. ‘OpenStack’ became standard platform, building private cloud. Famous Public Cloud Services!Famous Private Cloud Service!
  14. 14. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 14 Cloud! OpenStack! I know that you already know about OpenStack has what services well. So I don’t introduce about OpenStack service.
  15. 15. Not Easy! Iterative Work!
  16. 16. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 16 Not Easy! Iterative Work! The company finally has introduced OpenStack for Private Cloud. And It started to do Cloud computing service to other team and affiliates.
  17. 17. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 17 Not Easy! Iterative Work! In the first time, they were so happy. I can work more easy! I can learn new technology!
  18. 18. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 18 Not Easy! Iterative Work! But, As days goes by it has a lot of work, Same tasks do every time again and again It have to work lots of tasks that it is not easy and not fun.
  19. 19. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 19 Not Easy! Iterative Work! Request Service Review Service Create Project Create Network Create Flavor Create Security group Create ssh key-pair Create Instance Associate Floating IP Notice created instance Everyday we have to work same task every time. When it is service and it deploy test bed also, We have to work same tasks.
  20. 20. Automation for Iterative Work
  21. 21. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 21 Automation for Iterative Work How do I work for not work like iterative? Automation!!
  22. 22. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 22 Automation for Iterative Work Computer is machine that is work by my command. We need to plan about how to order command and ordering for automation.
  23. 23. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 23 Automation for Iterative Work Iterative work have to make like below. Request Service Review Service Create Project Create Network Create Flavor Create Security group Create ssh key-pair Create Instance Associate Floating IP Notice created instance
  24. 24. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 24 Automation for Iterative Work https://docs.openstack.org/queens/api/ One of the OpenStack’s positive point is to provide API by all services. So we can automate iterative work using API.
  25. 25. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 25 Automation for Iterative Work
  26. 26. What is Ansible?
  27. 27. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 27 What is Ansible? Ansible is an IT automation tool. It can configure systems, deploy software, and orchestrate more advanced IT tasks such as continuous deployments or zero downtime rolling updates.
  28. 28. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 28 What is Ansible? Provisioning Configuration Management Security and Compliance Application Deployment Orchestration You can make process that create instance of OpenStack or Public cloud by Ansible and Ansible Tower simply. You can keep consistency about tasks like system package updating of company. Ansible can apply security policy of company, check security rule and update it. If Ansible define application program and Ansible Tower can manage deployment, Development team can manage all application life cycle from development and release effectively. Only configuration can’t define user environment. Ansible can work orchestration, automated work flow, provisioning and managing updating. You can define policy and SLA also.
  29. 29. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 29 What is Ansible? Let us discuss now how Ansible manages the entire DevOps infrastructure. When developers begin to think of infrastructure as part of their application i.e as Infrastructure as code (IaC), stability and performance become normative. Infrastructure as Code is the process of managing and provisioning computing infrastructure (processes, bare-metal servers, virtual servers, etc.) and their configuration through machine-processable definition files, rather than physical hardware configuration or the use of interactive configuration tools. This is where Ansible automation plays a major role and stands out among its peers. In DevOps, Sysadmins work tightly with developers, development velocity is improved, and more time is spent doing activities like performance tuning, experimenting, and getting things done, and less time is spent fixing problems.
  30. 30. OpenStack Automation with Ansible
  31. 31. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 31 OpenStack Automation with Ansible Now, Let’s us know how to make OpenStack Automation using Ansible!
  32. 32. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 32 OpenStack Automation with Ansible We need below environment for making OpenStack automation using Ansible.
  33. 33. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 33 OpenStack Automation with Ansible If you prepare environment, We need to design roughly process for Automation.
  34. 34. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 34 OpenStack Automation with Ansible And, you need to design playbook architecture like below. Tasks – Set of execution command or command ordering vars - variable
  35. 35. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 35 OpenStack Automation with Ansible Now, you have to design about command process by task. Here is - Register Glance Image - Creating network - Creating SSH key It design Role process.
  36. 36. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 36 OpenStack Automation with Ansible --- # tasks file for osp-image - name: Register OS image to Glance os_image: auth: "{{ os_auth }}" name: "{{ os_image_name }}" container_format: "{{ os_image_container_format }}" disk_format: "{{ os_image_disk_format }}" state: present filename: "{{ os_image_filename }}" Playbook for registering Image It make playbook for task by Role process.
  37. 37. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 37 OpenStack Automation with Ansible --- # tasks file for osp-network - os_network: auth: "{{ os_auth }}" state: present name: "{{ external_network_name }}" external: true - os_subnet: auth: "{{ os_auth }}" state: present network_name: "{{ external_network_name }}" name: "{{ external_subnet_name }}" cidr: "{{ external_cidr }}" gateway_ip: "{{ external_gateway_ip }}" allocation_pool_start: "{{ external_allocation_pool_start }}" allocation_pool_end: "{{ external_allocation_pool_end }}" Public Network Create Public Subnet Create
  38. 38. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 38 OpenStack Automation with Ansible - os_network: auth: "{{ os_auth }}" state: present name: "{{ tenant_network_name }}" external: false register: internal - os_subnet: auth: "{{ os_auth }}" state: present network_name: "{{ tenant_network_name }}" name: "{{ tenant_subnet_name }}" cidr: "{{ tenant_cidr }}" Tenant Network Create Tenant Subnet Create
  39. 39. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 39 OpenStack Automation with Ansible - os_router: auth: "{{ os_auth }}" state: present name: "{{ router_name }}" network: "{{ external_network_name }}" external_fixed_ips: - subnet: "{{ external_subnet_name }}" interfaces: - "{{ tenant_subnet_name }}" Router Create We don’t need to development Playbook ourselves. We think about what do you want to execute command, and then search it on internet like google, we can find almost playbook. And, you can use the playbook.
  40. 40. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 40 OpenStack Automation with Ansible --- # tasks file for osp-keypair - name: Generate key files user: name: "{{ ansible_env.USER }}" generate_ssh_key: yes ssh_key_file: .ssh/test_id_rsa - os_keypair: auth: "{{ os_auth }}" state: present name: "{{ os_keypair_name }}" public_key_file: "{{ ansible_env.HOME }}/.ssh/test_id_rsa.pub" SSH Key Cteate Register Keypair by Created SSH Key
  41. 41. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 41 OpenStack Automation with Ansible In this time - Create Security Group - Create Flavor - Create Instance It design Role Process.
  42. 42. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 42 OpenStack Automation with Ansible --- - os_security_group: auth: "{{ os_auth }}" state: present name: "{{ security_group_name }}" description: "{{ security_group_description }}" - os_security_group_rule: auth: "{{ os_auth }}" security_group: "{{ security_group_name }}" protocol: "{{ item.protocol }}" port_range_min: "{{ item.port }}" port_range_max: "{{ item.port }}" remote_ip_prefix: "{{ item.ip_prefix }}" with_items: "{{ security_group_port }}" Security Group Create Add Rule To Security Group
  43. 43. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 43 OpenStack Automation with Ansible --- # tasks file for osp-flavor - name: Create flavor os_nova_flavor: auth: "{{ os_auth }}" state: present name: "{{ flavor_name }}" ram: "{{ flavor_ram }}" vcpus: "{{ flavor_vcpus }}" disk: "{{ flavor_disk }}" Flavor Create
  44. 44. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 44 OpenStack Automation with Ansible --- # tasks file for osp-instances - name: Create a server instance os_server: auth: "{{ os_auth }}" name: "{{ instance_name }}" image: rhel-guest meta: "group={{ group }},deployment_name={{ deployment }}" flavor: "{{ flavor_name }}" security_groups: "{{ security_group_name }}" key_name: ansible_ssh wait: yes nics: - net-name: "{{ tenant_network_name }}" register: instanceip Instance Create
  45. 45. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 45 OpenStack Automation with Ansible DEMO
  46. 46. Quiz OpenStack is [ ] When build Private Cloud, we almost use [ ]. It use [ ] for automation iterative work. The order in which commands are executed is called a [ ]. Infrastructure as a Service OpenStack Ansible tasks The place to store and manage Playbooks is [ ] .Git
  47. 47. Wrap UP ● OpenStack is a cloud open source platform opened by NASA and RackSpace in June 2010. ● OpenStack is an IaaS, the most commonly used technology for building a private cloud. ● Ansible can automate a variety of IT tasks, including system provisioning, software package installation, network configuration, and security, as well as instance provisioning of Cloud Service. ● In order to automate using Ansible, a process design for automation is required, and these processes are executed through Playbook. ● The unit of the process in which commands are executed one by one using Playbook is called Task. ● To implement OpenStack Automation with Ansible, you need OpenStack, Ansible, Ansible Tower, and Git Repository.
  48. 48. THANK YOU plus.google.com/+RedHat linkedin.com/company/red-hat youtube.com/user/ RedHatVideos facebook.com/redhatinc twitter.com/RedHatNews

×