Interview Prep/Ansible/Rolling Updates, Delegation and Safe Deployments

How do you drive batch size from the outside without editing the playbook?

BeginnerProductionRolling Updates, Delegation and Safe Deployments
Answer

Template serial from a variable with a safe default, and let the pipeline or AWX survey set it.

- hosts: web
  serial: "{{ rollout_batch | default('25%') }}"
ansible-playbook deploy.yml -e rollout_batch=1     # careful, one at a time
ansible-playbook deploy.yml -e rollout_batch=100%  # emergency, everything at once

Operators get a safe default and an escape hatch for emergencies or for a cautious first production rollout.

All Ansible questions Roadmap: Ansible

More on Rolling Updates, Delegation and Safe Deployments