사용자 도구

사이트 도구


devops:ansible

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
devops:ansible [2021/12/20 15:33]
kwon37xi [shell completion]
devops:ansible [2023/01/14 13:38] (현재)
kwon37xi [lineinfile module]
줄 6: 줄 6:
   * [[https://docs.ansible.com/ansible/latest/user_guide/playbooks_best_practices.html|Best Practices — Ansible Documentation]]   * [[https://docs.ansible.com/ansible/latest/user_guide/playbooks_best_practices.html|Best Practices — Ansible Documentation]]
   * 자동화 툴   * 자동화 툴
 +
 +===== Ubuntu PPA =====
 +  * https://launchpad.net/~ansible/+archive/ubuntu/ansible
 +
 +<code sh>
 +sudo add-apt-repository ppa:ansible/ansible
 +</code>
  
 ===== AWS ===== ===== AWS =====
줄 154: 줄 161:
 sudo apt install python3-argcomplete sudo apt install python3-argcomplete
 </code> </code>
-  * 아래 항목을 ''.bashrc'' 에 넣는다 배포판에 따라 ''register-python-argcomplete''(3제외)일 수도 있음. (전역 설정도 가능함)+  * 아래 항목을 ''.bashrc'' 에 넣는다 배포판에 따라 ''register-python-argcomplete''(''3'' 제외)일 수도 있음. (전역 설정도 가능함)
 <code sh> <code sh>
-eval $(register-python-argecomplete3 ansible) +# 필히 "" 로 감싸야한다. 
-eval $(register-python-argecomplete3 ansible-config) +eval "$(register-python-argcomplete3 ansible)" 
-eval $(register-python-argecomplete3 ansible-console) +eval "$(register-python-argcomplete3 ansible-config)" 
-eval $(register-python-argecomplete3 ansible-doc) +eval "$(register-python-argcomplete3 ansible-console)" 
-eval $(register-python-argecomplete3 ansible-galaxy) +eval "$(register-python-argcomplete3 ansible-doc)" 
-eval $(register-python-argecomplete3 ansible-inventory) +eval "$(register-python-argcomplete3 ansible-galaxy)" 
-eval $(register-python-argecomplete3 ansible-playbook) +eval "$(register-python-argcomplete3 ansible-inventory)" 
-eval $(register-python-argecomplete3 ansible-pull) +eval "$(register-python-argcomplete3 ansible-playbook)" 
-eval $(register-python-argecomplete3 ansible-vault)+eval "$(register-python-argcomplete3 ansible-pull)" 
 +eval "$(register-python-argcomplete3 ansible-vault)"
  
 </code> </code>
  
 +===== lineinfile module =====
 +  * [[https://docs.ansible.com/ansible/latest/collections/ansible/builtin/lineinfile_module.html|lineinfile module]]
 +  * 파일 내의 줄들을 관리한다. 내용을 추가하거나, 변경하거나.
 +  * [[linux:sed|Linux sed]] 대체.
 +
 +=====  =====
 +  * [[https://docs.ansible.com/ansible/latest/collections/ansible/builtin/blockinfile_module.html|blockinfile module]]
 +  * 파일 내의 특정 블록을 추가,사제,변경한다.
 +===== replace module =====
 +  * [[https://docs.ansible.com/ansible/latest/collections/ansible/builtin/replace_module.html|replace module]]
 +  * [[:regex|RegEx]]로 파일 내용 교체
 ===== 참조 ===== ===== 참조 =====
   * [[https://www.youtube.com/playlist?list=PLT98CRl2KxKEUHie1m24-wkyHpEsa4Y70|Getting started with Ansible - YouTube]] : 매우 쉽게 Ansible 설명.   * [[https://www.youtube.com/playlist?list=PLT98CRl2KxKEUHie1m24-wkyHpEsa4Y70|Getting started with Ansible - YouTube]] : 매우 쉽게 Ansible 설명.
devops/ansible.1639982018.txt.gz · 마지막으로 수정됨: 2021/12/20 15:33 저자 kwon37xi