A systems administrator is tasked with automating a complex deployment process across a fleet of web servers. The process involves installing a web server package, deploying a custom configuration file from a template, and ensuring the web service is started and enabled. This entire workflow must be version-controlled and applied idempotently. Which Ansible component should the administrator create to define and orchestrate these sequential tasks?
The correct answer is an Ansible playbook. Playbooks are designed to orchestrate and execute a sequence of tasks across a defined set of hosts, making them ideal for complex, repeatable automation workflows like the one described. An Ansible ad-hoc command is used for single, simple tasks and is not suitable for a multi-step, version-controlled process. An Ansible inventory file is used to define and group the managed hosts, but it does not define the tasks to be executed. An Ansible role is a way to group and reuse automation content (like tasks and templates), and while it would likely be used within the playbook, the playbook itself is the top-level component that defines the overall orchestration for the specified hosts.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is YAML, and why is it used in Ansible playbooks?