{"id":483,"date":"2022-02-05T18:31:05","date_gmt":"2022-02-05T18:31:05","guid":{"rendered":"https:\/\/exampracticetests.com\/aws\/DevOps_Engineer_Professional_DOP-C01\/aws-devops-engineer-professional-dop-c01-question471\/"},"modified":"2022-02-05T18:31:05","modified_gmt":"2022-02-05T18:31:05","slug":"aws-devops-engineer-professional-dop-c01-question471","status":"publish","type":"post","link":"https:\/\/exampracticetests.com\/aws\/DevOps_Engineer_Professional_DOP-C01\/aws-devops-engineer-professional-dop-c01-question471\/","title":{"rendered":"AWS DevOps Engineer Professional DOP-C01 &#8211; Question471"},"content":{"rendered":"<div class=\"question\">When specifying more than one conditional requirements for a task, what is the proper method?<br \/><strong><br \/>A.<\/strong> &#8211; when: foo == &quot;hello&quot; and bar == &quot;world&quot;<br \/><strong>B.<\/strong> &#8211; when: foo == &quot;hello&quot; &#8211; when: bar == &quot;world&quot;<br \/><strong>C.<\/strong> &#8211; when: foo == &quot;hello&quot; &amp;&amp; bar == &quot;world&quot;<br \/><strong>D.<\/strong> &#8211; when: foo is &quot;hello&quot; and bar is &quot;world&quot;<\/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>A<\/strong><\/div>\n<p><strong>Explanation:<\/strong> <\/p>\n<div class=\"explanation\">\nExplanation:<br \/>\nAnsible will allow you to stack conditionals using `and&#8217; and `or&#8217;. It requires it to be in the same `when&#8217; statement, comparisons must be `==&#8217; for equals or `!=&#8217; for not equals and the `and\/or&#8217; must be written as such, not `&#038;&#038;\/||&#8217;.<br \/>\nReference:<br \/>\n<a href=\"http:\/\/docs.ansible.com\/ansible\/playbooks_conditionals.html#the-when-statement\" title=\"External link\" rel=\"nofollow noopener\" target=\"_blank\">http:\/\/docs.ansible.com\/ansible\/playbooks_conditionals.html#the-whe&#8230;<\/a><\/div>\n<p><\/strong><\/span> <\/div>\n","protected":false},"excerpt":{"rendered":"<p>When specifying more than one conditional requirements for a task, what is the proper method?A. &#8211; when: foo == &quot;hello&quot; and bar == &quot;world&quot;B. &#8211; when: foo == &quot;hello&quot; &#8211; when: bar == &quot;world&quot;C. &#8211; when: foo == &quot;hello&quot; &amp;&amp; bar == &quot;world&quot;D. &#8211; when: foo is &quot;hello&quot; and bar is &quot;world&quot; Show Answer Hide [&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,474],"class_list":["post-483","post","type-post","status-publish","format-standard","hentry","category-aws-devops-engineer-professional-dop-c01","tag-aws-devops-engineer-professional-dop-c01","tag-question-471"],"_links":{"self":[{"href":"https:\/\/exampracticetests.com\/aws\/DevOps_Engineer_Professional_DOP-C01\/wp-json\/wp\/v2\/posts\/483","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=483"}],"version-history":[{"count":0,"href":"https:\/\/exampracticetests.com\/aws\/DevOps_Engineer_Professional_DOP-C01\/wp-json\/wp\/v2\/posts\/483\/revisions"}],"wp:attachment":[{"href":"https:\/\/exampracticetests.com\/aws\/DevOps_Engineer_Professional_DOP-C01\/wp-json\/wp\/v2\/media?parent=483"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/exampracticetests.com\/aws\/DevOps_Engineer_Professional_DOP-C01\/wp-json\/wp\/v2\/categories?post=483"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/exampracticetests.com\/aws\/DevOps_Engineer_Professional_DOP-C01\/wp-json\/wp\/v2\/tags?post=483"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}