What are good pre-flight checks before a production change?
BeginnerProductionRolling Updates, Delegation and Safe Deployments
Answer
Put cheap assertions at the start of the play so you fail before anything changes:
- required variables are defined and well-formed
- enough free disk space (
ansible_facts['mounts']) - target version is not older than the installed one
- cluster is healthy (replication lag, quorum)
- the maintenance window or change ticket is valid
- connectivity to the artifact store
- ansible.builtin.assert:
that:
- app_version is match('^\d+\.\d+\.\d+$')
- (ansible_facts['mounts'] | selectattr('mount','eq','/') | first).size_available > 2000000000
More on Rolling Updates, Delegation and Safe Deployments
How do you do a rolling update with Ansible?BeginnerWhat forms can `serial` take?IntermediateShow 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?Intermediate