nerdexam
Cisco

200-901 · Question #219

Refer to the exhibit. A developer must integrate a bot with an internal communication app. The developer wants to replace the webexbot package with the teamsbot package by using Ansible and prepares…

The correct answer is C. uninstalls the webexbot package and removes its configuration files. In Ansible, using state: absent with purge: yes for a package module uninstalls the specified package and also removes all associated configuration files, ensuring a clean removal.

Infrastructure and Automation

Question

Refer to the exhibit. A developer must integrate a bot with an internal communication app. The developer wants to replace the webexbot package with the teamsbot package by using Ansible and prepares a playbook. In the first two tasks, the playbook stops the webexbot and verifies that the teamsbot is installed. What is accomplished in the last task of the workflow when the developer runs the Ansible playbook?

Exhibit

200-901 question #219 exhibit

Options

  • Astops the webexbot service and uninstals it and retains its configuration files
  • Binstalls the webexbot and retains the configuration files
  • Cuninstalls the webexbot package and removes its configuration files
  • Dsearches whether the purge package is available in the repository and uninstalls the webexbot

How the community answered

(25 responses)
  • B
    4% (1)
  • C
    88% (22)
  • D
    8% (2)

Why each option

In Ansible, using `state: absent` with `purge: yes` for a package module uninstalls the specified package and also removes all associated configuration files, ensuring a clean removal.

Astops the webexbot service and uninstals it and retains its configuration files

This option incorrectly states that configuration files are retained; the `purge: yes` argument is specifically used to remove them.

Binstalls the webexbot and retains the configuration files

This option describes installing `webexbot` and retaining files, which is the opposite of the goal (replacing it) and the effect of `state: absent, purge: yes`.

Cuninstalls the webexbot package and removes its configuration filesCorrect

When using an Ansible package module (like `apt` or `yum`) with `state: absent` and `purge: yes`, the module not only uninstalls the specified package (e.g., `webexbot`) but also thoroughly removes all associated configuration files. This ensures a complete cleanup before installing a replacement package like `teamsbot`.

Dsearches whether the purge package is available in the repository and uninstalls the webexbot

The playbook directly uninstalls and purges the package; it does not first search for the `purge` package or its availability in the repository, as `purge` is a parameter of the package module itself.

Concept tested: Ansible package management - uninstalling with purge

Source: https://docs.ansible.com/ansible/latest/collections/ansible/builtin/apt_module.html

Topics

#Ansible#Package Management#Automation#Playbook Logic

Community Discussion

No community discussion yet for this question.

Full 200-901 Practice