{"id":471,"date":"2022-02-05T18:30:52","date_gmt":"2022-02-05T18:30:52","guid":{"rendered":"https:\/\/exampracticetests.com\/aws\/DevOps_Engineer_Professional_DOP-C01\/aws-devops-engineer-professional-dop-c01-question459\/"},"modified":"2022-02-05T18:30:52","modified_gmt":"2022-02-05T18:30:52","slug":"aws-devops-engineer-professional-dop-c01-question459","status":"publish","type":"post","link":"https:\/\/exampracticetests.com\/aws\/DevOps_Engineer_Professional_DOP-C01\/aws-devops-engineer-professional-dop-c01-question459\/","title":{"rendered":"AWS DevOps Engineer Professional DOP-C01 &#8211; Question459"},"content":{"rendered":"<div class=\"question\">When specifying multiple variable names and values for a playbook on the command line, which of the following is the correct syntax?<br \/><strong><br \/>A.<\/strong> ansible-playbook playbook.yml -e `host=&quot;foo&quot; pkg=&quot;bar&quot;&#039;<br \/><strong>B.<\/strong> ansible-playbook playbook.yml -e `host: &quot;foo&quot;, pkg: &quot;bar&quot;&#039;<br \/><strong>C.<\/strong> ansible-playbook playbook.yml -e `host=&quot;foo&quot;&#039; -e `pkg=&quot;bar&quot;&#039;<br \/><strong>D.<\/strong> ansible-playbook playbook.yml &#8211;extra-vars &quot;host=foo&quot;, &quot;pkg=bar&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 \/>\nVariables are passed in a single command line parameter, `-e&#8217; or `&#8211;extra-vars&#8217;. They are sent as a single string to the playbook and are space delimited. Because of the space delimeter, variable values must be encapsulated in quotes. Additionally, proper JSON or YAML can be passed, such as: `-e `{&#8220;key&#8221;: &#8220;name&#8221;, &#8220;array&#8221;: [&#8220;value1&#8221;, &#8220;value2&#8221;]}&#8217;.<br \/>\nReference:<br \/>\n<a href=\"http:\/\/docs.ansible.com\/ansible\/playbooks_variables.html#passing-variables-on-the-commandline\" title=\"External link\" rel=\"nofollow noopener\" target=\"_blank\">http:\/\/docs.ansible.com\/ansible\/playbooks_variables.html#passing-va&#8230;<\/a><\/div>\n<p><\/strong><\/span> <\/div>\n","protected":false},"excerpt":{"rendered":"<p>When specifying multiple variable names and values for a playbook on the command line, which of the following is the correct syntax?A. ansible-playbook playbook.yml -e `host=&quot;foo&quot; pkg=&quot;bar&quot;&#039;B. ansible-playbook playbook.yml -e `host: &quot;foo&quot;, pkg: &quot;bar&quot;&#039;C. ansible-playbook playbook.yml -e `host=&quot;foo&quot;&#039; -e `pkg=&quot;bar&quot;&#039;D. ansible-playbook playbook.yml &#8211;extra-vars &quot;host=foo&quot;, &quot;pkg=bar&quot; Show Answer Hide Answer Correct Answer: A Explanation: Explanation: Variables [&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,462],"class_list":["post-471","post","type-post","status-publish","format-standard","hentry","category-aws-devops-engineer-professional-dop-c01","tag-aws-devops-engineer-professional-dop-c01","tag-question-459"],"_links":{"self":[{"href":"https:\/\/exampracticetests.com\/aws\/DevOps_Engineer_Professional_DOP-C01\/wp-json\/wp\/v2\/posts\/471","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=471"}],"version-history":[{"count":0,"href":"https:\/\/exampracticetests.com\/aws\/DevOps_Engineer_Professional_DOP-C01\/wp-json\/wp\/v2\/posts\/471\/revisions"}],"wp:attachment":[{"href":"https:\/\/exampracticetests.com\/aws\/DevOps_Engineer_Professional_DOP-C01\/wp-json\/wp\/v2\/media?parent=471"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/exampracticetests.com\/aws\/DevOps_Engineer_Professional_DOP-C01\/wp-json\/wp\/v2\/categories?post=471"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/exampracticetests.com\/aws\/DevOps_Engineer_Professional_DOP-C01\/wp-json\/wp\/v2\/tags?post=471"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}