SlideShare a Scribd company logo
IT AUTOMATION FOR EVERYONE
Ansible Tower
KIM, YONGKI
Sr. Solution Architect
ykim@redhat.com
WHY IT AUTOMATION?
IaaS와 PaaS 클라우드
환경에서 구동되는
어플리케이션 지원
DevOps 환경에 맞는
신속한 어플리케이션 배포
IT 프로세스 자동화를
통한 서비스
오케스트레이션
2
WHY IT AUTOMATION?
IaaS와 PaaS 클라우드
환경에서 구동되는
어플리케이션 지원
DevOps 환경에 맞는
신속한 어플리케이션 배포
IT 프로세스 자동화를
통한 서비스
오케스트레이션
3
WHY IT AUTOMATION?
IaaS와 PaaS 클라우드
환경에서 구동되는
어플리케이션 지원
DevOps 환경에 맞는
신속한 어플리케이션 배포
IT 프로세스 자동화를
통한 서비스
오케스트레이션
4
WHY IT AUTOMATION?
IaaS와 PaaS 클라우드
환경에서 구동되는
어플리케이션 지원
DevOps 환경에 맞는
신속한 어플리케이션 배포
IT 프로세스 자동화를
통한 서비스
오케스트레이션
5
반복된 작업
6
IT AUTOMATION
• 다수 서버의 서비스 상태 확인
• CPU, Memory, Disk 등 자원 상태
확인
• OS 패치작업
• 신규 어플리케이션 설치
• 환경 설정 파일 유지
• 다수 서버에서 동일 명령어 수행
• 끝나면 다시 시작…
반복되는 IT 작업
반복된 작업의 일반적인 해결 방법
7
IT AUTOMATION
생산성 향상
INSERT DESIGNATOR, IF NEEDED8
IT AUTOMATION
IT 자동화를 통한 관리 용이성
• 다수 서버를 대상으로 반복되는
동일한 패치 작업
• 동일한 어플리케이션 배포
• 동일한 환경 설정 유지
• 동일한 명령어를 수행하여 다른
종류의 OS에서 동일한 작업 수행
• 자동화를 통한 작업 시간 단축
• 자동화를 통한 휴먼 에러 제거
9
AUTOMATION = ACCELERATION
“By using AnsibleTower Surveys, we have created a self-service capabilitythat
allows our IT guys to provision new cloud customers quickly. Our first 3
customers each took2 weeks to provision.With Ansible, our next 500
customers took 10 minutes each to provision.”
“We use Ansible to deploy the network configurationsto new datacenters for
our games. Previously, itwould take 4 days worth of work, onsite, to make sure
that our networks were configured correctly. With Ansible, I can now
configure a datacenter in 4 minutes, remotely.”
“With AnsibleTower, we just click a button and deploy to
production in 5 minutes. It used to take us 5 hours with
6 people sittingin a room, making sure we didn’tdo anything wrong (and we
usually still had errors). We now deployto production every other day instead of
every 2 weeks, and nobodyhas to be up at 4am makingsure it was done right.”
10
WHY IT ANSIBLE?
11
SIMPLE
12
WHAT IS ANSIBLE?
THE ANSIBLE WAY
• Human Readable
• 알기 쉬운 자동화 스크립트
• 어려운 코딩 기술 불필요
• Version Controlled
• 텍스트 기반 플레이북을 사용
• 기존 형성관리 솔루션 사용가능
• 순서에 따른 작업 실행
• 일관된 결과 제공
POWERFULL
13
WHAT IS ANSIBLE?
THE ANSIBLE WAY
• CROSS PLATFORM
• Linux, Windows, UNIX 지원
• AUTOMATED JOBS
• 어플리케이션 자동 배포
• 환경 설정 자동 관리
• DYNAMIC INVENTORIES
• 다양한 인프라 구조
지원(Baremetal, VM, CLOUD)
AGENTLESS
14
WHAT IS ANSIBLE?
THE ANSIBLE WAY
• Agentless
• 별도의 에이전트 불필요
• OpenSSH와 WinRM 사용
• 에이전트에 의한 보안 이슈
제거
• SSH를 통한 모든 SHELL 작업
가능
15
HOW ANSIBLE WORKS
16
HOW ANSIBLE WORKS
17
HOW ANSIBLE WORKS
18
HOW ANSIBLE WORKS
19
HOW ANSIBLE WORKS
20
PLAYBOOK EXAMPLE
---
- name: install and start apache
hosts: all
vars:
http_port: 80
max_clients: 200
remote_user: root
tasks:
- name: install httpd
yum: pkg=httpd state=latest
- name: write the apache config file
template: src=/srv/httpd.j2 dest=/etc/httpd.conf
- name: start httpd
service: name=httpd state=running
21
WHAT IS ANSIBLE?
+450 modules
Mature Open Source Project
22
#1 IN I.T. AUTOMATION
• Open Source Community
• 2,000명 이상 개발 참여
• GitHub에서 13,000이상 추천
• 2014년 Top 10 오픈소스
프로젝트 선정
• 매월 250,000 이상 다운로드
• 1,200명 이상 IRC 유저
ansible vs. puppet vs. chef
23
COMPARISON WITH OTHER TOOLS
Ansible Puppet Chef
Agent Agentless with Agent
(master-client)
with Agent
(master-client)
Language python Puppet DSL, ruby ruby
Maturity youngest oldest older
Learning curve easy harder hardest
complexity simple not simple complex
Modules many modules in
ansible-galaxy
large modules in
puppet forge
plenty of recipes
when to use it adaption of
automation easily
large enterprises with
a heterogeneous
environment
good for development-
focused teams and
environments
ref:	http://blog.takipi.com/deployment-management-tools-chef-vs-puppet-vs-ansible-vs-saltstack-vs-fabric/
WEB Management
24
ANSIBLE TOWER
WEB UI 와 restful API를 통한 Ansible
기능 강화
• Role 기반 접근 제어 방식
• 보안 강화
• 팀작업 효율 강화
• 미권한 유저의 안전한 배포
• 버튼을 누르는 단순 작업으로
배포 실행
• 모든 작업의 중앙집중형 로그 기록
• 작업 결과 확인
• 기존 작업 상태 확인
25
ANSIBLE TOWER
26
BENEFITS OF ANSIBLE - DEVOPS
COMMUNICATION IS THE KEY TO DEVOPS.
Ansible: IT 전반에 활용될 수 있는 automation language.
Ansible: 어플리케이션 라이프 사이클을 자동화할 수 있는 automation
engine.
27
BENEFITS OF ANSIBLE - IMPACT
+ 반복작업 제거
+ 좀 더 생산적인 업무에 집중
+ 실수 및 에러 감소
+ 업무 협조 증가
+ 복잡성 해결
+ 혁신을 위한 업무 배치
+ 책임 및 규정 준수
+ 성공을 위한 문화
28
SUMMARY
MODERNIZE
기존 작업 프로세스의 자동화
기존 운영방식을 DevOps처럼
MIGRATION
정형화된 어플리케이션 스택 정의
모든 인프라환경에 재배포
MIGRATION
모든 것을 모델화
지속적인 배포
29
DEMO
30
DEMO
Simple Ansible Command
1. status check
# ansible –k –m ping rhel61
# ansible –k –m ping rhel6
2. gathering system information
# ls –l /root
# ansible –k –m setup –tree /root/sysinfo rhel61
# grep product /root/sysinfo/rhel61
“ansible_product_name”: “VirtualBox” => H/W model name
…
3. shell command execution
# ansible -k –m shell –a “cat /etc/hosts” rhel61
# ansible –k –m script –a “/root/scripts/getrpm_list.sh” rhel6
31
DEMO
ansible repository
cat /etc/ansible/hosts
##### openstack management by ykim#
[ctrl]
ctrl[1:3]
[com]
com[1:2]
[openstack:children]
ctrl
com
##### for this Demo :D
[rhel6]
rhel6[1:2]
32
DEMO
ansible-doc
1. ansible modules list
# ansible-doc –l # list all modules
…
stat retrieve file or file system status
subversion Deploys a subversion repository.
svr4pkg Manage Solaris SVR4 packages
swdepot Manage packages with swdepot package
manager (HP-UX)
...
2. ansible document
#ansible-doc script
EXAMPLES:# Example from Ansible Playbooks- script: /some/local/script.sh
--some-arguments 1234# Run a script that creates a file, but only if the
file is not yet created- script: /some/local/create_file.sh --some-
arguments 1234 creates=/the/created/file.txt# Run a script that removes a
file, but only if the file is not yet removed- script:
/some/local/remove_file.sh --some-arguments 1234
removes=/the/removed/file.txt
33
DEMO
Ansible-playbook – query execution
1.	mysql query	on	Ansible
#	ansible-playbook	–k	query.yml
=>	result
34
DEMO
Ansible-playbook – query playbook sample
1.	mysql query	on	Ansible
#cat	query.yml
---
- name:	Retrieve	stuff	from	mysql
hosts:	rhel61	
tasks:		
- name:	select	data	from	mysql db
command:	>						
mysql --user=root	test					
--host=rhel61	--batch	--skip-column-names						
--execute="SELECT	data	from	example"				
register:	result
always_run:	True				
changed_when:	False		
- name:	print	out	the	result
debug:	"{{	item	}}"				
with_items:	result.stdout_lines
35
DEMO
Ansible-playbook – update patch & rollback execution
1.	pkg update	on	Ansible
##	 실행 이전 현재 glibc 버전 확인
#####	on	rhel62		ß to	identify	which	version	is	available	
#	yum	info	glibc-common
####	on	ansible (task:	1.	lvmsnapshot,	 2.	yum	update)
#	ansible-playbook	 –k	01.updateGlibc.yml
####	on	rhel62
#	yum	info	glibc-common		ß to	confirm	that	updated	version	is	installed
####	Assume	that	the	patch	is	not	suitable	and	want	to	rollback	to	old	file	system.
####	on	ansible (task:	lvm snapshot	rollback)
#	ansible-playbook	 –k	02.restoreFilesystem.yml
###	on	rhel62
#	yum	info	glibc-common	ß to	confirm	that	snapshot	is	applied
ref:	https://access.redhat.com/solutions/65991
36
DEMO
Ansible-playbook – update patch & rollback playbook sample
1.	update-patch	playbook	on	Ansible
#cat	01.updateGlibc.yml
---
- name:	lvm snapshot	and	update	glibc pkg
hosts:	rhel62		
tasks:		
- name:	create	root	filesystem snapshot				
shell:						
lvcreate -s	-L	900M	-n	lvrootsnap /dev/VolGroup/lv_root
- name:	update	glibc package				
yum:						pkg:	glibc-common
state:	latest
37
DEMO
Ansible-playbook – update patch & rollback playbook sample
2.	rollback	playbook	on	Ansible
####	also	you	can	use	“yum	history”
#cat	02.restoreFilesystem.yml
---
- name:	restore	filesystem
hosts:	rhel62
tasks:
- name:	restore	from	old	snapshot
shell:						lvconvert --merge	/dev/VolGroup/lvrootsnap
register:	result		- name:	showing	stdout
debug:	"{{	item	}}"				
with_items:	result.stdout_lines
- name:	reboot	to	affect	it
shell:						reboot
38
DEMO
Ansible-Tower
#playbook	location	in	ansible-tower
/var/lib/awx/projects
39
DEMO
Ansible-Tower
press	here	to	start	job
1. log in web console
2. make job template
3. run it
40
DEMO
Ansible-Tower – Job Result
plus.google.com/+RedHat
linkedin.com/company/red-hat
youtube.com/user/RedHatVideos
facebook.com/redhatinc
twitter.com/RedHatNews
THANK YOU
42
CONSIDERATION
Ansible-Tower
#	TASK	List
create/restore	snapshot	on	root	filesystem
https://access.redhat.com/solutions/65991
- create:	lvcreate -s	-L	1G	-n	lvrootsnap /dev/VolGroup/lv_root
- restore:	lvconvert --merge	/dev/VolGroup/lvrootsnap
- reboot
*자동화 스크립트를 구성하기 위해서는 해당 명령어를 통해 정상적으로 기능이
작동하는지 확인하는 것이 반드시 필요.

More Related Content

PDF
[231]나는서버를썰터이니너는개발만하여라 양지욱
PDF
쉽고 빠르게 접하는 오픈스택
PDF
Rancher Simple User Guide
PPT
자동화된 인프라구축 - 2009년 자료
PDF
[1A7]Ansible의이해와활용
PDF
셸 스크립트를 이용한 클라우드 시스템 운영
PDF
[오픈소스컨설팅] SELinux : Stop Disabling SELinux
PDF
[AWS Community Day 2021] AWS와 함께하는 무중단 배포 파이프라인 개선기
[231]나는서버를썰터이니너는개발만하여라 양지욱
쉽고 빠르게 접하는 오픈스택
Rancher Simple User Guide
자동화된 인프라구축 - 2009년 자료
[1A7]Ansible의이해와활용
셸 스크립트를 이용한 클라우드 시스템 운영
[오픈소스컨설팅] SELinux : Stop Disabling SELinux
[AWS Community Day 2021] AWS와 함께하는 무중단 배포 파이프라인 개선기

What's hot (20)

PDF
제2회 난공불락 오픈소스 인프라 세미나 zinst 관리툴 소개
PDF
[154] 데이터 센터의 오픈 소스 open compute project (ocp)
PDF
[오픈소스컨설팅] ARM & OpenStack Community
PDF
[OpenInfra Days Korea 2018] Day 2 - E5: Mesos to Kubernetes, Cloud Native 서비스...
PDF
Puppet과 자동화된 시스템 관리
PDF
Confd, systemd, fleet을 이용한 어플리케이션 배포 in CoreOS
PDF
[113]apache zeppelin 이문수
PPTX
[오픈소스컨설팅]인프라 자동화 도구 Chef
PPTX
[NDC17] Kubernetes로 개발서버 간단히 찍어내기
PDF
Linux Kernel 101 for Beginner
PDF
Introduction to Docker - LOGISPOT
PDF
[OpenInfra Days Korea 2018] (Track 2) Neutron LBaaS 어디까지 왔니? - Octavia 소개
PDF
AWS + Docker in Vingle
 
