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.
More on Rolling Updates, Delegation and Safe Deployments
How do you do a rolling update with Ansible?BeginnerShow the standard pattern for a zero-downtime rolling deploy behind a load balancer.IntermediateWhy do you add a health check inside the deployment play?BeginnerHow do `any_errors_fatal` and `max_fail_percentage` help a rollout?BeginnerHow do you do a canary deployment?IntermediateHow would you implement blue/green deployment with Ansible?Advanced