Ansible interview question
Explain serial, delegate_to, when and notify in Ansible.
How it works Asked in DevOps Engineer interviews
Summary
serial limits how many hosts a play changes at once (rolling updates); delegate_to runs a task on a different
host than the one being processed (for example, the load balancer); when makes a task conditional; and
notify triggers a handler if the task reports a change.
Keep reading with a membership
The full answer with examples, key points and comparisons is part of the membership, along with every other interview answer, progress tracking and Daily Review. Most-asked answers stay free to read.
More Ansible questions
- What is idempotency in Ansible, and how do you keep your own tasks idempotent?
- Write an Ansible playbook that installs Nginx, deploys its configuration, enables the service and restarts it only when the configuration changes.
- Explain Ansible's architecture: control node, inventory, modules, playbooks, roles and handlers.
- How would you automate TLS certificate installation and renewal with Ansible?
- How would you configure 100 Linux servers consistently with Ansible?
- How do Ansible and Terraform work together in one delivery pipeline?
- A playbook run fails halfway through 50 hosts. What do you do?
- How do you test Ansible roles before they reach production?