Generalize Omnibus config templating
Praefect's and Gitaly's Omnibus config templates require manual updates each time there are configuration options added or removed. This seems like a lot of meaningless work which could be avoided by a more general approach. Historically there's been multiple occasions, such as #4466 (closed), when the templates either don't support new values or still include values that have been removed.
This could be improved upon by simply marshaling the Gitlab['praefect']
or Gitlab['gitaly']
maps into TOML and expecting them to be structured the same way as the actual configs are structured. This way we wouldn't have to separately add or remove support for each config option in Omnibus. Some keys and the hierarchy of the maps don't exactly match the ones used in Gitaly or Praefect so we'll have to add some logic for backwards compatibility in Omnibus to place the values from the old locations to the new ones until the next major release.
The maps also contain some Omnibus specific keys the which we should filter out. One such example is the consul_service_name
. We should either create a filter list for these or locate the actual service config in a sub map, like Gitlab['praefect']['config']
which would contain only the config as used by Praefect or Gitaly directly.
Additionally, there's a lot of duplication with the default values. Sometimes the defaults are set in a manner that overrides Gitaly's or Praefect's defaults for no good reason, requiring updates in two locations when the defaults are changed. We should remove the duplication and only leave the default values set which Omnibus actually needs to override.
With these changes in place, Omnibus would only have to be touched on configuration changes when it needs to specifically override some value.