"Ansible"의 두 판 사이의 차이

오픈소스 비즈니스 컨설팅
둘러보기로 가기 검색하러 가기
잔글
잔글
29번째 줄: 29번째 줄:
 
*/usr/share/ansible_plugins/
 
*/usr/share/ansible_plugins/
  
== Ansible 구조 ==
+
== Ansible 사용법 ==
  
playbook : 하나 이상의 play
+
=== 구조 ===
  
play : role과 task를 매핑
+
playbook : 하나 이상의 play
 +
 
 +
play : role과 task를 매핑
  
 
role
 
role
  
 
task : Ansible 모듈 호출
 
task : Ansible 모듈 호출
 +
 +
 +
 +
=== CLI ===
 +
 +
ansible<br/>&nbsp; &nbsp; --module-name=모듈 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -m<br/>&nbsp; &nbsp; --args=모듈_Args &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;-a<br/>&nbsp; &nbsp; --module-path=MODULE_PATH &nbsp; -M<br/>&nbsp; &nbsp; --check &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -C<br/>&nbsp; &nbsp;&nbsp;<br/>&nbsp; &nbsp; --extra-vars="name1=value1 name2=value2" &nbsp; &nbsp; &nbsp;-e &nbsp; &nbsp;#--- &#x7B;&#x7B;name1&#x7D;&#x7D;<br/>&nbsp; &nbsp; --output=OUTPUT_FILE
 +
 +
ansible-playbook
  
 
== 참고 문헌 ==
 
== 참고 문헌 ==

2016년 2월 16일 (화) 19:14 판

DevOps 도우인 Ansible을 정리 합니다.

  • 홈페이지 : 
  • 다운로드 : 
  • 라이선스 : 
  • 플랫폼 : 


Ansible 개요

Ansible 설치

CentOS에서 yum으로 설치

yum -y install ansible ansible-*
ansible --version

#--- ansible --version 명령에서 오류가 발생할 경우
pip uninstall ansible
pip install ansible

ansible controller -m shell -a "ls -alF | grep ceph"


폴더 구조

  • /etc/ansible/
    • hosts : Hosts 파일 정보, Hosts간에는 ssh로 자동 접속이 가능하도록 설정이 되어야 합니다.
  • $HOME/.ansible/
  • /usr/share/ansible_plugins/

Ansible 사용법

구조

playbook : 하나 이상의 play

play : role과 task를 매핑

role

task : Ansible 모듈 호출


CLI

ansible
    --module-name=모듈                 -m
    --args=모듈_Args                      -a
    --module-path=MODULE_PATH   -M
    --check                                   -C
    
    --extra-vars="name1=value1 name2=value2"      -e    #--- {{name1}}
    --output=OUTPUT_FILE

ansible-playbook

참고 문헌