Support multilevel configuration
rafaelma opened this issue · comments
Today, we support a singlelevel configuration system with two possible locations for our configuration file:
- $HOME/.pgbackman/pgbackman.conf
- /etc/pgbackman/pgbackman.conf
Pgbackman checks for a configuration file in these locations and in this order and will use the first one that exists. This means that you can always override: 2) with 1).
In a multilevel configuration system we will not override the entire configuration file but we will merge all the defined configuration files and will use the parameters values defined in the configuration file with higher priority if a parameter is defined in more than one file.
- /usr/share/pgbackman/pgbackman.fixed.conf
- /etc/pgbackman/pgbackman.fixed.conf
- Configuration file defined with the parameter -c / --config when executing pgbackman
- $HOME/.pgbackman/pgbackman.conf
- /etc/pgbackman/pgbackman.conf
- /usr/share/pgbackman/pgabckman.conf
With this implementation:
- Local configuration will be kept during upgrades
- The local configuration is separate from the package default
- Several actors will be allow to have their own files
- It is possible to provide package, host and user defaults, as well as locking down features on a host, package level.
- Always well known where the admin made his changes