2. About Me
IT Expert for leading on the Cloud!
I am a Consultant for working about OpenStack and Cloud Forms of Red Hat Korea.
- Name : 장현정 (NaleeJang)NaleeJang)
- Company : Red Hat Korea Cloud Platform Consultant
- HP Helion MVP(NaleeJang)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
(NaleeJang)http://www.facebook.com/groups/openstack.kr/)
(NaleeJang)http://www.openstack.or.kr/)
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
5. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 5
Work Life of IT Engineer
IT Engineer 는 크게 인프라를 담당하는 엔지니어와 소프트웨어를 담당하는 엔지니어가 있습니다 .
Infra Engineer
Software Engineer
6. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 6
Work Life of IT Engineer
엔지니어들은 일을 하기 위해서 다양한 것들을 많이 알고 있어야 합니다 .
7. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 7
Work Life of IT Engineer
그래서 매일 삽질을 하죠 ! 이놈의 삽질 인생 ~~~ 언제 끝나려나 ?? 하고 말입니다 .
8. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 8
Work Life of IT Engineer
Infrastructure
Platform
Software
우리가 알아야 할 기술들을 정 리해 보면 아래와 같습니다 .
10. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 10
Cloud! OpenStack!
10 년전 어느날 Amazon 에서 서버 , 스토리지와 같은 자원을 Web 으로 Service 를 하기 시작했습니다 .
11. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 11
Cloud! OpenStack!
2010 년 6 월 ! 미 항공우주연구원인 NASA 와 미 IT 회사 Rackspace 에서 진행중인 컴퓨트
서비스인 Nova 와 스토리지 서비스인 Swift 를 오픈소스화 하였습니다 .
2010.06 IaaS
12. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 12
Cloud! OpenStack!
예전에는 OpenStack 이외의 클라우드 시스템을 구축할 수 있는 오픈소스 클라우드 컴퓨팅
프로젝트들이 있었습니다 . 대표적인 오픈소스 프로젝트가 바로 아래 나와 있는 것들입니다 .
13. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 13
Cloud! OpenStack!
지금은 Amazon 뿐 아니라 , Microsoft 와 Google 도 퍼블릭 클라우드 시장에 뛰어들었고 ,
프라이빗 클라우드 구축 ! 하면 떠오는 단어가 바로 ‘ OpenStack’ 이 되었습니다 .
대표적인 Public Cloud 서비스들 !Private Cloud 의 대명사 !
14. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 14
Cloud! OpenStack!
오픈스택이 어떤 서비스들로 이루어져 있는지는
여기 계신 여러분들이 너무나도 잘 알기에
여기서는 넘어가도록 하겠습니다 .
16. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 16
Not Easy! Iterative Work!
회사에서 드디어 Private Cloud 로
오픈스택을 도입하였습니다 .
그리고 , 타 부서 및 계열사에 클라우드
컴퓨팅 서비스를 하기 시작했습니다 .
17. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 17
Not Easy! Iterative Work!
처음에는 정 말 좋았습니다 .
드디어 나도 일이 편해지겠구나 !
새로운 기술도 배울수 있겠구나 !
18. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 18
Not Easy! Iterative Work!
그러나 ,
날이 갈수록 할일은 많아지고 ,
똑같은 업무를 매번 반복해야만 하는
쉽지도 재밌지도 않은 일들이 많아지기
시작했습니다 .
19. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 19
Not Easy! Iterative Work!
서비스 신청
서비스 검토
프로젝트 생성
네트워크 생성
Flavor 생성
보안 그룹 생성 그룹 생성 생성
보안 그룹 생성키 생성 생성
인스턴스 생성
Floating IP 할당
인스턴스 생성 통보
매일 똑같은 업무를 매번 해야 합니다 . 서비스를 할때는 물론이고 , 심지어 테스트베드를
구축할때조차도 매번 같은 업무를 하고 있습니다 .
21. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 21
Automation for Iterative Work
이와 같은 업무에서 벗어나려면 어떻게 하면 좋을까요 ?
Automation!! 자동화 !!
22. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 22
Automation for Iterative Work
컴퓨터는 내가 시키 생성는대로 일을 해 주는 기계입니다 .
자동화를 하려면
어떤 순서로
어떤 일을 시킬건지
계획해야 합니다 .
23. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 23
Automation for Iterative Work
서비스 신청
서비스 검토
프로젝트 생성
네트워크 생성
Flavor 생성
보안 그룹 생성 그룹 생성 생성
보안 그룹 생성키 생성 생성
인스턴스 생성
Floating IP 할당
인스턴스 생성 통보
매일 또는 자주 하는 업무를 아래와 같이 프로세스화 해야 합니다 .
24. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 24
Automation for Iterative Work
https://docs.openstack.org/queens/api/
오픈스택의 장점 중 하나는
모든 서비스를 API 로 제공을 한다는
부분입니다 .
API 를 사용하여 반복적인 업무를
자동화시킬 수 있습니다 .
25. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 25
Automation for Iterative Work
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.
Ansible 은 IT 오토메이션 툴입니다 툴입니다 . 시스템
환경을 설정 하고 , 소프트웨어를 설치하고 ,
반복적이면서 다운타임없이 시스템을
업데이트 할 수 있습니다 .
28. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 28
What is Ansible?
Provisioning
Configuration Management
Security and Compliance
Application Deployment
Orchestration
오픈스택 , 퍼블릭 클라우드의 인스턴스를
생성하는 프로세스를 Ansible 과 Ansible
Tower 를 통해 간소화할 수 있습니다 .
기업의 시스템 패키 생성지 업데이트와 같은
작업을 동일하게 하므로써 일관성을 일관성을
유지합니다 .
Ansible 을 통해 기업의 보안 그룹 생성정 책을 적용
하면 , 사이트 전체에 보안 그룹 생성정 책을 검사하고
수정 합니다 .
Ansible 로 응용 프로그램을 정 의하고 ,
Ansible Tower 로 배포를 관리하면
개발팀은 개발에서 생산까지의 전체 응용
프로그램 수명주기를 효과 적으로 관리할
수 있습니다 .
구성만으로는 사용자 환경이 정 의되지
않습니다 . Ansible 는 비즈니스 요청을 응용
프로그램 , 데이터 및 인프라와 조화시키 생성는
관점에서 오케스트레이션 툴입니다 및 자동화 된
워크 플로 , 프로비저닝 및 변경 관리를 및 변경 관리를
통해 정 책 및 서비스 수준을 정 의합니다 .
29. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 29
What is Ansible?
Playbook 이라 부르는 인프라 스트럭처 코드 (Code Code
as Infrastructure) 는 실제 하드웨어 구성이나 대화
형 구성 도구 구성 도구 (Code Agent 방식의 자동화 도구 ) 대신
컴퓨터 처리 가능 정의 파일 정 의 파일 (Code Playbook) 을 통해
컴퓨팅 인프라 (Code 프로세스 , 베어 메탈 서버 서버 , 가상
서버 등 ) 및 해당 구성을 관리하고 , 프로비저닝 및 변경 관리를
하는 프로세스입니다 . 이것은 Ansible 자동화의
중요한 역할을 합니다 .
개발 팀에서는 시스템 관리자가 개발자와 Ansible
을 통해 긴밀하게 협력하면 개발 속도가 향상 됩니
다 .
그리고 , 성능 정의 파일 튜닝 및 변경 관리를 , 실험 및 작업 완료와 같이 많은 및 작업 완료와 같이 많은
시간을 필요로 하는 작업 수행 시간을 줄여 줍니다 .
31. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 31
OpenStack Automation with Ansible
그럼 , 지금부터 Ansible 을 이용하여
OpenStack 을 Automation 하는 방법을 알아봅시다 !
32. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 32
OpenStack Automation with Ansible
Ansible 을 이용하여 OpenStack 을 Automation 하려면 아래와 같은 환경이 필요합니다 .
33. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 33
OpenStack Automation with Ansible
환경이 준비되면
Automation 을 수행하기
위한 대략적인 프로세스
설계가 필요합니다 .
34. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 34
OpenStack Automation with Ansible
그리고 , Automation 의 핵심인 Playbook 구조를 아래와 같이 설계합니다 .
Tasks - 실제 업무를 수행할 명령어의 집합 또는 순서 vars - 변수
35. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 35
OpenStack Automation with Ansible
이제 Task 를 통해
수행될 명령어의 프로세스를 명령어의 프로세스를
구체적으로 나열하고
설계합니다 .
여기서는
- Glance 이미지를 등록하고
- 네트워크를 만들고
- 보안 그룹 생성키 생성를 생성하는
Role 프로세스를 설계합니다 .
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
Role 프로세스에 따라 Task 에 작성될 명령어의 프로세스를 Playbook 를 생성합니다 .
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 네트워크 생성
Public 서브넷 생성 생성
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 네트워크 생성
Tenant 서브넷 생성 생성
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 생성
Playbook 를 반드시 직접 구현할 필요는 없습니다 .
어떤 명령어를 수행하고 싶은지를 생각하고 검색엔진으로 검색을 하면 대부분의
Playbook 이 검색됩니다 . 그리고 , 해당 Playbook 을 가져다 쓰면 됩니다 .
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 생성
생성한 Key 를 Keypair 로 등록
41. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 41
OpenStack Automation with Ansible
이번에는
- 보안 그룹 생성그룹 생성을 생성하고
- Flavor 를 만들고
- 인스턴스를 생성하는
Role 프로세스를 설계합니다 .
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 생성
Security Group 에 Rule
추가
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 생성
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 생성
45. Open Infra Days Korea 2018 – OpenStack Automation with Ansible 45
OpenStack Automation with Ansible
DEMO
46. Quiz
OpenStack 은 [ ] 다 .
Private Cloud 를 구축할 때 대부분 [ ] 을 사용한다 .
반복되는 업무를 자동화하기 위해서 [ ] 을 사용한다 .
명령어를 실행하는 순서를 Ansible 에는 [ ] 라 부른다 .
Infrastructure as a Service
OpenStack
Ansible
Tasks
Playbook 을 저장하고 관리하는 곳은 [ ] 이다 .Github
47. Wrap UP
●
OpenStack 은 2010 년 6 월 NASA 와 RackSpace 가 오픈한 클라우드 오픈소스 플랫폼입니다 .
●
OpenStack 은 IaaS 로서 , Private Cloud 를 구축할 때 가장 많이 사용되는 기술입니다 .
●
Ansible 은 Cloud Service 의 인스턴스 프로비저닝 및 변경 관리를 을 비롯해 , 시스템 환경설정 , 소프트웨어
패키 생성지 설치 , 네트워크 환경 설정 , 보안 그룹 생성 등과 다양한 IT 업무를 자동화 할 수 있습니다 .
●
Ansible 을 이용해 자동화를 하기 위해서는 자동화를 위한 프로세스 설계가 필요하며 , 이런
프로세스는 Playbook 을 통해 실행합니다 .
●
Playbook 을 이용해 명령어가 하나하나 실행되는 과 정 의 단위를 Task 라 합니다 .
●
OpenStack Automation with Ansible 을 구현하기 위해서는 OpenStack, Ansible, Ansible Tower,
Git Repository 등이 필요합니다 .