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

What forms can `serial` take?

IntermediateProductionRolling Updates, Delegation and Safe Deployments
Answer

An integer, a percentage of the play's hosts, or a list that grows the batch size progressively.

serial: 5            # five at a time
serial: "20%"        # 20 percent of hosts per batch (rounded up)
serial: [1, "10%", "50%"]   # canary of 1, then 10%, then 50% batches until done

The last value in a list repeats until all hosts are done. Percentages are relative to the number of hosts in the play, not the whole inventory. A variable works too, serial: "{{ batch_size | default(2) }}", so operators can slow a rollout down at launch time.

All Ansible questions Roadmap: Ansible

More on Rolling Updates, Delegation and Safe Deployments