200-901 · Question #479
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?
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?
Exhibit
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.
How the community answered
(48 responses)- A2% (1)
- C4% (2)
- D94% (45)
Why each option
An Ansible playbook using 'state: latest' installs or upgrades all listed packages to their most current available version.
The 'state: latest' directive installs or upgrades packages rather than removing them; the value 'state: absent' is required to uninstall packages.
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.
The task lists all three packages - Vim, Git, and Pip - so the module processes all three, not only Vim.
When an Ansible package task specifies 'state: latest', the module checks whether each listed package is installed and whether a newer version is available in the configured repository. Since Vim, Git, and Pip are all listed in the same task with 'state: latest', all three packages are installed or upgraded to the most current version simultaneously on the target server.
Concept tested: Ansible package module with state: latest for multiple packages
Source: https://docs.ansible.com/ansible/latest/collections/ansible/builtin/apt_module.html
Topics
Community Discussion
No community discussion yet for this question.
