Examine the following inventory excerpt file named /home/user/ansible/inventory. [dbservers] db1.example.com
Which of the following files does Ansible check for variables related to that inventory? (Choose all that apply.)
/home/user/ansible/dbservers
/home/user/ansible/host_vars/db1.example.com
/home/user/ansible/host_vars/db1
/home/user/ansible/group_vars/dbservers
Correct answer: BD
Explanation:
Ansible will check in /home/user/ansible/host_vars to find files named after hosts defined in the inventory. Ansible will check this file because there is a group defined in the inventory as dbservers.
Ansible will check in /home/user/ansible/host_vars to find files named after hosts defined in the inventory. Ansible will check this file because there is a group defined in the inventory as dbservers.
Question 2
Which flags must be accepted as input for a dynamic inventory script?
Only --list
--host [hostname] and --list
--host [hostname] and --inv-list
--list and --format [file format]
Correct answer: B
Question 3
A dynamic inventory must return data in what format?