SlideShare a Scribd company logo
1 of 12
Download to read offline
Ansible overview
이선찬
blurblah@blurblah.net
Ansible?
• Configuration management tool
✓ Chef, Puppet, Ansible, …
✓ Idempotence
• Python + YAML
✓ Python으로 구현되어 있음. Configuration은 YAML
• No agents
✓ SSH 기반으로 동작. 복잡한 구축과정 필요없음
Install
• via OS package manager
✓ apt, yum, …
• via pip
✓ sudo pip install ansible
Basic
• Authentication
✓ SSH 기반이므로 private key / password로
✓ ~/.ssh/authorized_keys, --private-key
• Key에 password 있으면 ssh-add command 사용
✓ --ask-pass
✓ --ask-sudo-pass, --ask-become-pass
• Ad-hoc command
✓ 일회성으로 실행해보려는 command
✓ ansible {group} -m {module} -a {arguments}
{options}
✓ ansible all -m ping
✓ ansible testvms -m apt -a ‘name=ntp
state=present’ --become
✓ Linux pipe 관련된 실행은 안될 수 있음
Inventory file
• Remote machine list
✓ IP or hostname, grouping, variables
• /etc/ansible/hosts
• -i {inventory_file}
• Format
host1.example.com
10.1.0.15
host2-alias host2.example.com ansible_user=ubuntu
[group1]
host1.example.com
[parentgroup]
10.1.0.20
[parentgroup:children]
group1
[group1:vars]
variable1 = value1
Variables
• Ansible이 정의하고 있는 variables
✓ ansible_user, ansible_ssh_private_key_file,
…
• 사용자 정의 variables
✓ web_server_port, …
• Variables 분리
✓ /etc/ansible/group_vars/{group}.yml
✓ /etc/ansible/host_vars/{host}.yml
✓ /playbook/path/group_vars/{group}.yml
✓ /playbook/path/host_vars/{host}.yml
✓ Ansible 기본 경로와 playbook 경로에 모두 있
을 경우 playbook 하위 경로의 내용으로
override
Playbook
• playbook > play > role > task
✓ task : ansible module 하나를 호출하는 작업단위
✓ play : host, group을 정의된 role에 매핑
✓ example : wordpress playbook
• mysql role (mysql 구성하기 위한 task 모음) + apache
role + php/wordpress role
• ansible-playbook {playbook_file}.yml {options}
Role
• Playbook 구성하기 가장 좋은 방법
• File directory 구조에 따라 자동으로 로딩
• roles 하위 디렉토리에 main.yml 파일 필요
그 이외의 것들
• Include
✓ 다른 파일에 정의된 play나 task 가져오기
• Handler
✓ task 수행 후 trigger 되는 작업
✓ task의 notify section에서 호출
• Module
✓ Module 마다 기능이 다르고 argument들이 다르므로 참조
✓ http://docs.ansible.com/ansible/modules_by_category.html

More Related Content

What's hot

Windows Registered I/O (RIO) vs IOCP
Windows Registered I/O (RIO) vs IOCPWindows Registered I/O (RIO) vs IOCP
Windows Registered I/O (RIO) vs IOCPSeungmo Koo
 
200.마이크로서비스에 적합한 오픈소스 WAS는 무엇?
200.마이크로서비스에 적합한 오픈소스 WAS는 무엇?200.마이크로서비스에 적합한 오픈소스 WAS는 무엇?
200.마이크로서비스에 적합한 오픈소스 WAS는 무엇?Opennaru, inc.
 
[NDC18] 만들고 붓고 부수고 - 〈야생의 땅: 듀랑고〉 서버 관리 배포 이야기
[NDC18] 만들고 붓고 부수고 - 〈야생의 땅: 듀랑고〉 서버 관리 배포 이야기[NDC18] 만들고 붓고 부수고 - 〈야생의 땅: 듀랑고〉 서버 관리 배포 이야기
[NDC18] 만들고 붓고 부수고 - 〈야생의 땅: 듀랑고〉 서버 관리 배포 이야기Chanwoong Kim
 
