nerdexam
Cisco

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.

Infrastructure and Automation

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

200-901 question #479 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)
  • A
    2% (1)
  • C
    4% (2)
  • D
    94% (45)

Why each option

An Ansible playbook using 'state: latest' installs or upgrades all listed packages to their most current available version.

AThe Vim, Git, and Pip packages are removed.

The 'state: latest' directive installs or upgrades packages rather than removing them; the value 'state: absent' is required to uninstall packages.

BThe Vim, Git, and Pip packages are backed up.

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.

COnly the Vim package is installed as the most recent package.

The task lists all three packages - Vim, Git, and Pip - so the module processes all three, not only Vim.

DThe most relevant versions of the Vim, Git, and Pip packages are installed.Correct

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

#Ansible#Package Management#Server Provisioning#Automation

Community Discussion

No community discussion yet for this question.

Full 200-901 Practice