"Ansible"의 두 판 사이의 차이
둘러보기로 가기
검색하러 가기
잔글 |
잔글 |
||
(같은 사용자의 중간 판 11개는 보이지 않습니다) | |||
1번째 줄: | 1번째 줄: | ||
DevOps 도우인 Ansible을 정리 합니다. | DevOps 도우인 Ansible을 정리 합니다. | ||
− | *홈페이지 : https://github.com/ansible/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 |
*플랫폼 : | *플랫폼 : | ||
28번째 줄: | 36번째 줄: | ||
*$HOME/.ansible/ | *$HOME/.ansible/ | ||
*/usr/share/ansible_plugins/ | */usr/share/ansible_plugins/ | ||
+ | * /usr/lib/python2.7/site-packages/ansible/modules | ||
== Ansible 사용법 == | == Ansible 사용법 == | ||
40번째 줄: | 49번째 줄: | ||
task : Ansible 모듈 호출 | task : Ansible 모듈 호출 | ||
+ | |||
+ | [http://yaml.org yaml], [http://jinja.pocoo.org/docs/ Jinja2] 사용 | ||
=== CLI === | === CLI === | ||
+ | <pre>ansible --help | ||
+ | ansible-doc command | ||
− | ansible | + | 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-playbook release.yml --extra-vars "host=~ user=~"< | + | 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> | ||
== 참고 문헌 == | == 참고 문헌 == |
2016년 2월 22일 (월) 10:21 기준 최신판
DevOps 도우인 Ansible을 정리 합니다.
- 홈페이지 : https://github.com/ansible/ansible
- 다운로드 :
- 라이선스 : GNU GPL
- 플랫폼 :
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 모듈 호출
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}}