Front end 웹사이트 성능 측정 및 개선
Front end 웹사이트 성능 측정 및 개선Front end 웹사이트 성능 측정 및 개선
Front end 웹사이트 성능 측정 및 개선기동 이
 
라이브 서비스를 위한 게임 서버 구성
라이브 서비스를 위한 게임 서버 구성라이브 서비스를 위한 게임 서버 구성
라이브 서비스를 위한 게임 서버 구성Hyunjik Bae
 
웹서버와 프라우드넷 서버간 상호작용 가이드
웹서버와 프라우드넷 서버간 상호작용 가이드웹서버와 프라우드넷 서버간 상호작용 가이드
웹서버와 프라우드넷 서버간 상호작용 가이드Hyunjik Bae
 
[231]나는서버를썰터이니너는개발만하여라 양지욱
[231]나는서버를썰터이니너는개발만하여라 양지욱[231]나는서버를썰터이니너는개발만하여라 양지욱
[231]나는서버를썰터이니너는개발만하여라 양지욱NAVER D2
 
2016 NDC - 클라우드 시대의 모바일 게임 운영 플랫폼 구현
2016 NDC  - 클라우드 시대의  모바일 게임 운영 플랫폼 구현2016 NDC  - 클라우드 시대의  모바일 게임 운영 플랫폼 구현
2016 NDC - 클라우드 시대의 모바일 게임 운영 플랫폼 구현iFunFactory Inc.
 
DV 환경에서 PG 연동하기 ('우리 안의 소리', 2015-11-19)
DV 환경에서 PG 연동하기 ('우리 안의 소리', 2015-11-19)DV 환경에서 PG 연동하기 ('우리 안의 소리', 2015-11-19)
DV 환경에서 PG 연동하기 ('우리 안의 소리', 2015-11-19)Jongwon Han
 
[아이펀팩토리] 클라이언트 개발자, 서버 개발 시작하기
[아이펀팩토리] 클라이언트 개발자, 서버 개발 시작하기 [아이펀팩토리] 클라이언트 개발자, 서버 개발 시작하기
[아이펀팩토리] 클라이언트 개발자, 서버 개발 시작하기 iFunFactory Inc.
 
FCGI, C++로 Restful 서버 개발
FCGI, C++로 Restful 서버 개발FCGI, C++로 Restful 서버 개발
FCGI, C++로 Restful 서버 개발현승 배
 
