ansible facts 는 remote host 에 대한 정보를 의미하며 배포판 종류, 버전, IP Address, file system 정보등을 포함.
ansible 은 playbook 실행시 자동으로 fact 를 수집하고 저장한다.
playbook을 작성하지 않고 간단하게 fact 만 출력하려면 builtin 모듈인 setup 을 사용한다.
ansible -m setup localhost
ansible -m setup localhost | grep distribution
inventory 파일을 사용
ansible -i inventory -m setup web1 | grep distribution
playbook
- hosts: db1
gather_facts: true
tasks: