environment overlay
Keeping one shared playbook and putting the values that differ between environments in separate variable files, one per environment.
In more detail
Defaults set the common baseline, group variables describe each environment such as staging or production, and host variables handle narrow exceptions. Choosing the inventory at launch chooses the data, so a logic fix is made once and reaches every environment. Copying a playbook to change three values is the pattern this replaces.
Related terms
- group_vars — A directory whose files hold variables for inventory groups, one file or folder per group, named exactly after the group.
- host_vars — A directory whose files hold variables for single hosts, each file named exactly as the host is spelled in the inventory.
- role defaults — The variables in a role's defaults/main.yml: safe starting values that callers are expected to override.
- staging — A pre-production environment set up like production, where changes are tried out before they reach real users.
- production — The live environment where real users use the service, as opposed to development or testing.
- baseline — A recorded reference state, such as agreed settings or normal behaviour, that later states are compared against.
Taught in
- Vault IDs And Multiple Passwords — Ansible Configuration Management at Scale
- Environment Specific Configuration — Ansible Configuration Management at Scale