PDF
Mesos + Marathon + Docker
PPT
Mcollective orchestration tool 소개
PDF
쿠알못이 Amazon EKS로 안정적인 서비스 운영하기 - 최용호
PDF
오픈스택커뮤니티와기술동향
PDF
How to contribute at OpenStack
PDF
Tech planet 2015 Docker 클라우드 구축 프로젝트 - d4
PDF
RancherOS Introduction
제2회 난공불락 오픈소스 인프라 세미나 zinst 관리툴 소개
[154] 데이터 센터의 오픈 소스 open compute project (ocp)
[오픈소스컨설팅] ARM & OpenStack Community
[OpenInfra Days Korea 2018] Day 2 - E5: Mesos to Kubernetes, Cloud Native 서비스...
Puppet과 자동화된 시스템 관리
Confd, systemd, fleet을 이용한 어플리케이션 배포 in CoreOS
[113]apache zeppelin 이문수
[오픈소스컨설팅]인프라 자동화 도구 Chef
[NDC17] Kubernetes로 개발서버 간단히 찍어내기
Linux Kernel 101 for Beginner
Introduction to Docker - LOGISPOT
[OpenInfra Days Korea 2018] (Track 2) Neutron LBaaS 어디까지 왔니? - Octavia 소개
AWS + Docker in Vingle
 
