epiphany icon indicating copy to clipboard operation
epiphany copied to clipboard

[FEATURE REQUEST] Refactor merging Ansible variables

Open to-bar opened this issue 3 years ago • 0 comments

Is your feature request related to a problem? Please describe. For upgrade mode, we use variables from a few sources:

  1. manifest.yml - settings used for epicli apply but merged with current default configuration
  2. 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:

  1. Due to merging it's not possible to easily check which settings are from apply mode and which are current defaults
  2. Due to merging it's not possible to check which settings were provided by user via config file (using -f flag)
  3. Due to merging we have in main.yml many settings that are not supported/used in upgrade mode
  4. main.yml is loaded automatically by Ansible at top level

Describe the solution you'd like The var directory may contain the following files:

  1. manifest.yml - contains only unmodified config from the last apply run (no merging); generated only for specified roles (to safe time)
  2. 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
  3. main.yml - probably only for common role since it's not configurable
  4. 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
  5. manifest_merged_with_defaults.yml - optionally, equivalent of current manifest.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

to-bar avatar Aug 04 '21 16:08 to-bar