epiphany
epiphany copied to clipboard
[FEATURE REQUEST] Refactor merging Ansible variables
Is your feature request related to a problem? Please describe. For upgrade mode, we use variables from a few sources:
-
manifest.yml
- settings used forepicli apply
but merged with current default configuration -
main.yml
- may contain only current default configuration or configuration provided by user but merged with current default configuration
Such logic has the following drawbacks:
- Due to merging it's not possible to easily check which settings are from
apply
mode and which are current defaults - Due to merging it's not possible to check which settings were provided by user via config file (using
-f
flag) - Due to merging we have in
main.yml
many settings that are not supported/used inupgrade
mode -
main.yml
is loaded automatically by Ansible at top level
Describe the solution you'd like
The var
directory may contain the following files:
-
manifest.yml
- contains only unmodified config from the lastapply
run (no merging); generated only for specified roles (to safe time) -
defaults.yml
- contains current default configuration, it may be used during upgrade to get default values for new settings; it seems there is no need to generate them automatically for all roles -
main.yml
- probably only forcommon
role since it's not configurable -
upgrade-config.yml
- exists only when-f
flag was used, settings provided by user that are supported in upgrade mode, they will override settings from other sources -
manifest_merged_with_defaults.yml
- optionally, equivalent of currentmanifest.yml
, for backward compatibility - to avoid risky/breaking changes, treated as deprecated and to be removed in the future
Describe alternatives you've considered n/a
Additional context Feature needed for PostgreSQL upgrade.
DoD checklist
- Changelog
- [ ] updated
- [ ] not needed
- COMPONENTS.md
- [ ] updated
- [ ] not needed
- Schema
- [ ] updated
- [ ] not needed
- Backport tasks
- [ ] created
- [ ] not needed
- Documentation
- [ ] added
- [ ] updated
- [ ] not needed
- [ ] Feature has automated tests
- [ ] Automated tests passed (QA pipelines)
- [ ] apply
- [ ] upgrade
- [ ] backup/restore
- [ ] Idempotency tested
- [ ] All conversations in PR resolved
- [ ] Solution meets requirements and is done according to design doc
- [ ] Usage compliant with license