Mesos + Marathon + Docker
Mcollective orchestration tool 소개
쿠알못이 Amazon EKS로 안정적인 서비스 운영하기 - 최용호
오픈스택커뮤니티와기술동향
How to contribute at OpenStack
Tech planet 2015 Docker 클라우드 구축 프로젝트 - d4
RancherOS Introduction
Ad

Viewers also liked (20)

PPTX
Sarkgulu Cocuklar Bir
PPTX
Infant and Toddler Powerpoint
PPTX
представление целых чисел в формате с фиксированной запятой
PPTX
Question 3
PPTX
Sunum 2 Yeni
PPTX
Effects on the title 'IN DENIAL'
PPTX
представление целых чисел в формате с фиксированной запятой
PPTX
How to Be a Better Marketer?
PPTX
метод комісія
PPTX
Student digipak
PPSX
Business proposal of Taiwan Mining
PPTX
Sark Gulu Monami Etkinlik
PPTX
Sarkgulu Sunum Bir
PPTX
савойская капуста
PPTX
декада по професії кухар
PPTX
Pryhod'ko olena mykolai'vna_vchytel'_pochatkovyh_klasiv
PPTX
معالجات
PDF
LQ1 survey result latest
PPTX
Sarkgulu Etkinlik
PPTX
Evaluation question 1
Sarkgulu Cocuklar Bir
Infant and Toddler Powerpoint
представление целых чисел в формате с фиксированной запятой
Question 3
Sunum 2 Yeni
Effects on the title 'IN DENIAL'
представление целых чисел в формате с фиксированной запятой
How to Be a Better Marketer?
метод комісія
Student digipak
Business proposal of Taiwan Mining
Sark Gulu Monami Etkinlik
Sarkgulu Sunum Bir
савойская капуста
декада по професії кухар
Pryhod'ko olena mykolai'vna_vchytel'_pochatkovyh_klasiv
معالجات
LQ1 survey result latest
Sarkgulu Etkinlik
Evaluation question 1
Ad

