앤서블(Ansible)
Ansible is a radically simple IT automation platform that makes your applications and systems easier to deploy and maintain. Automate everything from code deployment to network configuration to cloud management, in a language that approaches plain English, using SSH, with no agents to install on remote systems.
자동화 툴로 서버 관리에 효율적이고 Contiunous Deployment를 가능하게 한다. ssh를 통해 접속하고 agent 설치가 불필요하다. yaml 기반으로 작성되며 대표적인 Infrastructure as Code의 툴이다.
관리하는 Control Node와 관리되는 Managed Nodes로 구성됨
CentOS 기준 설치 방법
$ yum -y install epel-release
$ yum -y install ansible
$ ansible --version
참조 파일
- /etc/ansible/ansible.cfg: 환경설정 파일
- /etc/ansible/hosts: 앤서블이 접속하는 호스트들에 대한 정보
기본 명령어
$ ansible all -m ping
$ ansible all -m ping -k # k 옵션은 비밀번호 없이
$ ansible all -i inventory_file -m ping -k # i 옵션은 파일에 적힌 모듈만
$ ansible [group] -m ping -k # 그룹한 모듈에게만
$ ansible all -m ping --list-hosts # 적용되는 호스트 출력
$ ansible all -m shell -a "uptime" -k # uptime 확인하기
$ ansible all -m shell -a "df -h" -k # 디스크 용량 확인
# ansible all -m shell -a "free -h" -k # 메모리 상태 확인하기
$ ansible all -m copy -a "src=[filepath] dest=/tmp/" -k # 파일 전송하기
$ ansible all -m yum -a "name=httpd state=present" -k # 서비스 설치
Reference
https://www.inflearn.com/course/%EC%95%A4%EC%84%9C%EB%B8%94ansible-%EA%B8%B0%EC%B4%88/dashboard
[무료] [기초] 처음부터 설치하며 배우는 앤서블(Ansible) - 인프런 | 강의
엔서블과 같은 툴을 접해 보지 못한 엔지니어/관리자 그리고 개발자를 대상으로 주로 실습을 통해 앤서블을 통해 얼마나 효과적으로 시스템이 관리될 수 있는지 체험하고, 이해하게 됩니다, -
www.inflearn.com
'DevOps' 카테고리의 다른 글
gradle could not find method compile() 오류 (0) | 2022.04.15 |
---|