ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 55 - DOP-C01 discussion

Report
Export

Which answer is the proper syntax for specifying two target hosts on the command line when running an Ansible Playbook?

A.
ansible-playbook -h host1.example.com -i all playbook.yml
Answers
A.
ansible-playbook -h host1.example.com -i all playbook.yml
B.
ansible-playbook -i host1.example.com playbook.yml
Answers
B.
ansible-playbook -i host1.example.com playbook.yml
C.
ansible-playbook -h host1.example.com,host2.example.com playbook.yml
Answers
C.
ansible-playbook -h host1.example.com,host2.example.com playbook.yml
D.
ansible-playbook -i host1.example.com,host2.example.com playbook.yml
Answers
D.
ansible-playbook -i host1.example.com,host2.example.com playbook.yml
Suggested answer: D

Explanation:

Ansible uses the `-i' flag for accepting an inventory file or host. To allow Ansible to determine if you are passing a host list versus an inventory file the list must be comma separated. If a single host is specified, a trailing comma must be present.

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

asked 16/09/2024
Earl Frederick
32 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first