Backend server monitoring and alarm system (collectd, graphite, grafana, zabb...
Backend server monitoring and alarm system (collectd, graphite, grafana, zabb...Backend server monitoring and alarm system (collectd, graphite, grafana, zabb...
Backend server monitoring and alarm system (collectd, graphite, grafana, zabb...Jongwon Han
 
HTML5/JSON 을 이용해 범용 2D 맵에디터 제작하기
HTML5/JSON 을 이용해 범용 2D 맵에디터 제작하기HTML5/JSON 을 이용해 범용 2D 맵에디터 제작하기
HTML5/JSON 을 이용해 범용 2D 맵에디터 제작하기Miyu Park
 
NDC14 모바일 게임서비스를 위한 사설 클라우드 구축/운영 분투기
NDC14 모바일 게임서비스를 위한 사설 클라우드 구축/운영 분투기NDC14 모바일 게임서비스를 위한 사설 클라우드 구축/운영 분투기
NDC14 모바일 게임서비스를 위한 사설 클라우드 구축/운영 분투기Jinuk Kim
 
iFun Engine plugin 만들기 (for Stingray)
iFun Engine plugin 만들기 (for Stingray) iFun Engine plugin 만들기 (for Stingray)
iFun Engine plugin 만들기 (for Stingray) iFunFactory Inc.
 
Rasberry nodejs install_final
Rasberry nodejs install_finalRasberry nodejs install_final
Rasberry nodejs install_finalKwan Yeong Kim
 
웹서버와 ProudNet 서버간 상호작용 가이드
웹서버와 ProudNet 서버간 상호작용 가이드웹서버와 ProudNet 서버간 상호작용 가이드
웹서버와 ProudNet 서버간 상호작용 가이드Hyunjik Bae
 
AWS와 함께 한 쿠키런 서버 Re-architecting 사례 (Gaming on AWS)
AWS와 함께 한 쿠키런 서버 Re-architecting 사례 (Gaming on AWS)AWS와 함께 한 쿠키런 서버 Re-architecting 사례 (Gaming on AWS)
AWS와 함께 한 쿠키런 서버 Re-architecting 사례 (Gaming on AWS)Brian Hong
 

What's hot (20)

Windows Registered I/O (RIO) vs IOCP
Windows Registered I/O (RIO) vs IOCPWindows Registered I/O (RIO) vs IOCP
Windows Registered I/O (RIO) vs IOCP
 
EC2용 SSH Tool - Eclair
EC2용 SSH Tool - EclairEC2용 SSH Tool - Eclair
EC2용 SSH Tool - Eclair
 
200.마이크로서비스에 적합한 오픈소스 WAS는 무엇?
200.마이크로서비스에 적합한 오픈소스 WAS는 무엇?200.마이크로서비스에 적합한 오픈소스 WAS는 무엇?
200.마이크로서비스에 적합한 오픈소스 WAS는 무엇?
 
[NDC18] 만들고 붓고 부수고 - 〈야생의 땅: 듀랑고〉 서버 관리 배포 이야기
[NDC18] 만들고 붓고 부수고 - 〈야생의 땅: 듀랑고〉 서버 관리 배포 이야기[NDC18] 만들고 붓고 부수고 - 〈야생의 땅: 듀랑고〉 서버 관리 배포 이야기
[NDC18] 만들고 붓고 부수고 - 〈야생의 땅: 듀랑고〉 서버 관리 배포 이야기
 
Front end 웹사이트 성능 측정 및 개선
Front end 웹사이트 성능 측정 및 개선Front end 웹사이트 성능 측정 및 개선
Front end 웹사이트 성능 측정 및 개선
 
라이브 서비스를 위한 게임 서버 구성
라이브 서비스를 위한 게임 서버 구성라이브 서비스를 위한 게임 서버 구성
라이브 서비스를 위한 게임 서버 구성
 
웹서버와 프라우드넷 서버간 상호작용 가이드
웹서버와 프라우드넷 서버간 상호작용 가이드웹서버와 프라우드넷 서버간 상호작용 가이드
웹서버와 프라우드넷 서버간 상호작용 가이드
 
[231]나는서버를썰터이니너는개발만하여라 양지욱
[231]나는서버를썰터이니너는개발만하여라 양지욱[231]나는서버를썰터이니너는개발만하여라 양지욱
[231]나는서버를썰터이니너는개발만하여라 양지욱
 
2016 NDC - 클라우드 시대의 모바일 게임 운영 플랫폼 구현
2016 NDC  - 클라우드 시대의  모바일 게임 운영 플랫폼 구현2016 NDC  - 클라우드 시대의  모바일 게임 운영 플랫폼 구현
2016 NDC - 클라우드 시대의 모바일 게임 운영 플랫폼 구현
 
DV 환경에서 PG 연동하기 ('우리 안의 소리', 2015-11-19)
DV 환경에서 PG 연동하기 ('우리 안의 소리', 2015-11-19)DV 환경에서 PG 연동하기 ('우리 안의 소리', 2015-11-19)
DV 환경에서 PG 연동하기 ('우리 안의 소리', 2015-11-19)
 
[아이펀팩토리] 클라이언트 개발자, 서버 개발 시작하기
[아이펀팩토리] 클라이언트 개발자, 서버 개발 시작하기 [아이펀팩토리] 클라이언트 개발자, 서버 개발 시작하기
[아이펀팩토리] 클라이언트 개발자, 서버 개발 시작하기
 
FCGI, C++로 Restful 서버 개발
FCGI, C++로 Restful 서버 개발FCGI, C++로 Restful 서버 개발
FCGI, C++로 Restful 서버 개발
 
Ansible - Introduction
Ansible - IntroductionAnsible - Introduction
Ansible - Introduction
 
Backend server monitoring and alarm system (collectd, graphite, grafana, zabb...
Backend server monitoring and alarm system (collectd, graphite, grafana, zabb...Backend server monitoring and alarm system (collectd, graphite, grafana, zabb...
Backend server monitoring and alarm system (collectd, graphite, grafana, zabb...
 
HTML5/JSON 을 이용해 범용 2D 맵에디터 제작하기
HTML5/JSON 을 이용해 범용 2D 맵에디터 제작하기HTML5/JSON 을 이용해 범용 2D 맵에디터 제작하기
HTML5/JSON 을 이용해 범용 2D 맵에디터 제작하기
 
NDC14 모바일 게임서비스를 위한 사설 클라우드 구축/운영 분투기
NDC14 모바일 게임서비스를 위한 사설 클라우드 구축/운영 분투기NDC14 모바일 게임서비스를 위한 사설 클라우드 구축/운영 분투기
NDC14 모바일 게임서비스를 위한 사설 클라우드 구축/운영 분투기
 
iFun Engine plugin 만들기 (for Stingray)
iFun Engine plugin 만들기 (for Stingray) iFun Engine plugin 만들기 (for Stingray)
iFun Engine plugin 만들기 (for Stingray)
 
Rasberry nodejs install_final
Rasberry nodejs install_finalRasberry nodejs install_final
Rasberry nodejs install_final
 
웹서버와 ProudNet 서버간 상호작용 가이드
웹서버와 ProudNet 서버간 상호작용 가이드웹서버와 ProudNet 서버간 상호작용 가이드
웹서버와 ProudNet 서버간 상호작용 가이드
 
AWS와 함께 한 쿠키런 서버 Re-architecting 사례 (Gaming on AWS)
AWS와 함께 한 쿠키런 서버 Re-architecting 사례 (Gaming on AWS)AWS와 함께 한 쿠키런 서버 Re-architecting 사례 (Gaming on AWS)
AWS와 함께 한 쿠키런 서버 Re-architecting 사례 (Gaming on AWS)
 

Viewers also liked

Vagrant - Version control your dev environment
Vagrant - Version control your dev environmentVagrant - Version control your dev environment
Vagrant - Version control your dev environmentbocribbz
 
QCon 2015 - DevOps, Chef, Puppet e Ansible e como vender milhões na Black Fri...
QCon 2015 - DevOps, Chef, Puppet e Ansible e como vender milhões na Black Fri...QCon 2015 - DevOps, Chef, Puppet e Ansible e como vender milhões na Black Fri...
QCon 2015 - DevOps, Chef, Puppet e Ansible e como vender milhões na Black Fri...Bruno Luiz Pereira da Silva
 
Debugging ansible modules
Debugging ansible modulesDebugging ansible modules
Debugging ansible modulesaleonhardt
 
Overview of Puppet and Ansible
Overview of Puppet and AnsibleOverview of Puppet and Ansible
Overview of Puppet and AnsibleKyle Smith
 
Puppet Intfrastructure as Code
Puppet Intfrastructure as CodePuppet Intfrastructure as Code
Puppet Intfrastructure as CodeSamir Chekkal
 
Ansible for beginners ...?
Ansible for beginners ...?Ansible for beginners ...?
Ansible for beginners ...?shirou wakayama
 
Switching from Puppet to Ansible
Switching from Puppet to AnsibleSwitching from Puppet to Ansible
Switching from Puppet to AnsibleDennis Rowe
 
DevOps Cardiff - Puppet vs Chef vs Ansible
DevOps Cardiff - Puppet vs Chef vs AnsibleDevOps Cardiff - Puppet vs Chef vs Ansible
DevOps Cardiff - Puppet vs Chef vs AnsibleMark Phillips
 
Docker ansible-make-chef-puppet-unnecessary-minnihan
Docker ansible-make-chef-puppet-unnecessary-minnihanDocker ansible-make-chef-puppet-unnecessary-minnihan
Docker ansible-make-chef-puppet-unnecessary-minnihanjbminn
 
CAPS: What's best for deploying and managing OpenStack? Chef vs. Ansible vs. ...
CAPS: What's best for deploying and managing OpenStack? Chef vs. Ansible vs. ...CAPS: What's best for deploying and managing OpenStack? Chef vs. Ansible vs. ...
CAPS: What's best for deploying and managing OpenStack? Chef vs. Ansible vs. ...Daniel Krook
 
Ansible is the simplest way to automate. MoldCamp, 2015
Ansible is the simplest way to automate. MoldCamp, 2015Ansible is the simplest way to automate. MoldCamp, 2015
Ansible is the simplest way to automate. MoldCamp, 2015Alex S
 
Ansible: How to Get More Sleep and Require Less Coffee
Ansible: How to Get More Sleep and Require Less CoffeeAnsible: How to Get More Sleep and Require Less Coffee
Ansible: How to Get More Sleep and Require Less CoffeeSarah Z
 
Vighnesh_Naik_Resume_DevOps
Vighnesh_Naik_Resume_DevOpsVighnesh_Naik_Resume_DevOps
Vighnesh_Naik_Resume_DevOpsVIGHNESH NAIK
 
DevOps and Continuous Delivery Reference Architectures (including Nexus and o...
DevOps and Continuous Delivery Reference Architectures (including Nexus and o...DevOps and Continuous Delivery Reference Architectures (including Nexus and o...
DevOps and Continuous Delivery Reference Architectures (including Nexus and o...Sonatype
 
Ansible Introduction
Ansible Introduction Ansible Introduction
Ansible Introduction Robert Reiz
 

Viewers also liked (16)

Vagrant - Version control your dev environment
Vagrant - Version control your dev environmentVagrant - Version control your dev environment
Vagrant - Version control your dev environment
 
QCon 2015 - DevOps, Chef, Puppet e Ansible e como vender milhões na Black Fri...
QCon 2015 - DevOps, Chef, Puppet e Ansible e como vender milhões na Black Fri...QCon 2015 - DevOps, Chef, Puppet e Ansible e como vender milhões na Black Fri...
QCon 2015 - DevOps, Chef, Puppet e Ansible e como vender milhões na Black Fri...
 
Debugging ansible modules
Debugging ansible modulesDebugging ansible modules
Debugging ansible modules
 
Overview of Puppet and Ansible
Overview of Puppet and AnsibleOverview of Puppet and Ansible
Overview of Puppet and Ansible
 
Puppet Intfrastructure as Code
Puppet Intfrastructure as CodePuppet Intfrastructure as Code
Puppet Intfrastructure as Code
 
Ansible for beginners ...?
Ansible for beginners ...?Ansible for beginners ...?
Ansible for beginners ...?
 
Switching from Puppet to Ansible
Switching from Puppet to AnsibleSwitching from Puppet to Ansible
Switching from Puppet to Ansible
 
DevOps Cardiff - Puppet vs Chef vs Ansible
DevOps Cardiff - Puppet vs Chef vs AnsibleDevOps Cardiff - Puppet vs Chef vs Ansible
DevOps Cardiff - Puppet vs Chef vs Ansible
 
Docker ansible-make-chef-puppet-unnecessary-minnihan
Docker ansible-make-chef-puppet-unnecessary-minnihanDocker ansible-make-chef-puppet-unnecessary-minnihan
Docker ansible-make-chef-puppet-unnecessary-minnihan
 
CAPS: What's best for deploying and managing OpenStack? Chef vs. Ansible vs. ...
CAPS: What's best for deploying and managing OpenStack? Chef vs. Ansible vs. ...CAPS: What's best for deploying and managing OpenStack? Chef vs. Ansible vs. ...
CAPS: What's best for deploying and managing OpenStack? Chef vs. Ansible vs. ...
 
Ansible is the simplest way to automate. MoldCamp, 2015
Ansible is the simplest way to automate. MoldCamp, 2015Ansible is the simplest way to automate. MoldCamp, 2015
Ansible is the simplest way to automate. MoldCamp, 2015
 
Ansible: How to Get More Sleep and Require Less Coffee
Ansible: How to Get More Sleep and Require Less CoffeeAnsible: How to Get More Sleep and Require Less Coffee
Ansible: How to Get More Sleep and Require Less Coffee
 
Dev ops engineer
Dev ops engineerDev ops engineer
Dev ops engineer
 
Vighnesh_Naik_Resume_DevOps
Vighnesh_Naik_Resume_DevOpsVighnesh_Naik_Resume_DevOps
Vighnesh_Naik_Resume_DevOps
 
DevOps and Continuous Delivery Reference Architectures (including Nexus and o...
DevOps and Continuous Delivery Reference Architectures (including Nexus and o...DevOps and Continuous Delivery Reference Architectures (including Nexus and o...
DevOps and Continuous Delivery Reference Architectures (including Nexus and o...
 
Ansible Introduction
Ansible Introduction Ansible Introduction
Ansible Introduction
 

Ansible overview

  • 2. Ansible? • Configuration management tool ✓ Chef, Puppet, Ansible, … ✓ Idempotence • Python + YAML ✓ Python으로 구현되어 있음. Configuration은 YAML • No agents ✓ SSH 기반으로 동작. 복잡한 구축과정 필요없음
  • 3. Install • via OS package manager ✓ apt, yum, … • via pip ✓ sudo pip install ansible
  • 4. Basic • Authentication ✓ SSH 기반이므로 private key / password로 ✓ ~/.ssh/authorized_keys, --private-key • Key에 password 있으면 ssh-add command 사용 ✓ --ask-pass ✓ --ask-sudo-pass, --ask-become-pass
  • 5. • Ad-hoc command ✓ 일회성으로 실행해보려는 command ✓ ansible {group} -m {module} -a {arguments} {options} ✓ ansible all -m ping ✓ ansible testvms -m apt -a ‘name=ntp state=present’ --become ✓ Linux pipe 관련된 실행은 안될 수 있음
  • 6. Inventory file • Remote machine list ✓ IP or hostname, grouping, variables • /etc/ansible/hosts • -i {inventory_file}
  • 7. • Format host1.example.com 10.1.0.15 host2-alias host2.example.com ansible_user=ubuntu [group1] host1.example.com [parentgroup] 10.1.0.20 [parentgroup:children] group1 [group1:vars] variable1 = value1
  • 8. Variables • Ansible이 정의하고 있는 variables ✓ ansible_user, ansible_ssh_private_key_file, … • 사용자 정의 variables ✓ web_server_port, …
  • 9. • Variables 분리 ✓ /etc/ansible/group_vars/{group}.yml ✓ /etc/ansible/host_vars/{host}.yml ✓ /playbook/path/group_vars/{group}.yml ✓ /playbook/path/host_vars/{host}.yml ✓ Ansible 기본 경로와 playbook 경로에 모두 있 을 경우 playbook 하위 경로의 내용으로 override
  • 10. Playbook • playbook > play > role > task ✓ task : ansible module 하나를 호출하는 작업단위 ✓ play : host, group을 정의된 role에 매핑 ✓ example : wordpress playbook • mysql role (mysql 구성하기 위한 task 모음) + apache role + php/wordpress role • ansible-playbook {playbook_file}.yml {options}
  • 11. Role • Playbook 구성하기 가장 좋은 방법 • File directory 구조에 따라 자동으로 로딩 • roles 하위 디렉토리에 main.yml 파일 필요
  • 12. 그 이외의 것들 • Include ✓ 다른 파일에 정의된 play나 task 가져오기 • Handler ✓ task 수행 후 trigger 되는 작업 ✓ task의 notify section에서 호출 • Module ✓ Module 마다 기능이 다르고 argument들이 다르므로 참조 ✓ http://docs.ansible.com/ansible/modules_by_category.html