{"id":472,"date":"2022-02-05T18:30:53","date_gmt":"2022-02-05T18:30:53","guid":{"rendered":"https:\/\/exampracticetests.com\/aws\/DevOps_Engineer_Professional_DOP-C01\/aws-devops-engineer-professional-dop-c01-question460\/"},"modified":"2022-02-05T18:30:53","modified_gmt":"2022-02-05T18:30:53","slug":"aws-devops-engineer-professional-dop-c01-question460","status":"publish","type":"post","link":"https:\/\/exampracticetests.com\/aws\/DevOps_Engineer_Professional_DOP-C01\/aws-devops-engineer-professional-dop-c01-question460\/","title":{"rendered":"AWS DevOps Engineer Professional DOP-C01 &#8211; Question460"},"content":{"rendered":"<div class=\"question\">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?<br \/><strong><br \/>A.<\/strong> &#8211; with: &lt;value&gt;<br \/><strong>B.<\/strong> &#8211; with_items: &lt;value&gt;<br \/><strong>C.<\/strong> &#8211; only_when: &lt;conditional&gt;<br \/><strong>D.<\/strong> &#8211; items: &lt;value&gt;<\/div>\n<p><\/p>\n<style> .hidden-div{ display:none } <\/style>\n<p>\t\t\t\t\t\t\t<button onclick=\"getElementById('hidden-div').style.display = 'block'\"> Show Answer <\/button> <button onclick=\"getElementById('hidden-div').style.display = 'none'\">Hide Answer<\/button><\/p>\n<div class=\"hidden-div\" id=\"hidden-div\"><span style=\"\"><\/p>\n<div class=\"answer\">Correct Answer: <strong>B<\/strong><\/div>\n<p><strong>Explanation:<\/strong> <\/p>\n<div class=\"explanation\">\nExplanation:<br \/>\nAnsible provides two methods for controlling tasks, loops and conditionals. The &#8220;with_items&#8221; context will allow the task to loop through a list of items, while the `when&#8217; context will allow a conditional requirement to be met for the task to run. Both can be used at the same time.<br \/>\nReference:<br \/>\n<a href=\"http:\/\/docs.ansible.com\/ansible\/playbooks_conditionals.html#loops-and-conditionals\" title=\"External link\" rel=\"nofollow noopener\" target=\"_blank\">http:\/\/docs.ansible.com\/ansible\/playbooks_conditionals.html#loops-a&#8230;<\/a><\/div>\n<p><\/strong><\/span> <\/div>\n","protected":false},"excerpt":{"rendered":"<p>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. &#8211; with: &lt;value&gt;B. &#8211; with_items: &lt;value&gt;C. &#8211; only_when: &lt;conditional&gt;D. &#8211; items: &lt;value&gt; Show Answer Hide Answer Correct Answer: B Explanation: Explanation: Ansible provides two methods for controlling [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[3,463],"class_list":["post-472","post","type-post","status-publish","format-standard","hentry","category-aws-devops-engineer-professional-dop-c01","tag-aws-devops-engineer-professional-dop-c01","tag-question-460"],"_links":{"self":[{"href":"https:\/\/exampracticetests.com\/aws\/DevOps_Engineer_Professional_DOP-C01\/wp-json\/wp\/v2\/posts\/472","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/exampracticetests.com\/aws\/DevOps_Engineer_Professional_DOP-C01\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/exampracticetests.com\/aws\/DevOps_Engineer_Professional_DOP-C01\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/exampracticetests.com\/aws\/DevOps_Engineer_Professional_DOP-C01\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/exampracticetests.com\/aws\/DevOps_Engineer_Professional_DOP-C01\/wp-json\/wp\/v2\/comments?post=472"}],"version-history":[{"count":0,"href":"https:\/\/exampracticetests.com\/aws\/DevOps_Engineer_Professional_DOP-C01\/wp-json\/wp\/v2\/posts\/472\/revisions"}],"wp:attachment":[{"href":"https:\/\/exampracticetests.com\/aws\/DevOps_Engineer_Professional_DOP-C01\/wp-json\/wp\/v2\/media?parent=472"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/exampracticetests.com\/aws\/DevOps_Engineer_Professional_DOP-C01\/wp-json\/wp\/v2\/categories?post=472"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/exampracticetests.com\/aws\/DevOps_Engineer_Professional_DOP-C01\/wp-json\/wp\/v2\/tags?post=472"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}