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

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
All Ansible questions Roadmap: Ansible

More on Rolling Updates, Delegation and Safe Deployments