"Ansible"의 두 판 사이의 차이

오픈소스 비즈니스 컨설팅
둘러보기로 가기 검색하러 가기
(새 문서: DevOps 도우인 Ansible을 정리 합니다. *홈페이지 :  *다운로드 :  *라이선스 :  *플랫폼 :  == Ansible 개요 == == 참고 문헌 == *Ce...)
 
잔글
 
(같은 사용자의 중간 판 24개는 보이지 않습니다)
1번째 줄: 1번째 줄:
 
DevOps 도우인 Ansible을 정리 합니다.
 
DevOps 도우인 Ansible을 정리 합니다.
  
*홈페이지 : 
+
*홈페이지 : [https://github.com/ansible/ansible https://github.com/ansible/ansible]
*다운로드 : 
+
**Document : [http://docs.ansible.com/ http://docs.ansible.com/]
*라이선스 : 
+
**Module : [http://docs.ansible.com/ansible/modules.html http://docs.ansible.com/ansible/modules.html]
*플랫폼 : 
+
***https://github.com/ansible/ansible-modules-core
 +
***https://github.com/ansible/ansible-modules-extras
 +
**Example : [https://github.com/ansible/ansible-examples https://github.com/ansible/ansible-examples]
 +
**[https://github.com/dominis/ansible-shell https://github.com/dominis/ansible-shell]
 +
**[https://github.com/openstack-ansible/openstack-ansible https://github.com/openstack-ansible/openstack-ansible]
 +
**[http://terry.im/wiki/terry/Ansible.html http://terry.im/wiki/terry/Ansible.html]
 +
*다운로드 : 
 +
*라이선스 : GNU GPL
 +
*플랫폼 : 
  
  
  
 
== Ansible 개요 ==
 
== Ansible 개요 ==
 +
 +
== Ansible 설치 ==
 +
 +
CentOS에서 yum으로 설치
 +
<pre>yum -y install ansible ansible-*
 +
ansible --version
 +
 +
#--- ansible --version 명령에서 오류가 발생할 경우
 +
pip uninstall ansible
 +
pip install ansible
 +
 +
ansible controller -m shell -a "ls -alF | grep ceph"
 +
</pre>
 +
<br/>폴더 구조
 +
 +
*/etc/ansible/
 +
**hosts&nbsp;: Hosts 파일 정보, Hosts간에는 ssh로 자동 접속이 가능하도록 설정이 되어야 합니다.
 +
*$HOME/.ansible/
 +
*/usr/share/ansible_plugins/
 +
*&nbsp;/usr/lib/python2.7/site-packages/ansible/modules
 +
 +
== Ansible 사용법 ==
 +
 +
=== 구조 ===
 +
 +
playbook&nbsp;: 하나 이상의 play
 +
 +
play&nbsp;: role과 task를 매핑
 +
 +
role
 +
 +
task&nbsp;: Ansible 모듈 호출
 +
 +
[http://yaml.org yaml], [http://jinja.pocoo.org/docs/ Jinja2] 사용
 +
 +
 +
 +
=== CLI ===
 +
<pre>ansible --help
 +
ansible-doc command
 +
 +
ansible
 +
    --module-name=MODULE_NAME          -m MODULE_NAME
 +
    --args=MODULE_ARGS                  -a MODULE_ARGS
 +
    --module-path=MODULE_PATH          -M MODULE_PATH
 +
    --check                            -C
 +
   
 +
    --extra-vars=EXTRA_VARS            -e EXTRA_VARS
 +
    --output=OUTPUT_FILE
 +
 +
ansible all -m ping
 +
ansible controller -a "pwd"
 +
ansible controller -m command -a pwd
 +
ansible controller -m shell -a "ls -alF | grep ceph"
 +
ansible controller -m script -a ~.bash</pre><pre>ansible-playbook release.yml --extra-vars "host=~ user=~" [-vvvv]
 +
{{host}}, {{user}}</pre>
  
 
== 참고 문헌 ==
 
== 참고 문헌 ==
  
 
*[[Ceph|Ceph]]
 
*[[Ceph|Ceph]]
 
+
[[Category:DevOps|Category:DevOps]]
[[Category:DevOps]]
 

2016년 2월 22일 (월) 10:21 기준 최신판

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/
  •  /usr/lib/python2.7/site-packages/ansible/modules

Ansible 사용법

구조

playbook : 하나 이상의 play

play : role과 task를 매핑

role

task : Ansible 모듈 호출

yaml, Jinja2 사용


CLI

ansible --help
ansible-doc command

ansible
    --module-name=MODULE_NAME           -m MODULE_NAME
    --args=MODULE_ARGS                  -a MODULE_ARGS
    --module-path=MODULE_PATH           -M MODULE_PATH
    --check                             -C
    
    --extra-vars=EXTRA_VARS             -e EXTRA_VARS
    --output=OUTPUT_FILE

ansible all -m ping
ansible controller -a "pwd"
ansible controller -m command -a pwd
ansible controller -m shell -a "ls -alF | grep ceph"
ansible controller -m script -a ~.bash
ansible-playbook release.yml --extra-vars "host=~ user=~" [-vvvv]
 {{host}}, {{user}}

참고 문헌