ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 216 - DOP-C01 discussion

Report
Export

Ansible provides some methods for controlling how or when a task is ran. Which of the following is a valid method for controlling a task with a loop?

A.
- with:
Answers
A.
- with:
B.
- with_items:
Answers
B.
- with_items:
C.
- only_when:
Answers
C.
- only_when:
D.
- items:
Answers
D.
- items:
Suggested answer: B

Explanation:

Ansible provides two methods for controlling tasks, loops and conditionals. The "with_items" context will allow the task to loop through a list of items, while the `when' context will allow a conditional requirement to be met for the task to run. Both can be used at the same time.

Reference: http://docs.ansible.com/ansible/playbooks_conditionals.html#loops-and-conditionals

asked 16/09/2024
Christopher Castillo
35 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first