200-901 · Question #479
200-901 Question #479: Real Exam Question with Answer & Explanation
The correct answer is D: The most relevant versions of the Vim, Git, and Pip packages are installed.. An Ansible playbook using 'state: latest' installs or upgrades all listed packages to their most current available version.
Question
Refer to the exhibit. An engineer develops an Ansible playbook to perform tasks that automate the provisioning of a server. What occurs on the server after the playbook is run?
Options
- AThe Vim, Git, and Pip packages are removed.
- BThe Vim, Git, and Pip packages are backed up.
- COnly the Vim package is installed as the most recent package.
- DThe most relevant versions of the Vim, Git, and Pip packages are installed.
Explanation
An Ansible playbook using 'state: latest' installs or upgrades all listed packages to their most current available version.
Common mistakes.
- A. The 'state: latest' directive installs or upgrades packages rather than removing them; the value 'state: absent' is required to uninstall packages.
- B. Ansible package modules have no built-in backup state; the supported states are 'present', 'absent', 'latest', and 'fixed' depending on the module, none of which create file backups.
- C. The task lists all three packages - Vim, Git, and Pip - so the module processes all three, not only Vim.
Concept tested. Ansible package module with state: latest for multiple packages
Reference. https://docs.ansible.com/ansible/latest/collections/ansible/builtin/apt_module.html
Topics
Community Discussion
No community discussion yet for this question.