앤서블 공식 문서 ===> https://docs.ansible.com/
서버 재부팅 파일 관리 패키지 관리 사용자 및 그룹 관리 서비스 관리 팩트 변수 수집
ansible [pattern] -m [module] -a "[module options]"
-m: 모듈 이름 지정(기본값: command)
-a: 모듈의 option/argument
- 시스템 재부팅
ansible databases -a "/sbin/reboot" -u username -b -K- 파일 복사
ansible webservers -m copy -a "src=/etc/hosts dest=/tmp/hosts"- 파일 권한 변경
ansible webservers -m file -a "dest=/srv/foo/a.txt mode=600"- 파일 소유권 변경
ansible webservers -m file -a "dest=/path/to/c mode=755 owner=?? group=?? state=directory"- 파일 삭제
ansible webservers -m file -a "dest=/path/to/c state=absent"- 패키지 설치(업데이트 X)
ansible webservers -m apt -a "name=acme state=present"- 특정 버전 패키지 설치
ansible webservers -m apt -a "name=acme=1:0.96.4-5 state=present"- 패키지 제거
ansible webservers -m apt -a "name=acme state=absent"- 사용자 생성
ansible all -m user -a "name=foo password="- 사용자 제거
ansible all -m user -a "name=foo state=absent"- 서비스 시작
ansible webservers -m service -a "name=apache2 state=started"- 서비스 재시작
ansible webservers -m service -a "name=apache2 state=restarted"