ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 198 - DOP-C01 discussion

Report
Export

What is the expected behavior if Ansible is called with ‘ansible-playbook -i localhost playbook.yml’?

A.
Ansible will attempt to read the inventory file named ‘localhost’
Answers
A.
Ansible will attempt to read the inventory file named ‘localhost’
B.
Ansible will run the plays locally.
Answers
B.
Ansible will run the plays locally.
C.
Ansible will run the playbook on the host named ‘localhost’
Answers
C.
Ansible will run the playbook on the host named ‘localhost’
D.
Ansible won't run, this is invalid command line syntax
Answers
D.
Ansible won't run, this is invalid command line syntax
Suggested answer: A

Explanation:

Ansible expects an inventory filename with the ‘-i’ option, regardless if it is a valid hostname. For this to execute on the host `localhost' resolves to, a comma needs to be appended to the end.

Reference: http://docs.ansible.com/ansible/intro_inventory.html#inventory

asked 16/09/2024
Kathie Herod
39 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first