Similar to Ansible introduction & demo (20)

PDF
(Red hat) Ansible Overview-samuel-2018-0911(printed)
PDF
AWS Summit Seoul 2015 - AWS를 통한 게임 운영의 정석
PPTX
Vingle tech talk #1
PDF
Daily Continuous Deployment를 위한 Custom CLI 개발 및
 AWS Elastic Beanstalk에 적용하기
PDF
SOSCON 2017 - Backend.AI
PDF
[NDC17] 왓 스튜디오 서비스파트
PDF
AWS 기반의 마이크로 서비스 아키텍쳐 구현 방안 :: 김필중 :: AWS Summit Seoul 20
PDF
[17.01.19] docker introduction (Korean Version)
PDF
[NDC18] 만들고 붓고 부수고 - 〈야생의 땅: 듀랑고〉 서버 관리 배포 이야기
PDF
NRISE 개발스택
PDF
DevOps 오픈소스 트랜드 (클라우드, 모바일 중심)
PDF
[Ansible] Solution Guide V0.4_20181204.pdf
PDF
[오픈소스컨설팅]쿠버네티스를 활용한 개발환경 구축
PPTX
Hancom MDS Conference - KAKAO DEVOPS Practice (카카오 스토리의 Devops 사례)
PPTX
이것이 리눅스다 - 김종욱
PPTX
Mastering devops with oracle 강인호
PDF
효과적인 데브옵스를 위한 AWS 개발 도구 활용하기 - AWS Summit Seoul 2017
PDF
Open infradays 2019_msa_k8s
PPTX
bamboo 로 PHP 프로젝트 지속적인 배포
PDF
AWS와 함께하는 DevOps이야기 :: 박선용 :: AWS Summit Seoul 2016
(Red hat) Ansible Overview-samuel-2018-0911(printed)
AWS Summit Seoul 2015 - AWS를 통한 게임 운영의 정석
Vingle tech talk #1
Daily Continuous Deployment를 위한 Custom CLI 개발 및
 AWS Elastic Beanstalk에 적용하기
SOSCON 2017 - Backend.AI
[NDC17] 왓 스튜디오 서비스파트
AWS 기반의 마이크로 서비스 아키텍쳐 구현 방안 :: 김필중 :: AWS Summit Seoul 20
[17.01.19] docker introduction (Korean Version)
[NDC18] 만들고 붓고 부수고 - 〈야생의 땅: 듀랑고〉 서버 관리 배포 이야기
NRISE 개발스택
DevOps 오픈소스 트랜드 (클라우드, 모바일 중심)
[Ansible] Solution Guide V0.4_20181204.pdf
[오픈소스컨설팅]쿠버네티스를 활용한 개발환경 구축
Hancom MDS Conference - KAKAO DEVOPS Practice (카카오 스토리의 Devops 사례)
이것이 리눅스다 - 김종욱
Mastering devops with oracle 강인호
효과적인 데브옵스를 위한 AWS 개발 도구 활용하기 - AWS Summit Seoul 2017
Open infradays 2019_msa_k8s
bamboo 로 PHP 프로젝트 지속적인 배포
AWS와 함께하는 DevOps이야기 :: 박선용 :: AWS Summit Seoul 2016

Ansible introduction & demo

  • 1. IT AUTOMATION FOR EVERYONE Ansible Tower KIM, YONGKI Sr. Solution Architect ykim@redhat.com
  • 2. WHY IT AUTOMATION? IaaS와 PaaS 클라우드 환경에서 구동되는 어플리케이션 지원 DevOps 환경에 맞는 신속한 어플리케이션 배포 IT 프로세스 자동화를 통한 서비스 오케스트레이션 2
  • 3. WHY IT AUTOMATION? IaaS와 PaaS 클라우드 환경에서 구동되는 어플리케이션 지원 DevOps 환경에 맞는 신속한 어플리케이션 배포 IT 프로세스 자동화를 통한 서비스 오케스트레이션 3
  • 4. WHY IT AUTOMATION? IaaS와 PaaS 클라우드 환경에서 구동되는 어플리케이션 지원 DevOps 환경에 맞는 신속한 어플리케이션 배포 IT 프로세스 자동화를 통한 서비스 오케스트레이션 4
  • 5. WHY IT AUTOMATION? IaaS와 PaaS 클라우드 환경에서 구동되는 어플리케이션 지원 DevOps 환경에 맞는 신속한 어플리케이션 배포 IT 프로세스 자동화를 통한 서비스 오케스트레이션 5
  • 6. 반복된 작업 6 IT AUTOMATION • 다수 서버의 서비스 상태 확인 • CPU, Memory, Disk 등 자원 상태 확인 • OS 패치작업 • 신규 어플리케이션 설치 • 환경 설정 파일 유지 • 다수 서버에서 동일 명령어 수행 • 끝나면 다시 시작… 반복되는 IT 작업
  • 7. 반복된 작업의 일반적인 해결 방법 7 IT AUTOMATION
  • 8. 생산성 향상 INSERT DESIGNATOR, IF NEEDED8 IT AUTOMATION IT 자동화를 통한 관리 용이성 • 다수 서버를 대상으로 반복되는 동일한 패치 작업 • 동일한 어플리케이션 배포 • 동일한 환경 설정 유지 • 동일한 명령어를 수행하여 다른 종류의 OS에서 동일한 작업 수행 • 자동화를 통한 작업 시간 단축 • 자동화를 통한 휴먼 에러 제거
  • 9. 9
  • 10. AUTOMATION = ACCELERATION “By using AnsibleTower Surveys, we have created a self-service capabilitythat allows our IT guys to provision new cloud customers quickly. Our first 3 customers each took2 weeks to provision.With Ansible, our next 500 customers took 10 minutes each to provision.” “We use Ansible to deploy the network configurationsto new datacenters for our games. Previously, itwould take 4 days worth of work, onsite, to make sure that our networks were configured correctly. With Ansible, I can now configure a datacenter in 4 minutes, remotely.” “With AnsibleTower, we just click a button and deploy to production in 5 minutes. It used to take us 5 hours with 6 people sittingin a room, making sure we didn’tdo anything wrong (and we usually still had errors). We now deployto production every other day instead of every 2 weeks, and nobodyhas to be up at 4am makingsure it was done right.” 10
  • 12. SIMPLE 12 WHAT IS ANSIBLE? THE ANSIBLE WAY • Human Readable • 알기 쉬운 자동화 스크립트 • 어려운 코딩 기술 불필요 • Version Controlled • 텍스트 기반 플레이북을 사용 • 기존 형성관리 솔루션 사용가능 • 순서에 따른 작업 실행 • 일관된 결과 제공
  • 13. POWERFULL 13 WHAT IS ANSIBLE? THE ANSIBLE WAY • CROSS PLATFORM • Linux, Windows, UNIX 지원 • AUTOMATED JOBS • 어플리케이션 자동 배포 • 환경 설정 자동 관리 • DYNAMIC INVENTORIES • 다양한 인프라 구조 지원(Baremetal, VM, CLOUD)
  • 14. AGENTLESS 14 WHAT IS ANSIBLE? THE ANSIBLE WAY • Agentless • 별도의 에이전트 불필요 • OpenSSH와 WinRM 사용 • 에이전트에 의한 보안 이슈 제거 • SSH를 통한 모든 SHELL 작업 가능
  • 20. 20 PLAYBOOK EXAMPLE --- - name: install and start apache hosts: all vars: http_port: 80 max_clients: 200 remote_user: root tasks: - name: install httpd yum: pkg=httpd state=latest - name: write the apache config file template: src=/srv/httpd.j2 dest=/etc/httpd.conf - name: start httpd service: name=httpd state=running
  • 22. Mature Open Source Project 22 #1 IN I.T. AUTOMATION • Open Source Community • 2,000명 이상 개발 참여 • GitHub에서 13,000이상 추천 • 2014년 Top 10 오픈소스 프로젝트 선정 • 매월 250,000 이상 다운로드 • 1,200명 이상 IRC 유저
  • 23. ansible vs. puppet vs. chef 23 COMPARISON WITH OTHER TOOLS Ansible Puppet Chef Agent Agentless with Agent (master-client) with Agent (master-client) Language python Puppet DSL, ruby ruby Maturity youngest oldest older Learning curve easy harder hardest complexity simple not simple complex Modules many modules in ansible-galaxy large modules in puppet forge plenty of recipes when to use it adaption of automation easily large enterprises with a heterogeneous environment good for development- focused teams and environments ref: http://blog.takipi.com/deployment-management-tools-chef-vs-puppet-vs-ansible-vs-saltstack-vs-fabric/
  • 24. WEB Management 24 ANSIBLE TOWER WEB UI 와 restful API를 통한 Ansible 기능 강화 • Role 기반 접근 제어 방식 • 보안 강화 • 팀작업 효율 강화 • 미권한 유저의 안전한 배포 • 버튼을 누르는 단순 작업으로 배포 실행 • 모든 작업의 중앙집중형 로그 기록 • 작업 결과 확인 • 기존 작업 상태 확인
  • 26. 26 BENEFITS OF ANSIBLE - DEVOPS COMMUNICATION IS THE KEY TO DEVOPS. Ansible: IT 전반에 활용될 수 있는 automation language. Ansible: 어플리케이션 라이프 사이클을 자동화할 수 있는 automation engine.
  • 27. 27 BENEFITS OF ANSIBLE - IMPACT + 반복작업 제거 + 좀 더 생산적인 업무에 집중 + 실수 및 에러 감소 + 업무 협조 증가 + 복잡성 해결 + 혁신을 위한 업무 배치 + 책임 및 규정 준수 + 성공을 위한 문화
  • 28. 28 SUMMARY MODERNIZE 기존 작업 프로세스의 자동화 기존 운영방식을 DevOps처럼 MIGRATION 정형화된 어플리케이션 스택 정의 모든 인프라환경에 재배포 MIGRATION 모든 것을 모델화 지속적인 배포
  • 30. 30 DEMO Simple Ansible Command 1. status check # ansible –k –m ping rhel61 # ansible –k –m ping rhel6 2. gathering system information # ls –l /root # ansible –k –m setup –tree /root/sysinfo rhel61 # grep product /root/sysinfo/rhel61 “ansible_product_name”: “VirtualBox” => H/W model name … 3. shell command execution # ansible -k –m shell –a “cat /etc/hosts” rhel61 # ansible –k –m script –a “/root/scripts/getrpm_list.sh” rhel6
  • 31. 31 DEMO ansible repository cat /etc/ansible/hosts ##### openstack management by ykim# [ctrl] ctrl[1:3] [com] com[1:2] [openstack:children] ctrl com ##### for this Demo :D [rhel6] rhel6[1:2]
  • 32. 32 DEMO ansible-doc 1. ansible modules list # ansible-doc –l # list all modules … stat retrieve file or file system status subversion Deploys a subversion repository. svr4pkg Manage Solaris SVR4 packages swdepot Manage packages with swdepot package manager (HP-UX) ... 2. ansible document #ansible-doc script EXAMPLES:# Example from Ansible Playbooks- script: /some/local/script.sh --some-arguments 1234# Run a script that creates a file, but only if the file is not yet created- script: /some/local/create_file.sh --some- arguments 1234 creates=/the/created/file.txt# Run a script that removes a file, but only if the file is not yet removed- script: /some/local/remove_file.sh --some-arguments 1234 removes=/the/removed/file.txt
  • 33. 33 DEMO Ansible-playbook – query execution 1. mysql query on Ansible # ansible-playbook –k query.yml => result
  • 34. 34 DEMO Ansible-playbook – query playbook sample 1. mysql query on Ansible #cat query.yml --- - name: Retrieve stuff from mysql hosts: rhel61 tasks: - name: select data from mysql db command: > mysql --user=root test --host=rhel61 --batch --skip-column-names --execute="SELECT data from example" register: result always_run: True changed_when: False - name: print out the result debug: "{{ item }}" with_items: result.stdout_lines
  • 35. 35 DEMO Ansible-playbook – update patch & rollback execution 1. pkg update on Ansible ## 실행 이전 현재 glibc 버전 확인 ##### on rhel62 ß to identify which version is available # yum info glibc-common #### on ansible (task: 1. lvmsnapshot, 2. yum update) # ansible-playbook –k 01.updateGlibc.yml #### on rhel62 # yum info glibc-common ß to confirm that updated version is installed #### Assume that the patch is not suitable and want to rollback to old file system. #### on ansible (task: lvm snapshot rollback) # ansible-playbook –k 02.restoreFilesystem.yml ### on rhel62 # yum info glibc-common ß to confirm that snapshot is applied ref: https://access.redhat.com/solutions/65991
  • 36. 36 DEMO Ansible-playbook – update patch & rollback playbook sample 1. update-patch playbook on Ansible #cat 01.updateGlibc.yml --- - name: lvm snapshot and update glibc pkg hosts: rhel62 tasks: - name: create root filesystem snapshot shell: lvcreate -s -L 900M -n lvrootsnap /dev/VolGroup/lv_root - name: update glibc package yum: pkg: glibc-common state: latest
  • 37. 37 DEMO Ansible-playbook – update patch & rollback playbook sample 2. rollback playbook on Ansible #### also you can use “yum history” #cat 02.restoreFilesystem.yml --- - name: restore filesystem hosts: rhel62 tasks: - name: restore from old snapshot shell: lvconvert --merge /dev/VolGroup/lvrootsnap register: result - name: showing stdout debug: "{{ item }}" with_items: result.stdout_lines - name: reboot to affect it shell: reboot
  • 39. 39 DEMO Ansible-Tower press here to start job 1. log in web console 2. make job template 3. run it
  • 42. 42 CONSIDERATION Ansible-Tower # TASK List create/restore snapshot on root filesystem https://access.redhat.com/solutions/65991 - create: lvcreate -s -L 1G -n lvrootsnap /dev/VolGroup/lv_root - restore: lvconvert --merge /dev/VolGroup/lvrootsnap - reboot *자동화 스크립트를 구성하기 위해서는 해당 명령어를 통해 정상적으로 기능이 작동하는지 확인하는 것이 반드시 필요.